Skip to content

Commit

Permalink
Model HashMap(Map)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sauyon Lee committed Jul 15, 2021
1 parent fb43a53 commit 3d9808b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ private class ContainerFlowSummaries extends SummaryModelCsv {
"java.util;Map;true;merge;(Object,Object,BiFunction);;Argument[1];MapValue of Argument[-1];value",
"java.util;Map;true;putAll;(Map);;MapKey of Argument[0];MapKey of Argument[-1];value",
"java.util;Map;true;putAll;(Map);;MapValue of Argument[0];MapValue of Argument[-1];value",
"java.util;HashMap;false;HashMap;;;MapKey of Argument[0];MapKey of Argument[-1];value",
"java.util;HashMap;false;HashMap;;;MapValue of Argument[0];MapValue of Argument[-1];value",
"java.util;Collection;true;parallelStream;();;Element of Argument[-1];Element of ReturnValue;value",
"java.util;Collection;true;stream;();;Element of Argument[-1];Element of ReturnValue;value",
"java.util;Collection;true;toArray;;;Element of Argument[-1];ArrayElement of ReturnValue;value",
Expand Down
10 changes: 10 additions & 0 deletions java/ql/test/library-tests/dataflow/collections/B.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ void foo() throws InterruptedException {
Map out = null;
Object in = storeMapValue(source()); out.putAll((Map)in); sink(readMapValue(out)); // $ hasValueFlow
}
{
// "java.util;HashMap;false;HashMap;;;MapKey of Argument[0];MapKey of Argument[-1];value",
HashMap out = null;
Map in = storeMapKey(source()); out = new HashMap(in); sink(readMapKey(out)); // $ hasValueFlow
}
{
// "java.util;HashMap;false;HashMap;;;MapValue of Argument[0];MapValue of Argument[-1];value",
HashMap out = null;
Map in = storeMapValue(source()); out = new HashMap(in); sink(readMapValue(out)); // $ hasValueFlow
}
{
// "java.util;Collection;true;parallelStream;();;Element of Argument[-1];Element of ReturnValue;value",
Stream out = null;
Expand Down

0 comments on commit 3d9808b

Please sign in to comment.