Skip to content

Commit 3af00a8

Browse files
committed
Java: Rename Negative Summary Model to Neutral Model.
1 parent 079d48c commit 3af00a8

File tree

11 files changed

+41
-45
lines changed

11 files changed

+41
-45
lines changed

java/ql/lib/ext/dummy.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ extensions:
1414
data: []
1515
- addsTo:
1616
pack: codeql/java-all
17-
extensible: extNegativeSummaryModel
17+
extensible: extNeutralModel
1818
data: []

java/ql/lib/ext/generated/kotlinstdlib.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ extensions:
18611861

18621862
- addsTo:
18631863
pack: codeql/java-all
1864-
extensible: extNegativeSummaryModel
1864+
extensible: extNeutralModel
18651865
data:
18661866
- ["kotlin.annotation", "AnnotationRetention", "valueOf", "(String)", "generated"]
18671867
- ["kotlin.annotation", "AnnotationRetention", "values", "()", "generated"]

java/ql/lib/ext/generated/org.apache.commons.io.model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ extensions:
676676

677677
- addsTo:
678678
pack: codeql/java-all
679-
extensible: extNegativeSummaryModel
679+
extensible: extNeutralModel
680680
data:
681681
- ["org.apache.commons.io.charset", "CharsetDecoders", "CharsetDecoders", "()", "generated"]
682682
- ["org.apache.commons.io.charset", "CharsetEncoders", "CharsetEncoders", "()", "generated"]

java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* `package; type; subtypes; name; signature; ext; input; kind; provenance`
1212
* - Summaries:
1313
* `package; type; subtypes; name; signature; ext; input; output; kind; provenance`
14-
* - Negative Summaries:
14+
* - Neutrals:
1515
* `package; type; name; signature; provenance`
16-
* A negative summary is used to indicate that there is no flow via a callable.
16+
* A neutral is used to indicate that there is no flow via a callable.
1717
*
1818
* The interpretation of a row is similar to API-graphs with a left-to-right
1919
* reading.
@@ -123,16 +123,16 @@ private class SummaryModelCsvInternal extends Unit {
123123
}
124124

125125
/**
126-
* DEPRECATED: Define negative summary models as data extensions instead.
126+
* DEPRECATED: Define neutral models as data extensions instead.
127127
*
128-
* A unit class for adding additional negative summary model rows.
128+
* A unit class for adding additional neutral model rows.
129129
*
130-
* Extend this class to add additional negative summary definitions.
130+
* Extend this class to add additional neutral definitions.
131131
*/
132-
deprecated class NegativeSummaryModelCsv = NegativeSummaryModelCsvInternal;
132+
deprecated class NeutralModelCsv = NeutralModelCsvInternal;
133133

