Skip to content

Commit a43f3cf

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: remove Supplier.get model
1 parent f040ff2 commit a43f3cf

File tree

4 files changed

+2
-10
lines changed

4 files changed

+2
-10
lines changed

java/ql/lib/ext/java.util.function.model.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,3 @@ extensions:
44
extensible: sinkModel
55
data:
66
- ["java.util.function", "Predicate", False, "test", "(Object)", "", "Argument[-1]", "regex-use[0]", "manual"]
7-
8-
- addsTo:
9-
pack: codeql/java-all
10-
extensible: summaryModel
11-
data:
12-
- ["java.util.function", "Supplier", False, "get", "()", "", "Argument[-1]", "ReturnValue", "value", "manual"]

java/ql/test/ext/TestModels/Test.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ public void test() throws Exception {
7777
AtomicReference ar = new AtomicReference(source());
7878
sink(ar.get()); // $hasValueFlow
7979

80-
// java.util.function
81-
Supplier<Double> sup = (Supplier)source();
82-
sink(sup.get()); // $hasValueFlow
83-
8480
// java.util
8581
StringJoiner sj1 = new StringJoiner(",");
8682
sink(sj1.add((CharSequence)source())); // $hasTaintFlow

java/ql/test/ext/TopJdkApis/TopJdkApis.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ class TopJdkApi extends SummarizedCallableBase {
147147
* `java.lang.Throwable#printStackTrace()`: should probably not be a general step, but there might be specialised queries that care
148148
* `java.util.function.Consumer#accept(Object)`: specialized lambda flow
149149
* `java.util.function.Function#apply(Object)`: specialized lambda flow
150+
* `java.util.function.Supplier#get()`: lambda flow
150151
* `java.util.stream.Collectors#joining(CharSequence)`: cannot be modeled completely without a model for `java.util.stream.Stream#collect(Collector)` as well
151152
* `java.util.stream.Collectors#toMap(Function,Function)`: specialized collectors flow
152153
* `java.util.stream.Stream#collect(Collector)`: handled separately on a case-by-case basis as it is too complex for MaD

java/ql/test/ext/TopJdkApis/TopJdkApisTest.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
| java.lang.Throwable#printStackTrace() | no manual model |
33
| java.util.function.Consumer#accept(Object) | no manual model |
44
| java.util.function.Function#apply(Object) | no manual model |
5+
| java.util.function.Supplier#get() | no manual model |
56
| java.util.stream.Collectors#joining(CharSequence) | no manual model |
67
| java.util.stream.Collectors#toMap(Function,Function) | no manual model |
78
| java.util.stream.Stream#collect(Collector) | no manual model |

0 commit comments

Comments
 (0)