Java: remove Function.apply model · itsallaboutpython/codeql@e044444 · GitHub
Skip to content

Commit e044444

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

4 files changed

Lines changed: 2 additions & 7 deletions

File tree

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

Lines changed: 0 additions & 1 deletion

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

0 commit comments

Comments
 (0)