Skip to content

Commit 575b837

Browse files
committed
C#: Update Flow summaries QL test code based on refactor.
1 parent ff1e663 commit 575b837

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

csharp/ql/test/library-tests/dataflow/library/FlowSummariesFiltered.ql

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ private import semmle.code.csharp.dataflow.internal.DataFlowPrivate::Csv
33
private import semmle.code.csharp.dataflow.ExternalFlow
44

55
class IncludeFilteredSummarizedCallable extends IncludeSummarizedCallable {
6-
IncludeFilteredSummarizedCallable() { exists(this) }
6+
IncludeFilteredSummarizedCallable() { this instanceof SummarizedCallable }
77

88
/**
99
* Holds if flow is propagated between `input` and `output` and
@@ -13,12 +13,11 @@ class IncludeFilteredSummarizedCallable extends IncludeSummarizedCallable {
1313
override predicate relevantSummary(
1414
SummaryComponentStack input, SummaryComponentStack output, boolean preservesValue
1515
) {
16-
this.propagatesFlow(input, output, preservesValue) and
17-
not exists(IncludeSummarizedCallable rsc, SummarizedCallable sc |
18-
sc = rsc.asSummarizedCallable() and
19-
isBaseCallableOrPrototype(sc) and
20-
rsc.propagatesFlow(input, output, preservesValue) and
21-
this.asSummarizedCallable().(UnboundCallable).overridesOrImplementsUnbound(sc)
16+
this.(SummarizedCallable).propagatesFlow(input, output, preservesValue) and
17+
not exists(IncludeSummarizedCallable rsc |
18+
isBaseCallableOrPrototype(rsc) and
19+
rsc.(SummarizedCallable).propagatesFlow(input, output, preservesValue) and
20+
this.(UnboundCallable).overridesOrImplementsUnbound(rsc)
2221
)
2322
}
2423
}

csharp/ql/test/library-tests/frameworks/EntityFramework/FlowSummaries.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import shared.FlowSummaries
33
import semmle.code.csharp.dataflow.ExternalFlow as ExternalFlow
44

55
private class IncludeEFSummarizedCallable extends IncludeSummarizedCallable {
6-
IncludeEFSummarizedCallable() { this.asSummarizedCallable() instanceof EFSummarizedCallable }
6+
IncludeEFSummarizedCallable() { this instanceof EFSummarizedCallable }
77
}
88

99
query predicate sourceNode(DataFlow::Node node, string kind) {

csharp/ql/test/shared/FlowSummaries.qll

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ private import semmle.code.csharp.dataflow.internal.DataFlowPrivate
44

55
abstract class IncludeSummarizedCallable extends RelevantSummarizedCallable {
66
IncludeSummarizedCallable() {
7-
this.asSummarizedCallable() =
8-
any(Callable c | [c.(Modifiable), c.(Accessor).getDeclaration()].isEffectivelyPublic())
7+
[this.(Modifiable), this.(Accessor).getDeclaration()].isEffectivelyPublic()
98
}
109

1110
/** Gets a string representing the callable in semi-colon separated format for use in flow summaries. */
12-
final override string getCallableCsv() {
13-
result = Csv::asPartialModel(this.asSummarizedCallable())
14-
}
11+
final override string getCallableCsv() { result = Csv::asPartialModel(this) }
1512
}

0 commit comments

Comments
 (0)