Skip to content

Commit 342c148

Browse files
committed
Fix existing models for MapUtils
1 parent e1101e5 commit 342c148

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

java/ql/lib/semmle/code/java/frameworks/apache/Collections.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ private class ApacheMapUtilsModel extends SummaryModelCsv {
792792
";MapUtils;true;orderedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value",
793793
";MapUtils;true;orderedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value",
794794
";MapUtils;true;populateMap;(Map,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value",
795-
";MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value",
795+
";MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];Element of MapValue of Argument[0];value",
796796
";MapUtils;true;predicatedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value",
797797
";MapUtils;true;predicatedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value",
798798
";MapUtils;true;predicatedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value",

java/ql/test/library-tests/frameworks/apache-collections/Test.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,11 +821,11 @@ public void test() {
821821
{
822822
// Note it is tricky to get this to compile - the compiler thinks it is ambiguous
823823
// which overload it should choose unless you put the generic types in correctly
824-
// "org.apache.commons.collections4;MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value"
824+
// "org.apache.commons.collections4;MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];Element of MapValue of Argument[0];value"
825825
MultiMap<Integer, String> out = null;
826826
Iterable<String> in = newVectorWithElement((String)source());
827827
MapUtils.populateMap(out, in, (Transformer<String, Integer>)null);
828-
sink(getMapValue(out)); // $ hasValueFlow
828+
sink(getElement((Collection)getMapValue(out))); // $ hasValueFlow
829829
}
830830
{
831831
// "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value"

0 commit comments

Comments
 (0)