134-
private class NegativeSummaryModelCsvInternal extends Unit {
135-
/** Holds if `row` specifies a negative summary definition. */
134+
private class NeutralModelCsvInternal extends Unit {
135+
/** Holds if `row` specifies a neutral definition. */
136136
abstract predicate row(string row);
137137
}
138138

@@ -142,9 +142,7 @@ private predicate summaryModelInternal(string row) { any(SummaryModelCsvInternal
142142

143143
private predicate sinkModelInternal(string row) { any(SinkModelCsvInternal s).row(row) }
144144

145-
private predicate negativeSummaryModelInternal(string row) {
146-
any(NegativeSummaryModelCsvInternal s).row(row)
147-
}
145+
private predicate neutralModelInternal(string row) { any(NeutralModelCsvInternal s).row(row) }
148146

149147
/**
150148
* Holds if an experimental source model exists for the given parameters.
@@ -313,25 +311,23 @@ predicate summaryModel(
313311
.summaryModel(package, type, subtypes, name, signature, ext, input, output, kind, provenance)
314312
}
315313

316-
/** Holds if a summary model exists indicating there is no flow for the given parameters. */
317-
extensible predicate extNegativeSummaryModel(
314+
/** Holds if a neutral model exists indicating there is no flow for the given parameters. */
315+
extensible predicate extNeutralModel(
318316
string package, string type, string name, string signature, string provenance
319317
);
320318

321-
/** Holds if a summary model exists indicating there is no flow for the given parameters. */
322-
predicate negativeSummaryModel(
323-
string package, string type, string name, string signature, string provenance
324-
) {
319+
/** Holds if a neutral model exists indicating there is no flow for the given parameters. */
320+
predicate neutralModel(string package, string type, string name, string signature, string provenance) {
325321
exists(string row |
326-
negativeSummaryModelInternal(row) and
322+
neutralModelInternal(row) and
327323
row.splitAt(";", 0) = package and
328324
row.splitAt(";", 1) = type and
329325
row.splitAt(";", 2) = name and
330326
row.splitAt(";", 3) = signature and
331327
row.splitAt(";", 4) = provenance
332328
)
333329
or
334-
extNegativeSummaryModel(package, type, name, signature, provenance)
330+
extNeutralModel(package, type, name, signature, provenance)
335331
}
336332

337333
private predicate relevantPackage(string package) {
@@ -473,7 +469,7 @@ module ModelValidation {
473469
or
474470
summaryModelInternal(row) and expect = 10 and pred = "summary"
475471
or
476-
negativeSummaryModelInternal(row) and expect = 5 and pred = "negative summary"
472+
neutralModelInternal(row) and expect = 5 and pred = "neutral"
477473
|
478474
exists(int cols |
479475
cols = 1 + max(int n | exists(row.splitAt(";", n))) and
@@ -497,9 +493,9 @@ module ModelValidation {
497493
summaryModel(package, type, _, name, signature, ext, _, _, _, provenance) and
498494
pred = "summary"
499495
or
500-
negativeSummaryModel(package, type, name, signature, provenance) and
496+
neutralModel(package, type, name, signature, provenance) and
501497
ext = "" and
502-
pred = "negative summary"
498+
pred = "neutral"
503499
|
504500
not package.regexpMatch("[a-zA-Z0-9_\\.]*") and
505501
result = "Dubious package \"" + package + "\" in " + pred + " model."
@@ -541,7 +537,7 @@ private predicate elementSpec(
541537
or
542538
summaryModel(package, type, subtypes, name, signature, ext, _, _, _, _)
543539
or
544-
negativeSummaryModel(package, type, name, signature, _) and ext = "" and subtypes = false
540+
neutralModel(package, type, name, signature, _) and ext = "" and subtypes = false
545541
}
546542

547543
private string paramsStringPart(Callable c, int i) {
@@ -590,7 +586,7 @@ private Element interpretElement0(
590586
)
591587
}
592588

593-
/** Gets the source/sink/summary/negativesummary element corresponding to the supplied parameters. */
589+
/** Gets the source/sink/summary/neutral element corresponding to the supplied parameters. */
594590
Element interpretElement(
595591
string package, string type, boolean subtypes, string name, string signature, string ext
596592
) {

java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImplSpecific.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ predicate summaryElement(
160160
}
161161

162162
/**
163-
* Holds if a negative flow summary exists for `c`, which means that there is no
164-
* flow through `c`. The flag `generated` states whether the summary is autogenerated.
163+
* Holds if a neutral model exists for `c`, which means that there is no
164+
* flow through `c`. The flag `generated` states whether the model is autogenerated.
165165
*/
166-
predicate negativeSummaryElement(SummarizedCallableBase c, boolean generated) {
166+
predicate neutralElement(SummarizedCallableBase c, boolean generated) {
167167
exists(string namespace, string type, string name, string signature, string provenance |
168-
negativeSummaryModel(namespace, type, name, signature, provenance) and
168+
neutralModel(namespace, type, name, signature, provenance) and
169169
generated = isGenerated(provenance) and
170170
c.asCallable() = interpretElement(namespace, type, false, name, signature, "")
171171
)

java/ql/src/Telemetry/SupportedExternalApis.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ private predicate relevant(ExternalApi api) {
1414
not api.isUninteresting() and
1515
(
1616
api.isSupported() or
17-
api = any(FlowSummaryImpl::Public::NegativeSummarizedCallable nsc).asCallable()
17+
api = any(FlowSummaryImpl::Public::NeutralCallable nsc).asCallable()
1818
)
1919
}
2020

java/ql/src/Telemetry/UnsupportedExternalAPIs.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ExternalApi
1313
private predicate relevant(ExternalApi api) {
1414
not api.isUninteresting() and
1515
not api.isSupported() and
16-
not api = any(FlowSummaryImpl::Public::NegativeSummarizedCallable nsc).asCallable()
16+
not api = any(FlowSummaryImpl::Public::NeutralCallable nsc).asCallable()
1717
}
1818

1919
from string apiName, int usages

java/ql/src/utils/model-generator/CaptureNegativeSummaryModels.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @name Capture negative summary models.
3-
* @description Finds negative summary models to be used by other queries.
2+
* @name Capture neutral models.
3+
* @description Finds neutral models to be used by other queries.
44
* @kind diagnostic
5-
* @id java/utils/model-generator/negative-summary-models
5+
* @id java/utils/model-generator/neutral-models
66
* @tags model-generator
77
*/
88

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
2-
* @name Extract MaD negative summary model rows.
3-
* @description This extracts the Models as data negative summary model rows.
4-
* @id java/utils/modelconverter/generate-data-extensions-negative-summary
2+
* @name Extract MaD neutral model rows.
3+
* @description This extracts the Models as data neutral model rows.
4+
* @id java/utils/modelconverter/generate-data-extensions-neutral
55
*/
66

77
import java
88
import semmle.code.java.dataflow.ExternalFlow
99

1010
from string package, string type, string name, string signature, string provenance
1111
where
12-
negativeSummaryModel(package, type, name, signature, provenance) and
12+
neutralModel(package, type, name, signature, provenance) and
1313
provenance != "generated"
1414
select package, type, name, signature, provenance order by package, type, name, signature

java/ql/src/utils/modelgenerator/internal/CaptureModelsSpecific.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ string asPartialModel(TargetApiSpecific api) {
131131
}
132132

133133
/**
134-
* Computes the first 4 columns for negative CSV rows.
134+
* Computes the first 4 columns for neutral CSV rows.
135135
*/
136-
string asPartialNegativeModel(TargetApiSpecific api) {
136+
string asPartialNeutralModel(TargetApiSpecific api) {
137137
exists(string type, string name, string parameters |
138138
partialModel(api, type, name, parameters) and
139139
result =

0 commit comments

Comments
 (0)