Skip to content

Commit c66f67d

Browse files
committed
C#: Address review comment
1 parent 546d750 commit c66f67d

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

csharp/ql/src/semmle/code/csharp/Element.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class Element extends DotNet::Element, @element {
2222
* Where an element has multiple locations (for example a source file and an assembly),
2323
* gets only the source location.
2424
*/
25-
override Location getLocation() { result = Internal::bestLocation(this) }
25+
override Location getLocation() { result = ExprOrStmtParentCached::bestLocation(this) }
2626

2727
/** Gets the URL of this element. */
28-
string getURL() { result = Internal::getURL(this) }
28+
string getURL() { result = ExprOrStmtParentCached::getURL(this) }
2929

3030
/** Gets a location of this element, including sources and assemblies. */
3131
override Location getALocation() { none() }

csharp/ql/src/semmle/code/csharp/Enclosing.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
import Stmt
16-
private import semmle.code.csharp.ExprOrStmtParent as ExprOrStmtParent
16+
private import semmle.code.csharp.ExprOrStmtParent
1717

1818
/**
1919
* INTERNAL: Do not use.
@@ -35,7 +35,7 @@ cached module Internal {
3535
c.getAChildStmt+() = s
3636
}
3737

38-
private Expr getAChildExpr(ExprOrStmtParent::ExprOrStmtParent p) {
38+
private Expr getAChildExpr(ExprOrStmtParent p) {
3939
result = p.getAChildExpr() or
4040
result = p.(AssignOperation).getExpandedAssignment()
4141
}

csharp/ql/src/semmle/code/csharp/ExprOrStmtParent.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ private int getImplementationSize(ValueOrRefType t, File f) {
346346
result = getImplementationSize1(t, f)
347347
}
348348

349-
cached module Internal {
349+
cached module ExprOrStmtParentCached {
350350
cached
351351
ControlFlowElement getTopLevelChild(ExprOrStmtParent p, int i) {
352352
result = p.(MultiImplementationsParent).getBestChild(i)
@@ -404,4 +404,4 @@ cached module Internal {
404404
result = ""
405405
}
406406
}
407-
private import Internal
407+
private import ExprOrStmtParentCached

csharp/ql/src/semmle/code/csharp/controlflow/ControlFlowElement.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** Provides the class `ControlFlowElement`. */
22

33
import csharp
4-
private import semmle.code.csharp.ExprOrStmtParent as ExprOrStmtParent
4+
private import semmle.code.csharp.ExprOrStmtParent
55
private import ControlFlow
66
private import ControlFlow::BasicBlocks
77
private import SuccessorTypes
@@ -15,7 +15,7 @@ private import SuccessorTypes
1515
* control flow elements and control flow nodes. This allows control flow
1616
* splitting, for example modeling the control flow through `finally` blocks.
1717
*/
18-
class ControlFlowElement extends ExprOrStmtParent::ExprOrStmtParent, @control_flow_element {
18+
class ControlFlowElement extends ExprOrStmtParent, @control_flow_element {
1919
/** Gets the enclosing callable of this element, if any. */
2020
Callable getEnclosingCallable() { none() }
2121

csharp/ql/src/semmle/code/csharp/controlflow/ControlFlowGraph.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,7 +1769,7 @@ module ControlFlow {
17691769
* not return.
17701770
*/
17711771
private module NonReturning {
1772-
private import semmle.code.csharp.ExprOrStmtParent as ExprOrStmtParent
1772+
private import semmle.code.csharp.ExprOrStmtParent
17731773
private import semmle.code.csharp.commons.Assertions
17741774
private import semmle.code.csharp.frameworks.System
17751775

@@ -1810,7 +1810,7 @@ module ControlFlow {
18101810
private abstract class NonReturningCallable extends Callable {
18111811
NonReturningCallable() {
18121812
not exists(ReturnStmt ret | ret.getEnclosingCallable() = this) and
1813-
not ExprOrStmtParent::hasAccessorAutoImplementation(this, _) and
1813+
not hasAccessorAutoImplementation(this, _) and
18141814
not exists(Virtualizable v |
18151815
v.isOverridableOrImplementable() |
18161816
v = this or

0 commit comments

Comments
 (0)