mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Java: remove Function.apply model
This commit is contained in:
@@ -9,5 +9,4 @@ extensions:
|
||||
pack: codeql/java-all
|
||||
extensible: summaryModel
|
||||
data:
|
||||
- ["java.util.function", "Function", True, "apply", "(Object)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
|
||||
- ["java.util.function", "Supplier", False, "get", "()", "", "Argument[-1]", "ReturnValue", "value", "manual"]
|
||||
|
||||
@@ -78,12 +78,6 @@ public class Test {
|
||||
sink(ar.get()); // $hasValueFlow
|
||||
|
||||
// java.util.function
|
||||
Function<Object, Object> func = a -> a + "";
|
||||
sink(func.apply(source())); // $hasTaintFlow
|
||||
|
||||
Function<Integer, Double> half = a -> a / 2.0;
|
||||
sink(half.apply((Integer)source())); // $hasTaintFlow
|
||||
|
||||
Supplier<Double> sup = (Supplier)source();
|
||||
sink(sup.get()); // $hasValueFlow
|
||||
|
||||
|
||||
@@ -146,6 +146,7 @@ class TopJdkApi extends SummarizedCallableBase {
|
||||
* `java.lang.String#valueOf(Object)`: a complex case; an alias for `Object.toString`, except the dispatch is hidden
|
||||
* `java.lang.Throwable#printStackTrace()`: should probably not be a general step, but there might be specialised queries that care
|
||||
* `java.util.function.Consumer#accept(Object)`: specialized lambda flow
|
||||
* `java.util.function.Function#apply(Object)`: specialized lambda flow
|
||||
* `java.util.stream.Collectors#joining(CharSequence)`: cannot be modeled completely without a model for `java.util.stream.Stream#collect(Collector)` as well
|
||||
* `java.util.stream.Collectors#toMap(Function,Function)`: specialized collectors flow
|
||||
* `java.util.stream.Stream#collect(Collector)`: handled separately on a case-by-case basis as it is too complex for MaD
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
| java.lang.String#valueOf(Object) | no manual model |
|
||||
| java.lang.Throwable#printStackTrace() | no manual model |
|
||||
| java.util.function.Consumer#accept(Object) | no manual model |
|
||||
| java.util.function.Function#apply(Object) | no manual model |
|
||||
| java.util.stream.Collectors#joining(CharSequence) | no manual model |
|
||||
| java.util.stream.Collectors#toMap(Function,Function) | no manual model |
|
||||
| java.util.stream.Stream#collect(Collector) | no manual model |
|
||||
|
||||
Reference in New Issue
Block a user