Skip to content

Commit 99ee6c9

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: remove models for Consumer.accept and Collectors.toMap
1 parent ac064ac commit 99ee6c9

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-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
@@ -11,9 +11,3 @@ extensions:
1111
data:
1212
- ["java.util.function", "Function", True, "apply", "(Object)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
1313
- ["java.util.function", "Supplier", False, "get", "()", "", "Argument[-1]", "ReturnValue", "value", "manual"]
14-
15-
- addsTo:
16-
pack: codeql/java-all
17-
extensible: neutralModel
18-
data:
19-
- ["java.util.function", "Consumer", "accept", "(Object)", "manual"]

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,4 @@ extensions:
9393
extensible: neutralModel
9494
data:
9595
- ["java.util.stream", "Collectors", "toList", "()", "manual"]
96-
- ["java.util.stream", "Collectors", "toMap", "(Function,Function)", "manual"]
9796
- ["java.util.stream", "Collectors", "toSet", "()", "manual"]

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,12 @@ class TopJdkApi extends SummarizedCallableBase {
143143
predicate hasManualMadModel() { this.hasManualSummary() or this.hasManualNeutral() }
144144
/*
145145
* Note: the following top-100 APIs are not modeled with MaD:
146-
* `java.util.stream.Stream#collect(Collector)`: handled separately on a case-by-case basis as it is too complex for MaD
147-
* `java.util.stream.Collectors#joining(CharSequence)`: cannot be modeled completely without a model for `java.util.stream.Stream#collect(Collector)` as well
148-
* `java.lang.String#valueOf(Object)`: also a complex case; an alias for `Object.toString`, except the dispatch is hidden
146+
* `java.lang.String#valueOf(Object)`: a complex case; an alias for `Object.toString`, except the dispatch is hidden
149147
* `java.lang.Throwable#printStackTrace()`: should probably not be a general step, but there might be specialised queries that care
148+
* `java.util.function.Consumer#accept(Object)`: specialized lambda flow
149+
* `java.util.stream.Collectors#joining(CharSequence)`: cannot be modeled completely without a model for `java.util.stream.Stream#collect(Collector)` as well
150+
* `java.util.stream.Collectors#toMap(Function,Function)`: specialized collectors flow
151+
* `java.util.stream.Stream#collect(Collector)`: handled separately on a case-by-case basis as it is too complex for MaD
150152
*/
151153

152154
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
| java.lang.String#valueOf(Object) | no manual model |
22
| java.lang.Throwable#printStackTrace() | no manual model |
3+
| java.util.function.Consumer#accept(Object) | no manual model |
34
| java.util.stream.Collectors#joining(CharSequence) | no manual model |
5+
| java.util.stream.Collectors#toMap(Function,Function) | no manual model |
46
| java.util.stream.Stream#collect(Collector) | no manual model |

0 commit comments

Comments
 (0)