Skip to content

Commit e044444

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: remove Function.apply model
1 parent fd593fd commit e044444

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ extensions:
99
pack: codeql/java-all
1010
extensible: summaryModel
1111
data:
12-
- ["java.util.function", "Function", True, "apply", "(Object)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
1312
- ["java.util.function", "Supplier", False, "get", "()", "", "Argument[-1]", "ReturnValue", "value", "manual"]

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ public void test() throws Exception {
7878
sink(ar.get()); // $hasValueFlow
7979

8080
// java.util.function
81-
Function<Object, Object> func = a -> a + "";
82-
sink(func.apply(source())); // $hasTaintFlow
83-
84-
Function<Integer, Double> half = a -> a / 2.0;
85-
sink(half.apply((Integer)source())); // $hasTaintFlow
86-
8781
Supplier<Double> sup = (Supplier)source();
8882
sink(sup.get()); // $hasValueFlow
8983

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ class TopJdkApi extends SummarizedCallableBase {
146146
* `java.lang.String#valueOf(Object)`: a complex case; an alias for `Object.toString`, except the dispatch is hidden
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
149+
* `java.util.function.Function#apply(Object)`: specialized lambda flow
149150
* `java.util.stream.Collectors#joining(CharSequence)`: cannot be modeled completely without a model for `java.util.stream.Stream#collect(Collector)` as well
150151
* `java.util.stream.Collectors#toMap(Function,Function)`: specialized collectors flow
151152
* `java.util.stream.Stream#collect(Collector)`: handled separately on a case-by-case basis as it is too complex for MaD
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
| java.lang.String#valueOf(Object) | no manual model |
22
| java.lang.Throwable#printStackTrace() | no manual model |
33
| java.util.function.Consumer#accept(Object) | no manual model |
4+
| java.util.function.Function#apply(Object) | no manual model |
45
| java.util.stream.Collectors#joining(CharSequence) | no manual model |
56
| java.util.stream.Collectors#toMap(Function,Function) | no manual model |
67
| java.util.stream.Stream#collect(Collector) | no manual model |

0 commit comments

Comments
 (0)