Skip to content

Commit 8fecc15

Browse files
committed
Add support for Map.forEach
Signed-off-by: Jonathan Leitschuh <[email protected]>
1 parent 23e60e2 commit 8fecc15

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ private class ContainerFlowSummaries extends SummaryModelCsv {
135135
"java.util;Map;true;merge;(Object,Object,BiFunction);;Argument[1];MapValue of Argument[-1];value",
136136
"java.util;Map;true;putAll;(Map);;MapKey of Argument[0];MapKey of Argument[-1];value",
137137
"java.util;Map;true;putAll;(Map);;MapValue of Argument[0];MapValue of Argument[-1];value",
138+
"java.util;Map;true;forEach;(BiConsumer);;MapKey of Argument[-1];Parameter[0] of Argument[0];value",
139+
"java.util;Map;true;forEach;(BiConsumer);;MapValue of Argument[-1];Parameter[1] of Argument[0];value",
138140
"java.util;Collection;true;parallelStream;();;Element of Argument[-1];Element of ReturnValue;value",
139141
"java.util;Collection;true;stream;();;Element of Argument[-1];Element of ReturnValue;value",
140142
"java.util;Collection;true;toArray;;;Element of Argument[-1];ArrayElement of ReturnValue;value",

java/ql/test/library-tests/frameworks/ratpack/resources/IntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void test4(Context ctx) {
7474
filterAndMerge(pojoForm, mergedParams, name -> false);
7575
return mergedParams;
7676
}).then(pojoMap -> {
77-
sink(pojoMap); //$hasTaintFlow
77+
sinlk(pojoMap); //$hasTaintFlow
7878
sink(pojoMap.get("value")); //$hasTaintFlow
7979
});
8080
}

0 commit comments

Comments
 (0)