From 492f6ebc7c248cfa514d56acf1613e05523c844c Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 16 Jun 2021 12:13:55 +0100 Subject: [PATCH 01/15] Model isNotEmpty from Apache Commons Collections --- .../semmle/code/java/dataflow/NullGuards.qll | 7 ++----- .../java/frameworks/apache/Collections.qll | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 java/ql/src/semmle/code/java/frameworks/apache/Collections.qll diff --git a/java/ql/src/semmle/code/java/dataflow/NullGuards.qll b/java/ql/src/semmle/code/java/dataflow/NullGuards.qll index 589b1f7c49f5..69c2ba6c22e8 100644 --- a/java/ql/src/semmle/code/java/dataflow/NullGuards.qll +++ b/java/ql/src/semmle/code/java/dataflow/NullGuards.qll @@ -5,6 +5,7 @@ import java import SSA private import semmle.code.java.controlflow.internal.GuardsLogic +private import semmle.code.java.frameworks.apache.Collections private import RangeUtils private import IntegerGuards @@ -144,11 +145,7 @@ predicate nullCheckMethod(Method m, boolean branch, boolean isnull) { branch = false and isnull = false or - ( - m.getDeclaringType().hasQualifiedName("org.apache.commons.collections4", "CollectionUtils") or - m.getDeclaringType().hasQualifiedName("org.apache.commons.collections", "CollectionUtils") - ) and - m.hasName("isNotEmpty") and + m instanceof MethodApacheCollectionsIsNotEmpty and branch = true and isnull = false or diff --git a/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll new file mode 100644 index 000000000000..3d6d211f447d --- /dev/null +++ b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll @@ -0,0 +1,18 @@ +/** Definitions related to the Apache Commons Collections library. */ + +import java +private import semmle.code.java.dataflow.FlowSteps +private import semmle.code.java.dataflow.ExternalFlow + +/** + * The method `isNotEmpty` in either `org.apache.commons.collections.CollectionUtils` + * or `org.apache.commons.collections4.CollectionUtils`. + */ +class MethodApacheCollectionsIsNotEmpty extends Method { + MethodApacheCollectionsIsNotEmpty() { + this.getDeclaringType() + .hasQualifiedName(["org.apache.commons.collections", "org.apache.commons.collections4"], + "CollectionUtils") and + this.hasName("isNotEmpty") + } +} From 213f5d6a3705e7185be8cb5223c28a46c70732f5 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 16 Jun 2021 12:31:51 +0100 Subject: [PATCH 02/15] Model and use isEmpty from Apache Collections --- .../ql/src/semmle/code/java/dataflow/NullGuards.qll | 4 ++++ .../code/java/frameworks/apache/Collections.qll | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/java/ql/src/semmle/code/java/dataflow/NullGuards.qll b/java/ql/src/semmle/code/java/dataflow/NullGuards.qll index 69c2ba6c22e8..44f19ce72e4e 100644 --- a/java/ql/src/semmle/code/java/dataflow/NullGuards.qll +++ b/java/ql/src/semmle/code/java/dataflow/NullGuards.qll @@ -145,6 +145,10 @@ predicate nullCheckMethod(Method m, boolean branch, boolean isnull) { branch = false and isnull = false or + m instanceof MethodApacheCollectionsIsEmpty and + branch = false and + isnull = false + or m instanceof MethodApacheCollectionsIsNotEmpty and branch = true and isnull = false diff --git a/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll index 3d6d211f447d..40024ce17959 100644 --- a/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll +++ b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll @@ -4,6 +4,19 @@ import java private import semmle.code.java.dataflow.FlowSteps private import semmle.code.java.dataflow.ExternalFlow +/** + * The method `isNotEmpty` in either `org.apache.commons.collections.CollectionUtils` + * or `org.apache.commons.collections4.CollectionUtils`. + */ +class MethodApacheCollectionsIsEmpty extends Method { + MethodApacheCollectionsIsEmpty() { + this.getDeclaringType() + .hasQualifiedName(["org.apache.commons.collections", "org.apache.commons.collections4"], + "CollectionUtils") and + this.hasName("isEmpty") + } +} + /** * The method `isNotEmpty` in either `org.apache.commons.collections.CollectionUtils` * or `org.apache.commons.collections4.CollectionUtils`. From e78d56e7e90ae9bb9f23fc4ba4d9e024d7e8fe90 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 16 Jun 2021 14:19:18 +0100 Subject: [PATCH 03/15] Model MapUtils class and keyvalue package --- .../java/frameworks/apache/Collections.qll | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll index 40024ce17959..6dedf56f3803 100644 --- a/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll +++ b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll @@ -29,3 +29,110 @@ class MethodApacheCollectionsIsNotEmpty extends Method { this.hasName("isNotEmpty") } } + +/** + * Value-propagating models for classes in the package `org.apache.commons.collections4`. + */ +private class ApacheCollectionsModel extends SummaryModelCsv { + override predicate row(string row) { + row = + [ + "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value", + "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" + ] + } +} + +/** + * Value-propagating models for classes in the package `org.apache.commons.collections4.keyvalue`. + */ +private class ApacheKeyValueModel extends SummaryModelCsv { + override predicate row(string row) { + row = + [ + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapKey of Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapValue of Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;Argument[0];Argument[-1];value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapKey of Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapValue of Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;Argument[0];Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;Argument[0];Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;Argument[0];Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;Argument[0];Argument[-1];value", + "org.apache.commons.collections4.keyvalue;TiedMapEntry;true;TiedMapEntry;;;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;TiedMapEntry;true;TiedMapEntry;;;Argument[1];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;Argument[0];Argument[-1];value", + "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;Argument[0];Argument[-1];value" + ] + } +} + +/** + * Value-propagating models for the class `org.apache.commons.collections4.MapUtils`. + */ +private class ApacheMapUtilsModel extends SummaryModelCsv { + override predicate row(string row) { + row = + [ + "org.apache.commons.collections4;MapUtils;true;emptyIfNull;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;getMap;;;MapValue of Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;getMap;;;Argument[2];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;getObject;;;MapValue of Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;getObject;;;Argument[2];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;getString;;;MapValue of Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;getString;;;Argument[2];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapKey of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapValue of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;iterableMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;lazyMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;orderedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;populateMap;(Map,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value", + "org.apache.commons.collections4;MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value", + // Note that when lambdas are supported we should have more models for populateMap + "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of Argument[0];value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapValue of Argument[0];value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapKey of Argument[0];value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapValue of Argument[0];value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of Argument[0];value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of Argument[0];value", + "org.apache.commons.collections4;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;safeAddToMap;;;Argument[1];MapKey of Argument[0];value", + "org.apache.commons.collections4;MapUtils;true;safeAddToMap;;;Argument[2];MapValue of Argument[0];value", + "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;toMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;transformedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;Argument[0];ReturnValue;value" + ] + } +} From 224fd343f364614534b8c38befc5b182f79b575c Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 22 Jun 2021 21:45:31 +0100 Subject: [PATCH 04/15] Fix models (addressing PR review comments) --- .../java/frameworks/apache/Collections.qll | 90 ++++++++++++------- 1 file changed, 59 insertions(+), 31 deletions(-) diff --git a/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll index 6dedf56f3803..5aaa7a2501d2 100644 --- a/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll +++ b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll @@ -38,7 +38,9 @@ private class ApacheCollectionsModel extends SummaryModelCsv { row = [ "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value", - "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" + "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value", + "org.apache.commons.collections;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value", + "org.apache.commons.collections;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" ] } } @@ -56,29 +58,38 @@ private class ApacheKeyValueModel extends SummaryModelCsv { "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;Argument[0];MapKey of Argument[-1];value", "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value", "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value", - "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapKey of Argument[-1];ReturnValue;value", - "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapValue of Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapKey of Argument[-1];ReturnValue;taint", + "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapValue of Argument[-1];ReturnValue;taint", "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[0];MapKey of Argument[-1];value", "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[1];MapValue of Argument[-1];value", - "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;Argument[0];Argument[-1];value", - "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;Argument[-1];ReturnValue;value", - "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapKey of Argument[-1];ReturnValue;value", - "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapValue of Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapKey of Argument[-1];ReturnValue;taint", + "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapValue of Argument[-1];ReturnValue;taint", "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[0];MapKey of Argument[-1];value", "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[1];MapValue of Argument[-1];value", - "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;Argument[0];Argument[-1];value", - "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;Argument[0];Argument[-1];value", - "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;Argument[-1];ReturnValue;value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value", + "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value", "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value", "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value", - "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;Argument[0];Argument[-1];value", - "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;Argument[0];Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value", "org.apache.commons.collections4.keyvalue;TiedMapEntry;true;TiedMapEntry;;;MapValue of Argument[0];MapValue of Argument[-1];value", "org.apache.commons.collections4.keyvalue;TiedMapEntry;true;TiedMapEntry;;;Argument[1];MapKey of Argument[-1];value", "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value", "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value", - "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;Argument[0];Argument[-1];value", - "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;Argument[0];Argument[-1];value" + "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value", ] } } @@ -91,8 +102,10 @@ private class ApacheMapUtilsModel extends SummaryModelCsv { row = [ "org.apache.commons.collections4;MapUtils;true;emptyIfNull;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;getMap;;;MapValue of Argument[0];ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;getMap;;;Argument[2];ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;getObject;;;MapValue of Argument[0];ReturnValue;value", @@ -101,17 +114,25 @@ private class ApacheMapUtilsModel extends SummaryModelCsv { "org.apache.commons.collections4;MapUtils;true;getString;;;Argument[2];ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapKey of Argument[0];MapValue of ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapValue of Argument[0];MapKey of ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;iterableMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;lazyMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;orderedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;iterableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;iterableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;orderedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;orderedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;populateMap;(Map,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value", "org.apache.commons.collections4;MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value", // Note that when lambdas are supported we should have more models for populateMap - "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of Argument[0];value", "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapValue of Argument[0];value", @@ -126,13 +147,20 @@ private class ApacheMapUtilsModel extends SummaryModelCsv { "org.apache.commons.collections4;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;safeAddToMap;;;Argument[1];MapKey of Argument[0];value", "org.apache.commons.collections4;MapUtils;true;safeAddToMap;;;Argument[2];MapValue of Argument[0];value", - "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;toMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;transformedMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;Argument[0];ReturnValue;value", - "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;Argument[0];ReturnValue;value" + "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;toMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;toMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;transformedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;transformedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", ] } } From 4388f19ddffd5f057d8894940b00885a7950e3e6 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 22 Jun 2021 21:28:21 +0100 Subject: [PATCH 05/15] Add automatically-generated tests --- .../frameworks/apache-collections/Test.java | 929 ++++++++++++++++++ .../apache-collections/test.expected | 0 .../frameworks/apache-collections/test.ql | 68 ++ 3 files changed, 997 insertions(+) create mode 100644 java/ql/test/library-tests/frameworks/apache-collections/Test.java create mode 100644 java/ql/test/library-tests/frameworks/apache-collections/test.expected create mode 100644 java/ql/test/library-tests/frameworks/apache-collections/test.ql diff --git a/java/ql/test/library-tests/frameworks/apache-collections/Test.java b/java/ql/test/library-tests/frameworks/apache-collections/Test.java new file mode 100644 index 000000000000..9d1104d990a6 --- /dev/null +++ b/java/ql/test/library-tests/frameworks/apache-collections/Test.java @@ -0,0 +1,929 @@ +package generatedtest; + +import java.util.Map; +import java.util.ResourceBundle; +import java.util.SortedMap; +import org.apache.commons.collections4.Factory; +import org.apache.commons.collections4.IterableMap; +import org.apache.commons.collections4.IterableSortedMap; +import org.apache.commons.collections4.KeyValue; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.collections4.MultiMap; +import org.apache.commons.collections4.OrderedMap; +import org.apache.commons.collections4.Transformer; +import org.apache.commons.collections4.keyvalue.AbstractKeyValue; +import org.apache.commons.collections4.keyvalue.AbstractMapEntry; +import org.apache.commons.collections4.keyvalue.AbstractMapEntryDecorator; +import org.apache.commons.collections4.keyvalue.DefaultKeyValue; +import org.apache.commons.collections4.keyvalue.DefaultMapEntry; +import org.apache.commons.collections4.keyvalue.TiedMapEntry; +import org.apache.commons.collections4.keyvalue.UnmodifiableMapEntry; +import org.apache.commons.collections4.map.MultiValueMap; + +//Test case generated by GenerateFlowTestCase.ql +public class Test { + + Object getMapKey(Object container) { return null; } + Object getMapValue(Object container) { return null; } + Object newWithArrayElement(Object element) { return null; } + Object newWithElement(Object element) { return null; } + Object newWithMapKey(Object element) { return null; } + Object newWithMapValue(Object element) { return null; } + Object source() { return null; } + void sink(Object o) { } + + public void test() { + + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[0];MapKey of Argument[-1];value" + AbstractKeyValue out = null; + Object in = (Object)source(); + out = new AbstractKeyValue(in, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[1];MapValue of Argument[-1];value" + AbstractKeyValue out = null; + Object in = (Object)source(); + out = new AbstractKeyValue(null, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;Argument[0];MapKey of Argument[-1];value" + DefaultKeyValue out = null; + Object in = (Object)source(); + out.setKey(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;Argument[0];MapKey of Argument[-1];value" + AbstractKeyValue out = null; + Object in = (Object)source(); + out.setKey(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + DefaultKeyValue in = (DefaultKeyValue)newWithMapValue(source()); + out = in.setKey(null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); + out = in.setKey(null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); + out = in.setKey((Object)null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value" + UnmodifiableMapEntry out = null; + Object in = (Object)source(); + out.setValue(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value" + DefaultKeyValue out = null; + Object in = (Object)source(); + out.setValue(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value" + AbstractMapEntry out = null; + Object in = (Object)source(); + out.setValue(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value" + AbstractKeyValue out = null; + Object in = (Object)source(); + out.setValue(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + UnmodifiableMapEntry in = (UnmodifiableMapEntry)newWithMapValue(source()); + out = in.setValue(null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + DefaultKeyValue in = (DefaultKeyValue)newWithMapValue(source()); + out = in.setValue(null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + AbstractMapEntry in = (AbstractMapEntry)newWithMapValue(source()); + out = in.setValue(null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + AbstractMapEntry in = (AbstractMapEntry)newWithMapValue(source()); + out = in.setValue((Object)null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); + out = in.setValue(null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); + out = in.setValue((Object)null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapKey of Argument[-1];ReturnValue;taint" + String out = null; + AbstractKeyValue in = (AbstractKeyValue)newWithMapKey(source()); + out = in.toString(); + sink(out); // $hasTaintFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapValue of Argument[-1];ReturnValue;taint" + String out = null; + AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); + out = in.toString(); + sink(out); // $hasTaintFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[0];MapKey of Argument[-1];value" + AbstractMapEntry out = null; + Object in = (Object)source(); + out = new AbstractMapEntry(in, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[1];MapValue of Argument[-1];value" + AbstractMapEntry out = null; + Object in = (Object)source(); + out = new AbstractMapEntry(null, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapKey of Argument[0];MapKey of Argument[-1];value" + AbstractMapEntryDecorator out = null; + Map<>.Entry in = (Map<>.Entry)newWithMapKey(source()); + out = new AbstractMapEntryDecorator(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapValue of Argument[0];MapValue of Argument[-1];value" + AbstractMapEntryDecorator out = null; + Map<>.Entry in = (Map<>.Entry)newWithMapValue(source()); + out = new AbstractMapEntryDecorator(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value" + Map<>.Entry out = null; + AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapKey(source()); + out = in.getMapEntry(); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value" + Map<>.Entry out = null; + AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapValue(source()); + out = in.getMapEntry(); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapKey of Argument[-1];ReturnValue;taint" + String out = null; + AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapKey(source()); + out = in.toString(); + sink(out); // $hasTaintFlow + } + { + // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapValue of Argument[-1];ReturnValue;taint" + String out = null; + AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapValue(source()); + out = in.toString(); + sink(out); // $hasTaintFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" + DefaultKeyValue out = null; + Map<>.Entry in = (Map<>.Entry)newWithMapKey(source()); + out = new DefaultKeyValue(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" + DefaultKeyValue out = null; + Map<>.Entry in = (Map<>.Entry)newWithMapValue(source()); + out = new DefaultKeyValue(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value" + DefaultKeyValue out = null; + KeyValue in = (KeyValue)newWithMapKey(source()); + out = new DefaultKeyValue(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value" + DefaultKeyValue out = null; + KeyValue in = (KeyValue)newWithMapValue(source()); + out = new DefaultKeyValue(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[0];MapKey of Argument[-1];value" + DefaultKeyValue out = null; + Object in = (Object)source(); + out = new DefaultKeyValue(in, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[1];MapValue of Argument[-1];value" + DefaultKeyValue out = null; + Object in = (Object)source(); + out = new DefaultKeyValue(null, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value" + Map<>.Entry out = null; + DefaultKeyValue in = (DefaultKeyValue)newWithMapKey(source()); + out = in.toMapEntry(); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value" + Map<>.Entry out = null; + DefaultKeyValue in = (DefaultKeyValue)newWithMapValue(source()); + out = in.toMapEntry(); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" + DefaultMapEntry out = null; + Map<>.Entry in = (Map<>.Entry)newWithMapKey(source()); + out = new DefaultMapEntry(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" + DefaultMapEntry out = null; + Map<>.Entry in = (Map<>.Entry)newWithMapValue(source()); + out = new DefaultMapEntry(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value" + DefaultMapEntry out = null; + KeyValue in = (KeyValue)newWithMapKey(source()); + out = new DefaultMapEntry(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value" + DefaultMapEntry out = null; + KeyValue in = (KeyValue)newWithMapValue(source()); + out = new DefaultMapEntry(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value" + DefaultMapEntry out = null; + Object in = (Object)source(); + out = new DefaultMapEntry(in, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value" + DefaultMapEntry out = null; + Object in = (Object)source(); + out = new DefaultMapEntry(null, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;TiedMapEntry;true;TiedMapEntry;;;Argument[1];MapKey of Argument[-1];value" + TiedMapEntry out = null; + Object in = (Object)source(); + out = new TiedMapEntry(null, in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;TiedMapEntry;true;TiedMapEntry;;;MapValue of Argument[0];MapValue of Argument[-1];value" + TiedMapEntry out = null; + Map in = (Map)newWithMapValue(source()); + out = new TiedMapEntry(in, null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" + UnmodifiableMapEntry out = null; + Map<>.Entry in = (Map<>.Entry)newWithMapKey(source()); + out = new UnmodifiableMapEntry(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" + UnmodifiableMapEntry out = null; + Map<>.Entry in = (Map<>.Entry)newWithMapValue(source()); + out = new UnmodifiableMapEntry(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value" + UnmodifiableMapEntry out = null; + KeyValue in = (KeyValue)newWithMapKey(source()); + out = new UnmodifiableMapEntry(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value" + UnmodifiableMapEntry out = null; + KeyValue in = (KeyValue)newWithMapValue(source()); + out = new UnmodifiableMapEntry(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value" + UnmodifiableMapEntry out = null; + Object in = (Object)source(); + out = new UnmodifiableMapEntry(in, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value" + UnmodifiableMapEntry out = null; + Object in = (Object)source(); + out = new UnmodifiableMapEntry(null, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" + Object out = null; + TiedMapEntry in = (TiedMapEntry)newWithMapKey(source()); + out = in.getKey(); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" + Object out = null; + KeyValue in = (KeyValue)newWithMapKey(source()); + out = in.getKey(); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" + Object out = null; + AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapKey(source()); + out = in.getKey(); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" + Object out = null; + AbstractKeyValue in = (AbstractKeyValue)newWithMapKey(source()); + out = in.getKey(); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + TiedMapEntry in = (TiedMapEntry)newWithMapValue(source()); + out = in.getValue(); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + KeyValue in = (KeyValue)newWithMapValue(source()); + out = in.getValue(); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapValue(source()); + out = in.getValue(); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" + Object out = null; + AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); + out = in.getValue(); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;emptyIfNull;;;Argument[0];ReturnValue;value" + Map out = null; + Map in = (Map)source(); + out = MapUtils.emptyIfNull(in); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.fixedSizeMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.fixedSizeMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapKey(source()); + out = MapUtils.fixedSizeSortedMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapValue(source()); + out = MapUtils.fixedSizeSortedMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;getMap;;;Argument[2];ReturnValue;value" + Map out = null; + Map in = (Map)source(); + out = MapUtils.getMap(null, null, in); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;getMap;;;MapValue of Argument[0];ReturnValue;value" + Map out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.getMap(in, null, null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;getMap;;;MapValue of Argument[0];ReturnValue;value" + Map out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.getMap(in, null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;getObject;;;Argument[2];ReturnValue;value" + Object out = null; + Object in = (Object)source(); + out = MapUtils.getObject(null, null, in); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;getObject;;;MapValue of Argument[0];ReturnValue;value" + Object out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.getObject(in, null, null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;getObject;;;MapValue of Argument[0];ReturnValue;value" + Object out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.getObject(in, null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;getString;;;Argument[2];ReturnValue;value" + String out = null; + String in = (String)source(); + out = MapUtils.getString(null, null, in); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;getString;;;MapValue of Argument[0];ReturnValue;value" + String out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.getString(in, null, null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;getString;;;MapValue of Argument[0];ReturnValue;value" + String out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.getString(in, null); + sink(out); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapKey of Argument[0];MapValue of ReturnValue;value" + Map out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.invertMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapValue of Argument[0];MapKey of ReturnValue;value" + Map out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.invertMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;iterableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.iterableMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;iterableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.iterableMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + IterableSortedMap out = null; + SortedMap in = (SortedMap)newWithMapKey(source()); + out = MapUtils.iterableSortedMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + IterableSortedMap out = null; + SortedMap in = (SortedMap)newWithMapValue(source()); + out = MapUtils.iterableSortedMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.lazyMap(in, (Transformer)null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.lazyMap(in, (Factory)null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.lazyMap(in, (Transformer)null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.lazyMap(in, (Factory)null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapKey(source()); + out = MapUtils.lazySortedMap(in, (Transformer)null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapKey(source()); + out = MapUtils.lazySortedMap(in, (Factory)null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapValue(source()); + out = MapUtils.lazySortedMap(in, (Transformer)null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapValue(source()); + out = MapUtils.lazySortedMap(in, (Factory)null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + MultiValueMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.multiValueMap(in, (Factory)null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + MultiValueMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.multiValueMap(in, (Class)null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + MultiValueMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.multiValueMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + MultiValueMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.multiValueMap(in, (Factory)null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + MultiValueMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.multiValueMap(in, (Class)null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + MultiValueMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.multiValueMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;orderedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + OrderedMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.orderedMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;orderedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + OrderedMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.orderedMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;populateMap;(Map,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value" + Map out = null; + Iterable in = (Iterable)newWithElement(source()); + MapUtils.populateMap(out, in, (Transformer)null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value" + MultiMap out = null; + Iterable in = (Iterable)newWithElement(source()); + MapUtils.populateMap(out, in, (Transformer)null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.predicatedMap(in, null, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.predicatedMap(in, null, null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapKey(source()); + out = MapUtils.predicatedSortedMap(in, null, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapValue(source()); + out = MapUtils.predicatedSortedMap(in, null, null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of Argument[0];value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(source()); + MapUtils.putAll(out, in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of ReturnValue;value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(source()); + out = MapUtils.putAll(null, in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapValue of Argument[0];value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(source()); + MapUtils.putAll(out, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapValue of ReturnValue;value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(source()); + out = MapUtils.putAll(null, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapKey of Argument[0];value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(newWithArrayElement(source())); + MapUtils.putAll(out, in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapKey of ReturnValue;value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(newWithArrayElement(source())); + out = MapUtils.putAll(null, in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapValue of Argument[0];value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(newWithArrayElement(source())); + MapUtils.putAll(out, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapValue of ReturnValue;value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(newWithArrayElement(source())); + out = MapUtils.putAll(null, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of Argument[0];value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(newWithMapKey(source())); + MapUtils.putAll(out, in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of ReturnValue;value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(newWithMapKey(source())); + out = MapUtils.putAll(null, in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of Argument[0];value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(newWithMapValue(source())); + MapUtils.putAll(out, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of ReturnValue;value" + Map out = null; + Object[] in = (Object[])newWithArrayElement(newWithMapValue(source())); + out = MapUtils.putAll(null, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;safeAddToMap;;;Argument[1];MapKey of Argument[0];value" + Map out = null; + Object in = (Object)source(); + MapUtils.safeAddToMap(out, in, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;safeAddToMap;;;Argument[2];MapValue of Argument[0];value" + Map out = null; + Object in = (Object)source(); + MapUtils.safeAddToMap(out, null, in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + Map out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.synchronizedMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + Map out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.synchronizedMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapKey(source()); + out = MapUtils.synchronizedSortedMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapValue(source()); + out = MapUtils.synchronizedSortedMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;toMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + Map out = null; + ResourceBundle in = (ResourceBundle)newWithMapKey(source()); + out = MapUtils.toMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;toMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + Map out = null; + ResourceBundle in = (ResourceBundle)newWithMapValue(source()); + out = MapUtils.toMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;transformedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.transformedMap(in, null, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;transformedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + IterableMap out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.transformedMap(in, null, null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapKey(source()); + out = MapUtils.transformedSortedMap(in, null, null); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapValue(source()); + out = MapUtils.transformedSortedMap(in, null, null); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + Map out = null; + Map in = (Map)newWithMapKey(source()); + out = MapUtils.unmodifiableMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + Map out = null; + Map in = (Map)newWithMapValue(source()); + out = MapUtils.unmodifiableMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapKey(source()); + out = MapUtils.unmodifiableSortedMap(in); + sink(getMapKey(out)); // $hasValueFlow + } + { + // "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" + SortedMap out = null; + SortedMap in = (SortedMap)newWithMapValue(source()); + out = MapUtils.unmodifiableSortedMap(in); + sink(getMapValue(out)); // $hasValueFlow + } + + } + +} \ No newline at end of file diff --git a/java/ql/test/library-tests/frameworks/apache-collections/test.expected b/java/ql/test/library-tests/frameworks/apache-collections/test.expected new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/java/ql/test/library-tests/frameworks/apache-collections/test.ql b/java/ql/test/library-tests/frameworks/apache-collections/test.ql new file mode 100644 index 000000000000..4ec971af08b8 --- /dev/null +++ b/java/ql/test/library-tests/frameworks/apache-collections/test.ql @@ -0,0 +1,68 @@ +import java +import semmle.code.java.dataflow.DataFlow +import semmle.code.java.dataflow.ExternalFlow +import semmle.code.java.dataflow.TaintTracking +import TestUtilities.InlineExpectationsTest + +class SummaryModelTest extends SummaryModelCsv { + override predicate row(string row) { + row = + [ + //"package;type;overrides;name;signature;ext;inputspec;outputspec;kind", + "generatedtest;Test;false;getMapValue;;;MapValue of Argument[0];ReturnValue;value", + "generatedtest;Test;false;getMapKey;;;MapKey of Argument[0];ReturnValue;value", + "generatedtest;Test;false;newWithMapValue;;;Argument[0];MapValue of ReturnValue;value", + "generatedtest;Test;false;newWithElement;;;Argument[0];Element of ReturnValue;value", + "generatedtest;Test;false;newWithArrayElement;;;Argument[0];ArrayElement of ReturnValue;value", + "generatedtest;Test;false;newWithMapKey;;;Argument[0];MapKey of ReturnValue;value" + ] + } +} + +class ValueFlowConf extends DataFlow::Configuration { + ValueFlowConf() { this = "qltest:valueFlowConf" } + + override predicate isSource(DataFlow::Node n) { + n.asExpr().(MethodAccess).getMethod().hasName("source") + } + + override predicate isSink(DataFlow::Node n) { + n.asExpr().(Argument).getCall().getCallee().hasName("sink") + } +} + +class TaintFlowConf extends TaintTracking::Configuration { + TaintFlowConf() { this = "qltest:taintFlowConf" } + + override predicate isSource(DataFlow::Node n) { + n.asExpr().(MethodAccess).getMethod().hasName("source") + } + + override predicate isSink(DataFlow::Node n) { + n.asExpr().(Argument).getCall().getCallee().hasName("sink") + } +} + +class HasFlowTest extends InlineExpectationsTest { + HasFlowTest() { this = "HasFlowTest" } + + override string getARelevantTag() { result = ["hasValueFlow", "hasTaintFlow"] } + + override predicate hasActualResult(Location location, string element, string tag, string value) { + tag = "hasValueFlow" and + exists(DataFlow::Node src, DataFlow::Node sink, ValueFlowConf conf | conf.hasFlow(src, sink) | + sink.getLocation() = location and + element = sink.toString() and + value = "" + ) + or + tag = "hasTaintFlow" and + exists(DataFlow::Node src, DataFlow::Node sink, TaintFlowConf conf | + conf.hasFlow(src, sink) and not any(ValueFlowConf c).hasFlow(src, sink) + | + sink.getLocation() = location and + element = sink.toString() and + value = "" + ) + } +} From 7004c87ec0fb32108fef8d2306c7fefa203f5d27 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 24 Jun 2021 11:36:52 +0100 Subject: [PATCH 06/15] Manually edit tests so they pass --- .../frameworks/apache-collections/Test.java | 130 +++++++++++------- 1 file changed, 83 insertions(+), 47 deletions(-) diff --git a/java/ql/test/library-tests/frameworks/apache-collections/Test.java b/java/ql/test/library-tests/frameworks/apache-collections/Test.java index 9d1104d990a6..7448c32caeae 100644 --- a/java/ql/test/library-tests/frameworks/apache-collections/Test.java +++ b/java/ql/test/library-tests/frameworks/apache-collections/Test.java @@ -32,20 +32,54 @@ public class Test { Object source() { return null; } void sink(Object o) { } + class MyAbstractKeyValue extends AbstractKeyValue { + MyAbstractKeyValue(K key, V value) { + super(key, value); + } + + K mySetKey(final K key) { + return super.setKey(key); + } + + V mySetValue(final V value) { + return super.setValue(value); + } + } + + class MyAbstractMapEntry extends AbstractMapEntry { + MyAbstractMapEntry(final K key, final V value) { + super(key, value); + } + @Override + public K getKey() { return null; } + @Override + public V getValue() { return null; } + } + + class MyAbstractMapEntryDecorator extends AbstractMapEntryDecorator { + MyAbstractMapEntryDecorator(final Map.Entry entry) { + super(entry); + } + + Map.Entry myGetMapEntry() { + return super.getMapEntry(); + } + } + public void test() { { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[0];MapKey of Argument[-1];value" AbstractKeyValue out = null; Object in = (Object)source(); - out = new AbstractKeyValue(in, null); + out = new MyAbstractKeyValue(in, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[1];MapValue of Argument[-1];value" AbstractKeyValue out = null; Object in = (Object)source(); - out = new AbstractKeyValue(null, in); + out = new MyAbstractKeyValue(null, in); sink(getMapValue(out)); // $hasValueFlow } { @@ -57,9 +91,9 @@ public void test() { } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;Argument[0];MapKey of Argument[-1];value" - AbstractKeyValue out = null; + MyAbstractKeyValue out = null; Object in = (Object)source(); - out.setKey(in); + out.mySetKey(in); sink(getMapKey(out)); // $hasValueFlow } { @@ -72,15 +106,15 @@ public void test() { { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); - out = in.setKey(null); + MyAbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + out = in.mySetKey(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); - out = in.setKey((Object)null); + MyAbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + out = in.mySetKey((Object)null); sink(out); // $hasValueFlow } { @@ -106,9 +140,9 @@ public void test() { } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value" - AbstractKeyValue out = null; + MyAbstractKeyValue out = null; Object in = (Object)source(); - out.setValue(in); + out.mySetValue(in); sink(getMapValue(out)); // $hasValueFlow } { @@ -128,42 +162,42 @@ public void test() { { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntry in = (AbstractMapEntry)newWithMapValue(source()); + AbstractMapEntry in = (MyAbstractMapEntry)newWithMapValue(source()); out = in.setValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntry in = (AbstractMapEntry)newWithMapValue(source()); + AbstractMapEntry in = (MyAbstractMapEntry)newWithMapValue(source()); out = in.setValue((Object)null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); - out = in.setValue(null); + MyAbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + out = in.mySetValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); - out = in.setValue((Object)null); + MyAbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + out = in.mySetValue((Object)null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapKey of Argument[-1];ReturnValue;taint" String out = null; - AbstractKeyValue in = (AbstractKeyValue)newWithMapKey(source()); + AbstractKeyValue in = (MyAbstractKeyValue)newWithMapKey(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapValue of Argument[-1];ReturnValue;taint" String out = null; - AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); + AbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); out = in.toString(); sink(out); // $hasTaintFlow } @@ -171,69 +205,69 @@ public void test() { // "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[0];MapKey of Argument[-1];value" AbstractMapEntry out = null; Object in = (Object)source(); - out = new AbstractMapEntry(in, null); + out = new MyAbstractMapEntry(in, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[1];MapValue of Argument[-1];value" AbstractMapEntry out = null; Object in = (Object)source(); - out = new AbstractMapEntry(null, in); + out = new MyAbstractMapEntry(null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapKey of Argument[0];MapKey of Argument[-1];value" AbstractMapEntryDecorator out = null; - Map<>.Entry in = (Map<>.Entry)newWithMapKey(source()); - out = new AbstractMapEntryDecorator(in); + Map.Entry in = (Map.Entry)newWithMapKey(source()); + out = new MyAbstractMapEntryDecorator(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapValue of Argument[0];MapValue of Argument[-1];value" AbstractMapEntryDecorator out = null; - Map<>.Entry in = (Map<>.Entry)newWithMapValue(source()); - out = new AbstractMapEntryDecorator(in); + Map.Entry in = (Map.Entry)newWithMapValue(source()); + out = new MyAbstractMapEntryDecorator(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value" - Map<>.Entry out = null; - AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapKey(source()); - out = in.getMapEntry(); + Map.Entry out = null; + MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapKey(source()); + out = in.myGetMapEntry(); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value" - Map<>.Entry out = null; - AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapValue(source()); - out = in.getMapEntry(); + Map.Entry out = null; + MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapValue(source()); + out = in.myGetMapEntry(); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapKey of Argument[-1];ReturnValue;taint" String out = null; - AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapKey(source()); + AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapKey(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapValue of Argument[-1];ReturnValue;taint" String out = null; - AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapValue(source()); + AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapValue(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultKeyValue out = null; - Map<>.Entry in = (Map<>.Entry)newWithMapKey(source()); + Map.Entry in = (Map.Entry)newWithMapKey(source()); out = new DefaultKeyValue(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultKeyValue out = null; - Map<>.Entry in = (Map<>.Entry)newWithMapValue(source()); + Map.Entry in = (Map.Entry)newWithMapValue(source()); out = new DefaultKeyValue(in); sink(getMapValue(out)); // $hasValueFlow } @@ -267,14 +301,14 @@ public void test() { } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value" - Map<>.Entry out = null; + Map.Entry out = null; DefaultKeyValue in = (DefaultKeyValue)newWithMapKey(source()); out = in.toMapEntry(); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value" - Map<>.Entry out = null; + Map.Entry out = null; DefaultKeyValue in = (DefaultKeyValue)newWithMapValue(source()); out = in.toMapEntry(); sink(getMapValue(out)); // $hasValueFlow @@ -282,14 +316,14 @@ public void test() { { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultMapEntry out = null; - Map<>.Entry in = (Map<>.Entry)newWithMapKey(source()); + Map.Entry in = (Map.Entry)newWithMapKey(source()); out = new DefaultMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultMapEntry out = null; - Map<>.Entry in = (Map<>.Entry)newWithMapValue(source()); + Map.Entry in = (Map.Entry)newWithMapValue(source()); out = new DefaultMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } @@ -338,14 +372,14 @@ public void test() { { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" UnmodifiableMapEntry out = null; - Map<>.Entry in = (Map<>.Entry)newWithMapKey(source()); + Map.Entry in = (Map.Entry)newWithMapKey(source()); out = new UnmodifiableMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" UnmodifiableMapEntry out = null; - Map<>.Entry in = (Map<>.Entry)newWithMapValue(source()); + Map.Entry in = (Map.Entry)newWithMapValue(source()); out = new UnmodifiableMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } @@ -394,14 +428,14 @@ public void test() { { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapKey(source()); + AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (AbstractKeyValue)newWithMapKey(source()); + AbstractKeyValue in = (MyAbstractKeyValue)newWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } @@ -422,14 +456,14 @@ public void test() { { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntryDecorator in = (AbstractMapEntryDecorator)newWithMapValue(source()); + AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (AbstractKeyValue)newWithMapValue(source()); + AbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } @@ -693,10 +727,12 @@ public void test() { sink(getMapValue(out)); // $hasValueFlow } { + // Note it is tricky to get this to compile - the compiler thinks it is ambiguous + // which overload it should choose unless you put the generic types in correctly // "org.apache.commons.collections4;MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value" - MultiMap out = null; - Iterable in = (Iterable)newWithElement(source()); - MapUtils.populateMap(out, in, (Transformer)null); + MultiMap out = null; + Iterable in = (Iterable)newWithElement(source()); + MapUtils.populateMap(out, in, (Transformer)null); sink(getMapValue(out)); // $hasValueFlow } { From 5feee9cc1744bd45be2731dbb04fd5b98eded3ed Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 22 Jun 2021 16:46:05 +0100 Subject: [PATCH 07/15] Add automatically-generated stubs --- .../apache/commons/collections4/Factory.java | 9 ++ .../org/apache/commons/collections4/Get.java | 20 ++++ .../commons/collections4/IterableGet.java | 11 +++ .../commons/collections4/IterableMap.java | 11 +++ .../collections4/IterableSortedMap.java | 10 ++ .../apache/commons/collections4/KeyValue.java | 10 ++ .../commons/collections4/MapIterator.java | 15 +++ .../apache/commons/collections4/MapUtils.java | 94 +++++++++++++++++++ .../apache/commons/collections4/MultiMap.java | 17 ++++ .../commons/collections4/OrderedIterator.java | 11 +++ .../commons/collections4/OrderedMap.java | 15 +++ .../collections4/OrderedMapIterator.java | 12 +++ .../commons/collections4/Predicate.java | 9 ++ .../org/apache/commons/collections4/Put.java | 12 +++ .../commons/collections4/Transformer.java | 9 ++ .../commons/collections4/Unmodifiable.java | 8 ++ .../keyvalue/AbstractKeyValue.java | 16 ++++ .../keyvalue/AbstractMapEntry.java | 15 +++ .../keyvalue/AbstractMapEntryDecorator.java | 19 ++++ .../keyvalue/DefaultKeyValue.java | 20 ++++ .../keyvalue/DefaultMapEntry.java | 15 +++ .../collections4/keyvalue/TiedMapEntry.java | 19 ++++ .../keyvalue/UnmodifiableMapEntry.java | 17 ++++ .../collections4/map/AbstractIterableMap.java | 12 +++ .../map/AbstractMapDecorator.java | 31 ++++++ .../collections4/map/MultiValueMap.java | 36 +++++++ 26 files changed, 473 insertions(+) create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Factory.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Get.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableGet.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableMap.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableSortedMap.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/KeyValue.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapIterator.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapUtils.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MultiMap.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedIterator.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedMap.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedMapIterator.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Predicate.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Put.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Transformer.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Unmodifiable.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/TiedMapEntry.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/AbstractIterableMap.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/AbstractMapDecorator.java create mode 100644 java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/MultiValueMap.java diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Factory.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Factory.java new file mode 100644 index 000000000000..0b0f3fd48641 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Factory.java @@ -0,0 +1,9 @@ +// Generated automatically from org.apache.commons.collections4.Factory for testing purposes + +package org.apache.commons.collections4; + + +public interface Factory +{ + T create(); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Get.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Get.java new file mode 100644 index 000000000000..ad0b9919a079 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Get.java @@ -0,0 +1,20 @@ +// Generated automatically from org.apache.commons.collections4.Get for testing purposes + +package org.apache.commons.collections4; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; + +public interface Get +{ + Collection values(); + Set keySet(); + Set> entrySet(); + V get(Object p0); + V remove(Object p0); + boolean containsKey(Object p0); + boolean containsValue(Object p0); + boolean isEmpty(); + int size(); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableGet.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableGet.java new file mode 100644 index 000000000000..291d62914d89 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableGet.java @@ -0,0 +1,11 @@ +// Generated automatically from org.apache.commons.collections4.IterableGet for testing purposes + +package org.apache.commons.collections4; + +import org.apache.commons.collections4.Get; +import org.apache.commons.collections4.MapIterator; + +public interface IterableGet extends Get +{ + MapIterator mapIterator(); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableMap.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableMap.java new file mode 100644 index 000000000000..8f716f103d2e --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableMap.java @@ -0,0 +1,11 @@ +// Generated automatically from org.apache.commons.collections4.IterableMap for testing purposes + +package org.apache.commons.collections4; + +import java.util.Map; +import org.apache.commons.collections4.IterableGet; +import org.apache.commons.collections4.Put; + +public interface IterableMap extends IterableGet, Map, Put +{ +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableSortedMap.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableSortedMap.java new file mode 100644 index 000000000000..b88eae5beee8 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/IterableSortedMap.java @@ -0,0 +1,10 @@ +// Generated automatically from org.apache.commons.collections4.IterableSortedMap for testing purposes + +package org.apache.commons.collections4; + +import java.util.SortedMap; +import org.apache.commons.collections4.OrderedMap; + +public interface IterableSortedMap extends OrderedMap, SortedMap +{ +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/KeyValue.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/KeyValue.java new file mode 100644 index 000000000000..49bd0442d332 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/KeyValue.java @@ -0,0 +1,10 @@ +// Generated automatically from org.apache.commons.collections4.KeyValue for testing purposes + +package org.apache.commons.collections4; + + +public interface KeyValue +{ + K getKey(); + V getValue(); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapIterator.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapIterator.java new file mode 100644 index 000000000000..f31dfa5c6cf9 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapIterator.java @@ -0,0 +1,15 @@ +// Generated automatically from org.apache.commons.collections4.MapIterator for testing purposes + +package org.apache.commons.collections4; + +import java.util.Iterator; + +public interface MapIterator extends Iterator +{ + K getKey(); + K next(); + V getValue(); + V setValue(V p0); + boolean hasNext(); + void remove(); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapUtils.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapUtils.java new file mode 100644 index 000000000000..a50e416eb0b9 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapUtils.java @@ -0,0 +1,94 @@ +// Generated automatically from org.apache.commons.collections4.MapUtils for testing purposes + +package org.apache.commons.collections4; + +import java.io.PrintStream; +import java.util.Map; +import java.util.Properties; +import java.util.ResourceBundle; +import java.util.SortedMap; +import org.apache.commons.collections4.Factory; +import org.apache.commons.collections4.IterableMap; +import org.apache.commons.collections4.IterableSortedMap; +import org.apache.commons.collections4.MultiMap; +import org.apache.commons.collections4.OrderedMap; +import org.apache.commons.collections4.Predicate; +import org.apache.commons.collections4.Transformer; +import org.apache.commons.collections4.map.MultiValueMap; + +public class MapUtils +{ + protected MapUtils() {} + public static MultiValueMap multiValueMap(Map p0, Class p1){ return null; } + public static MultiValueMap multiValueMap(Map p0, Factory p1){ return null; } + public static void populateMap(Map p0, Iterable p1, Transformer p2, Transformer p3){} + public static void populateMap(MultiMap p0, Iterable p1, Transformer p2, Transformer p3){} + public static IterableMap fixedSizeMap(Map p0){ return null; } + public static IterableMap iterableMap(Map p0){ return null; } + public static IterableMap lazyMap(Map p0, Factory p1){ return null; } + public static IterableMap lazyMap(Map p0, Transformer p1){ return null; } + public static IterableMap predicatedMap(Map p0, Predicate p1, Predicate p2){ return null; } + public static IterableMap transformedMap(Map p0, Transformer p1, Transformer p2){ return null; } + public static IterableSortedMap iterableSortedMap(SortedMap p0){ return null; } + public static Map emptyIfNull(Map p0){ return null; } + public static Map putAll(Map p0, Object[] p1){ return null; } + public static Map synchronizedMap(Map p0){ return null; } + public static Map unmodifiableMap(Map p0){ return null; } + public static Map invertMap(Map p0){ return null; } + public static MultiValueMap multiValueMap(Map> p0){ return null; } + public static OrderedMap orderedMap(Map p0){ return null; } + public static Properties toProperties(Map p0){ return null; } + public static SortedMap fixedSizeSortedMap(SortedMap p0){ return null; } + public static SortedMap lazySortedMap(SortedMap p0, Factory p1){ return null; } + public static SortedMap lazySortedMap(SortedMap p0, Transformer p1){ return null; } + public static SortedMap predicatedSortedMap(SortedMap p0, Predicate p1, Predicate p2){ return null; } + public static SortedMap synchronizedSortedMap(SortedMap p0){ return null; } + public static SortedMap transformedSortedMap(SortedMap p0, Transformer p1, Transformer p2){ return null; } + public static SortedMap unmodifiableSortedMap(SortedMap p0){ return null; } + public static V getObject(Map p0, K p1){ return null; } + public static V getObject(Map p0, K p1, V p2){ return null; } + public static void populateMap(Map p0, Iterable p1, Transformer p2){} + public static void populateMap(MultiMap p0, Iterable p1, Transformer p2){} + public static Boolean getBoolean(Map p0, K p1){ return null; } + public static Boolean getBoolean(Map p0, K p1, Boolean p2){ return null; } + public static Byte getByte(Map p0, K p1){ return null; } + public static Byte getByte(Map p0, K p1, Byte p2){ return null; } + public static Double getDouble(Map p0, K p1){ return null; } + public static Double getDouble(Map p0, K p1, Double p2){ return null; } + public static Float getFloat(Map p0, K p1){ return null; } + public static Float getFloat(Map p0, K p1, Float p2){ return null; } + public static Integer getInteger(Map p0, K p1){ return null; } + public static Integer getInteger(Map p0, K p1, Integer p2){ return null; } + public static Long getLong(Map p0, K p1){ return null; } + public static Long getLong(Map p0, K p1, Long p2){ return null; } + public static Map getMap(Map p0, K p1){ return null; } + public static Map getMap(Map p0, K p1, Map p2){ return null; } + public static Number getNumber(Map p0, K p1){ return null; } + public static Number getNumber(Map p0, K p1, Number p2){ return null; } + public static Short getShort(Map p0, K p1){ return null; } + public static Short getShort(Map p0, K p1, Short p2){ return null; } + public static String getString(Map p0, K p1){ return null; } + public static String getString(Map p0, K p1, String p2){ return null; } + public static boolean getBooleanValue(Map p0, K p1){ return false; } + public static boolean getBooleanValue(Map p0, K p1, boolean p2){ return false; } + public static byte getByteValue(Map p0, K p1){ return 0; } + public static byte getByteValue(Map p0, K p1, byte p2){ return 0; } + public static double getDoubleValue(Map p0, K p1){ return 0; } + public static double getDoubleValue(Map p0, K p1, double p2){ return 0; } + public static float getFloatValue(Map p0, K p1){ return 0; } + public static float getFloatValue(Map p0, K p1, float p2){ return 0; } + public static int getIntValue(Map p0, K p1){ return 0; } + public static int getIntValue(Map p0, K p1, int p2){ return 0; } + public static long getLongValue(Map p0, K p1){ return 0; } + public static long getLongValue(Map p0, K p1, long p2){ return 0; } + public static short getShortValue(Map p0, K p1){ return 0; } + public static short getShortValue(Map p0, K p1, short p2){ return 0; } + public static void safeAddToMap(Map p0, K p1, Object p2){} + public static Map toMap(ResourceBundle p0){ return null; } + public static SortedMap EMPTY_SORTED_MAP = null; + public static boolean isEmpty(Map p0){ return false; } + public static boolean isNotEmpty(Map p0){ return false; } + public static int size(Map p0){ return 0; } + public static void debugPrint(PrintStream p0, Object p1, Map p2){} + public static void verbosePrint(PrintStream p0, Object p1, Map p2){} +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MultiMap.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MultiMap.java new file mode 100644 index 000000000000..13218c868e64 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MultiMap.java @@ -0,0 +1,17 @@ +// Generated automatically from org.apache.commons.collections4.MultiMap for testing purposes + +package org.apache.commons.collections4; + +import java.util.Collection; +import org.apache.commons.collections4.IterableMap; + +public interface MultiMap extends IterableMap +{ + Collection values(); + Object get(Object p0); + Object put(K p0, Object p1); + Object remove(Object p0); + boolean containsValue(Object p0); + boolean removeMapping(K p0, V p1); + int size(); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedIterator.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedIterator.java new file mode 100644 index 000000000000..2faaa7766316 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedIterator.java @@ -0,0 +1,11 @@ +// Generated automatically from org.apache.commons.collections4.OrderedIterator for testing purposes + +package org.apache.commons.collections4; + +import java.util.Iterator; + +public interface OrderedIterator extends Iterator +{ + E previous(); + boolean hasPrevious(); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedMap.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedMap.java new file mode 100644 index 000000000000..9ff7863414c3 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedMap.java @@ -0,0 +1,15 @@ +// Generated automatically from org.apache.commons.collections4.OrderedMap for testing purposes + +package org.apache.commons.collections4; + +import org.apache.commons.collections4.IterableMap; +import org.apache.commons.collections4.OrderedMapIterator; + +public interface OrderedMap extends IterableMap +{ + K firstKey(); + K lastKey(); + K nextKey(K p0); + K previousKey(K p0); + OrderedMapIterator mapIterator(); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedMapIterator.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedMapIterator.java new file mode 100644 index 000000000000..bdfb882198d7 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/OrderedMapIterator.java @@ -0,0 +1,12 @@ +// Generated automatically from org.apache.commons.collections4.OrderedMapIterator for testing purposes + +package org.apache.commons.collections4; + +import org.apache.commons.collections4.MapIterator; +import org.apache.commons.collections4.OrderedIterator; + +public interface OrderedMapIterator extends MapIterator, OrderedIterator +{ + K previous(); + boolean hasPrevious(); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Predicate.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Predicate.java new file mode 100644 index 000000000000..df3f5e6ee59f --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Predicate.java @@ -0,0 +1,9 @@ +// Generated automatically from org.apache.commons.collections4.Predicate for testing purposes + +package org.apache.commons.collections4; + + +public interface Predicate +{ + boolean evaluate(T p0); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Put.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Put.java new file mode 100644 index 000000000000..611f9d8689c2 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Put.java @@ -0,0 +1,12 @@ +// Generated automatically from org.apache.commons.collections4.Put for testing purposes + +package org.apache.commons.collections4; + +import java.util.Map; + +public interface Put +{ + Object put(K p0, V p1); + void clear(); + void putAll(Map p0); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Transformer.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Transformer.java new file mode 100644 index 000000000000..95ab79517125 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Transformer.java @@ -0,0 +1,9 @@ +// Generated automatically from org.apache.commons.collections4.Transformer for testing purposes + +package org.apache.commons.collections4; + + +public interface Transformer +{ + O transform(I p0); +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Unmodifiable.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Unmodifiable.java new file mode 100644 index 000000000000..34a162fb253a --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/Unmodifiable.java @@ -0,0 +1,8 @@ +// Generated automatically from org.apache.commons.collections4.Unmodifiable for testing purposes + +package org.apache.commons.collections4; + + +public interface Unmodifiable +{ +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java new file mode 100644 index 000000000000..5c6e256f9a2f --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractKeyValue.java @@ -0,0 +1,16 @@ +// Generated automatically from org.apache.commons.collections4.keyvalue.AbstractKeyValue for testing purposes + +package org.apache.commons.collections4.keyvalue; + +import org.apache.commons.collections4.KeyValue; + +abstract public class AbstractKeyValue implements KeyValue +{ + protected AbstractKeyValue() {} + protected AbstractKeyValue(K p0, V p1){} + protected K setKey(K p0){ return null; } + protected V setValue(V p0){ return null; } + public K getKey(){ return null; } + public String toString(){ return null; } + public V getValue(){ return null; } +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java new file mode 100644 index 000000000000..6b15e1b71b48 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java @@ -0,0 +1,15 @@ +// Generated automatically from org.apache.commons.collections4.keyvalue.AbstractMapEntry for testing purposes + +package org.apache.commons.collections4.keyvalue; + +import java.util.Map; +import org.apache.commons.collections4.keyvalue.AbstractKeyValue; + +abstract public class AbstractMapEntry extends Map.Entry implements Map.Entry +{ + protected AbstractMapEntry() {} + protected AbstractMapEntry(K p0, V p1){} + public V setValue(V p0){ return null; } + public boolean equals(Object p0){ return false; } + public int hashCode(){ return 0; } +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java new file mode 100644 index 000000000000..b19c12a1ff1a --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntryDecorator.java @@ -0,0 +1,19 @@ +// Generated automatically from org.apache.commons.collections4.keyvalue.AbstractMapEntryDecorator for testing purposes + +package org.apache.commons.collections4.keyvalue; + +import java.util.Map; +import org.apache.commons.collections4.KeyValue; + +abstract public class AbstractMapEntryDecorator implements KeyValue, Map.Entry +{ + protected AbstractMapEntryDecorator() {} + protected Map.Entry getMapEntry(){ return null; } + public AbstractMapEntryDecorator(Map.Entry p0){} + public K getKey(){ return null; } + public String toString(){ return null; } + public V getValue(){ return null; } + public V setValue(V p0){ return null; } + public boolean equals(Object p0){ return false; } + public int hashCode(){ return 0; } +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java new file mode 100644 index 000000000000..dcce7c4b18a9 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java @@ -0,0 +1,20 @@ +// Generated automatically from org.apache.commons.collections4.keyvalue.DefaultKeyValue for testing purposes + +package org.apache.commons.collections4.keyvalue; + +import java.util.Map; +import org.apache.commons.collections4.KeyValue; +import org.apache.commons.collections4.keyvalue.AbstractKeyValue; + +public class DefaultKeyValue extends AbstractKeyValue +{ + public DefaultKeyValue(){} + public DefaultKeyValue(K p0, V p1){} + public DefaultKeyValue(KeyValue p0){} + public DefaultKeyValue(Map.Entry p0){} + public K setKey(K p0){ return null; } + public Map.Entry toMapEntry(){ return null; } + public V setValue(V p0){ return null; } + public boolean equals(Object p0){ return false; } + public int hashCode(){ return 0; } +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java new file mode 100644 index 000000000000..e05f7698a9a8 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java @@ -0,0 +1,15 @@ +// Generated automatically from org.apache.commons.collections4.keyvalue.DefaultMapEntry for testing purposes + +package org.apache.commons.collections4.keyvalue; + +import java.util.Map; +import org.apache.commons.collections4.KeyValue; +import org.apache.commons.collections4.keyvalue.AbstractMapEntry; + +public class DefaultMapEntry extends AbstractMapEntry +{ + protected DefaultMapEntry() {} + public DefaultMapEntry(K p0, V p1){} + public DefaultMapEntry(KeyValue p0){} + public DefaultMapEntry(Map.Entry p0){} +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/TiedMapEntry.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/TiedMapEntry.java new file mode 100644 index 000000000000..f05c978821bb --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/TiedMapEntry.java @@ -0,0 +1,19 @@ +// Generated automatically from org.apache.commons.collections4.keyvalue.TiedMapEntry for testing purposes + +package org.apache.commons.collections4.keyvalue; + +import java.io.Serializable; +import java.util.Map; +import org.apache.commons.collections4.KeyValue; + +public class TiedMapEntry implements KeyValue, Map.Entry, Serializable +{ + protected TiedMapEntry() {} + public K getKey(){ return null; } + public String toString(){ return null; } + public TiedMapEntry(Map p0, K p1){} + public V getValue(){ return null; } + public V setValue(V p0){ return null; } + public boolean equals(Object p0){ return false; } + public int hashCode(){ return 0; } +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java new file mode 100644 index 000000000000..20bd8a0880d1 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java @@ -0,0 +1,17 @@ +// Generated automatically from org.apache.commons.collections4.keyvalue.UnmodifiableMapEntry for testing purposes + +package org.apache.commons.collections4.keyvalue; + +import java.util.Map; +import org.apache.commons.collections4.KeyValue; +import org.apache.commons.collections4.Unmodifiable; +import org.apache.commons.collections4.keyvalue.AbstractMapEntry; + +public class UnmodifiableMapEntry extends AbstractMapEntry implements Unmodifiable +{ + protected UnmodifiableMapEntry() {} + public UnmodifiableMapEntry(K p0, V p1){} + public UnmodifiableMapEntry(KeyValue p0){} + public UnmodifiableMapEntry(Map.Entry p0){} + public V setValue(V p0){ return null; } +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/AbstractIterableMap.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/AbstractIterableMap.java new file mode 100644 index 000000000000..f23ac6babe28 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/AbstractIterableMap.java @@ -0,0 +1,12 @@ +// Generated automatically from org.apache.commons.collections4.map.AbstractIterableMap for testing purposes + +package org.apache.commons.collections4.map; + +import org.apache.commons.collections4.IterableMap; +import org.apache.commons.collections4.MapIterator; + +abstract public class AbstractIterableMap implements IterableMap +{ + public AbstractIterableMap(){} + public MapIterator mapIterator(){ return null; } +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/AbstractMapDecorator.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/AbstractMapDecorator.java new file mode 100644 index 000000000000..11f4964456c4 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/AbstractMapDecorator.java @@ -0,0 +1,31 @@ +// Generated automatically from org.apache.commons.collections4.map.AbstractMapDecorator for testing purposes + +package org.apache.commons.collections4.map; + +import java.util.Collection; +import java.util.Map; +import java.util.Set; +import org.apache.commons.collections4.map.AbstractIterableMap; + +abstract public class AbstractMapDecorator extends AbstractIterableMap +{ + Map map = null; + protected AbstractMapDecorator(){} + protected AbstractMapDecorator(Map p0){} + protected Map decorated(){ return null; } + public Collection values(){ return null; } + public Set keySet(){ return null; } + public Set> entrySet(){ return null; } + public String toString(){ return null; } + public V get(Object p0){ return null; } + public V put(K p0, V p1){ return null; } + public V remove(Object p0){ return null; } + public boolean containsKey(Object p0){ return false; } + public boolean containsValue(Object p0){ return false; } + public boolean equals(Object p0){ return false; } + public boolean isEmpty(){ return false; } + public int hashCode(){ return 0; } + public int size(){ return 0; } + public void clear(){} + public void putAll(Map p0){} +} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/MultiValueMap.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/MultiValueMap.java new file mode 100644 index 000000000000..8bceaafe1225 --- /dev/null +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/MultiValueMap.java @@ -0,0 +1,36 @@ +// Generated automatically from org.apache.commons.collections4.map.MultiValueMap for testing purposes + +package org.apache.commons.collections4.map; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; +import org.apache.commons.collections4.Factory; +import org.apache.commons.collections4.MultiMap; +import org.apache.commons.collections4.map.AbstractMapDecorator; + +public class MultiValueMap extends MultiMap implements MultiMap, Serializable +{ + protected Collection createCollection(int p0){ return null; } + protected MultiValueMap(Map p0, Factory p1){} + public Collection values(){ return null; } + public Collection getCollection(Object p0){ return null; } + public Iterator> iterator(){ return null; } + public Iterator iterator(Object p0){ return null; } + public MultiValueMap(){} + public Object put(K p0, Object p1){ return null; } + public Set> entrySet(){ return null; } + public boolean containsValue(Object p0){ return false; } + public boolean containsValue(Object p0, Object p1){ return false; } + public boolean putAll(K p0, Collection p1){ return false; } + public boolean removeMapping(Object p0, Object p1){ return false; } + public int size(Object p0){ return 0; } + public int totalSize(){ return 0; } + public static MultiValueMap multiValueMap(Map p0, Class p1){ return null; } + public static MultiValueMap multiValueMap(Map p0, Factory p1){ return null; } + public static MultiValueMap multiValueMap(Map> p0){ return null; } + public void clear(){} + public void putAll(Map p0){} +} From acc43fcacab233de338b153b44bdad636bfe6fcc Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 22 Jun 2021 21:03:36 +0100 Subject: [PATCH 08/15] Add options file --- java/ql/test/library-tests/frameworks/apache-collections/options | 1 + 1 file changed, 1 insertion(+) create mode 100644 java/ql/test/library-tests/frameworks/apache-collections/options diff --git a/java/ql/test/library-tests/frameworks/apache-collections/options b/java/ql/test/library-tests/frameworks/apache-collections/options new file mode 100644 index 000000000000..7b0b8433220e --- /dev/null +++ b/java/ql/test/library-tests/frameworks/apache-collections/options @@ -0,0 +1 @@ +//semmle-extractor-options: --javac-args -cp ${testdir}/../../../stubs/apache-commons-collections4-4.4 \ No newline at end of file From 2e670c4050c366439ac44b494f5bdbb2692c1103 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 22 Jun 2021 21:02:39 +0100 Subject: [PATCH 09/15] Manually update automatically generated stubs --- .../org/apache/commons/collections4/MapUtils.java | 1 + .../commons/collections4/keyvalue/AbstractMapEntry.java | 2 +- .../commons/collections4/keyvalue/DefaultMapEntry.java | 2 ++ .../collections4/keyvalue/UnmodifiableMapEntry.java | 2 ++ .../apache/commons/collections4/map/MultiValueMap.java | 8 ++++++-- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapUtils.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapUtils.java index a50e416eb0b9..1ec008c0caa6 100644 --- a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapUtils.java +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/MapUtils.java @@ -3,6 +3,7 @@ package org.apache.commons.collections4; import java.io.PrintStream; +import java.util.Collection; import java.util.Map; import java.util.Properties; import java.util.ResourceBundle; diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java index 6b15e1b71b48..1f5daf144819 100644 --- a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/AbstractMapEntry.java @@ -5,7 +5,7 @@ import java.util.Map; import org.apache.commons.collections4.keyvalue.AbstractKeyValue; -abstract public class AbstractMapEntry extends Map.Entry implements Map.Entry +abstract public class AbstractMapEntry extends AbstractKeyValue implements Map.Entry { protected AbstractMapEntry() {} protected AbstractMapEntry(K p0, V p1){} diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java index e05f7698a9a8..5fd732d592f4 100644 --- a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java @@ -12,4 +12,6 @@ protected DefaultMapEntry() {} public DefaultMapEntry(K p0, V p1){} public DefaultMapEntry(KeyValue p0){} public DefaultMapEntry(Map.Entry p0){} + public V getValue(){ return null; } + public K getKey(){ return null; } } diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java index 20bd8a0880d1..2db2edab16f4 100644 --- a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java @@ -14,4 +14,6 @@ public UnmodifiableMapEntry(K p0, V p1){} public UnmodifiableMapEntry(KeyValue p0){} public UnmodifiableMapEntry(Map.Entry p0){} public V setValue(V p0){ return null; } + public V getValue(){ return null; } + public K getKey(){ return null; } } diff --git a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/MultiValueMap.java b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/MultiValueMap.java index 8bceaafe1225..b09b192b9426 100644 --- a/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/MultiValueMap.java +++ b/java/ql/test/stubs/apache-commons-collections4-4.4/org/apache/commons/collections4/map/MultiValueMap.java @@ -11,10 +11,10 @@ import org.apache.commons.collections4.MultiMap; import org.apache.commons.collections4.map.AbstractMapDecorator; -public class MultiValueMap extends MultiMap implements MultiMap, Serializable +public class MultiValueMap extends AbstractMapDecorator implements MultiMap, Serializable { protected Collection createCollection(int p0){ return null; } - protected MultiValueMap(Map p0, Factory p1){} + protected MultiValueMap(Map p0, Factory p1){} public Collection values(){ return null; } public Collection getCollection(Object p0){ return null; } public Iterator> iterator(){ return null; } @@ -33,4 +33,8 @@ public MultiValueMap(){} public static MultiValueMap multiValueMap(Map> p0){ return null; } public void clear(){} public void putAll(Map p0){} + public int size(){ return 0; } + public Object remove(Object key){ return null; } + public Object get(Object key){ return null; } + public boolean isEmpty(){ return false; } } From eb469c081115172ff5d37f9c63f117ff04de9a28 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 24 Jun 2021 11:13:10 +0100 Subject: [PATCH 10/15] Duplicate models for old package name The package name was org.apache.commons.collection until release 4.0. --- .../java/frameworks/apache/Collections.qll | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll index 5aaa7a2501d2..ba71731aae7b 100644 --- a/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll +++ b/java/ql/src/semmle/code/java/frameworks/apache/Collections.qll @@ -90,6 +90,44 @@ private class ApacheKeyValueModel extends SummaryModelCsv { "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value", "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value", "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value", + "org.apache.commons.collections.keyvalue;AbstractKeyValue;true;setKey;;;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value", + "org.apache.commons.collections.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;AbstractKeyValue;true;toString;;;MapKey of Argument[-1];ReturnValue;taint", + "org.apache.commons.collections.keyvalue;AbstractKeyValue;true;toString;;;MapValue of Argument[-1];ReturnValue;taint", + "org.apache.commons.collections.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value", + "org.apache.commons.collections.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value", + "org.apache.commons.collections.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapKey of Argument[-1];ReturnValue;taint", + "org.apache.commons.collections.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapValue of Argument[-1];ReturnValue;taint", + "org.apache.commons.collections.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value", + "org.apache.commons.collections.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value", + "org.apache.commons.collections.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;TiedMapEntry;true;TiedMapEntry;;;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;TiedMapEntry;true;TiedMapEntry;;;Argument[1];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value", + "org.apache.commons.collections.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value", + "org.apache.commons.collections.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" ] } } @@ -161,6 +199,66 @@ private class ApacheMapUtilsModel extends SummaryModelCsv { "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;emptyIfNull;;;Argument[0];ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;fixedSizeMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;fixedSizeMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;fixedSizeSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;fixedSizeSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;getMap;;;MapValue of Argument[0];ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;getMap;;;Argument[2];ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;getObject;;;MapValue of Argument[0];ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;getObject;;;Argument[2];ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;getString;;;MapValue of Argument[0];ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;getString;;;Argument[2];ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;invertMap;;;MapKey of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;invertMap;;;MapValue of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;iterableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;iterableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;iterableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;iterableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;lazyMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;lazyMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;lazySortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;lazySortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;orderedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;orderedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;populateMap;(Map,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value", + "org.apache.commons.collections;MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value", + // Note that when lambdas are supported we should have more models for populateMap + "org.apache.commons.collections;MapUtils;true;predicatedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;predicatedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;predicatedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;predicatedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of Argument[0];value", + "org.apache.commons.collections;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapValue of Argument[0];value", + "org.apache.commons.collections;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapKey of Argument[0];value", + "org.apache.commons.collections;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapValue of Argument[0];value", + "org.apache.commons.collections;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of Argument[0];value", + "org.apache.commons.collections;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of Argument[0];value", + "org.apache.commons.collections;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;safeAddToMap;;;Argument[1];MapKey of Argument[0];value", + "org.apache.commons.collections;MapUtils;true;safeAddToMap;;;Argument[2];MapValue of Argument[0];value", + "org.apache.commons.collections;MapUtils;true;synchronizedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;synchronizedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;synchronizedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;synchronizedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;toMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;toMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;transformedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;transformedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;transformedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;transformedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;unmodifiableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;unmodifiableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;unmodifiableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", + "org.apache.commons.collections;MapUtils;true;unmodifiableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" ] } } From 1bb33bca33213302fe216187a14757be405e32f9 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Wed, 23 Jun 2021 10:26:54 +0100 Subject: [PATCH 11/15] Add Apache Commons Collections to coverage reports --- java/documentation/library-coverage/frameworks.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/documentation/library-coverage/frameworks.csv b/java/documentation/library-coverage/frameworks.csv index 751883eaf4b5..de139173fc01 100644 --- a/java/documentation/library-coverage/frameworks.csv +++ b/java/documentation/library-coverage/frameworks.csv @@ -2,9 +2,10 @@ Framework name,URL,Package prefixes Java Standard Library,,java.* Java extensions,,javax.* Google Guava,https://guava.dev/,com.google.common.* +Apache Commons Collections,https://commons.apache.org/proper/commons-collections/,org.apache.commons.collections org.apache.commons.collections4 Apache Commons IO,https://commons.apache.org/proper/commons-io/,org.apache.commons.io Apache Commons Lang,https://commons.apache.org/proper/commons-lang/,org.apache.commons.lang3 Apache Commons Text,https://commons.apache.org/proper/commons-text/,org.apache.commons.text Apache HttpComponents,https://hc.apache.org/,org.apache.hc.core5.* org.apache.http Android,,android.* -Spring,https://spring.io/,org.springframework.* \ No newline at end of file +Spring,https://spring.io/,org.springframework.* From 2fd4c9f1b9c3d17ade72e3a9a5dc97e438d72f08 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Thu, 24 Jun 2021 16:57:16 +0100 Subject: [PATCH 12/15] Manually improve tests --- .../frameworks/apache-collections/Test.java | 237 ++++++++++-------- .../frameworks/apache-collections/test.ql | 12 +- 2 files changed, 137 insertions(+), 112 deletions(-) diff --git a/java/ql/test/library-tests/frameworks/apache-collections/Test.java b/java/ql/test/library-tests/frameworks/apache-collections/Test.java index 7448c32caeae..d7c070fe9a3a 100644 --- a/java/ql/test/library-tests/frameworks/apache-collections/Test.java +++ b/java/ql/test/library-tests/frameworks/apache-collections/Test.java @@ -3,6 +3,8 @@ import java.util.Map; import java.util.ResourceBundle; import java.util.SortedMap; +import java.util.TreeMap; +import java.util.Vector; import org.apache.commons.collections4.Factory; import org.apache.commons.collections4.IterableMap; import org.apache.commons.collections4.IterableSortedMap; @@ -23,12 +25,35 @@ //Test case generated by GenerateFlowTestCase.ql public class Test { - Object getMapKey(Object container) { return null; } - Object getMapValue(Object container) { return null; } - Object newWithArrayElement(Object element) { return null; } - Object newWithElement(Object element) { return null; } - Object newWithMapKey(Object element) { return null; } - Object newWithMapValue(Object element) { return null; } + static Object getMapKey(AbstractKeyValue container) { return container.getKey(); } + static Object getMapKeyFromEntry(Map.Entry container) { return container.getKey(); } + static Object getMapKey(AbstractMapEntryDecorator container) { return container.getKey(); } + static Object getMapKey(Map container) { return container.keySet().iterator().next(); } + static Object getMapValue(AbstractKeyValue container) { return container.getValue(); } + static Object getMapValueFromEntry(Map.Entry container) { return container.getValue(); } + static Object getMapValue(AbstractMapEntryDecorator container) { return container.getValue(); } + static Object getMapValue(Map container) { return container.get(null); } + + Object[] newWithArrayElement(Object element) { return new Object[] {element}; } + Object newWithElement(Object element) { Vector v = new Vector(); v.add((String)element); return v; } + + MyAbstractKeyValue newMAKVWithMapKey(Object element) { return new MyAbstractKeyValue(element,null); } + DefaultKeyValue newDKVWithMapKey(Object element) { return new DefaultKeyValue(element,null); } + MyAbstractMapEntry newMAMEWithMapKey(Object element) { return new MyAbstractMapEntry(element,null); } + MyAbstractMapEntryDecorator newMAMEDWithMapKey(Object element) { return new MyAbstractMapEntryDecorator(newMAMEWithMapKey(element)); } + ResourceBundle newRBWithMapKey(Object element) { return (ResourceBundle)null; } + Map newTreeMapWithMapKey(Object element) { Map m = new TreeMap(); m.put(element,null); return m; } + TiedMapEntry newTMEWithMapKey(Object element) { return new TiedMapEntry(newTreeMapWithMapKey(element),element); } + + MyAbstractKeyValue newMAKVWithMapValue(Object element) { return new MyAbstractKeyValue(null,element); } + DefaultKeyValue newDKVWithMapValue(Object element) { return new DefaultKeyValue(null,element); } + MyAbstractMapEntry newMAMEWithMapValue(Object element) { return new MyAbstractMapEntry(null,element); } + MyAbstractMapEntryDecorator newMAMEDWithMapValue(Object element) { return new MyAbstractMapEntryDecorator(newMAMEWithMapValue(element)); } + ResourceBundle newRBWithMapValue(Object element) { return (ResourceBundle)null; } + Map newTreeMapWithMapValue(Object element) { Map m = new TreeMap(); m.put(null,element); return m; } + TiedMapEntry newTMEWithMapValue(Object element) { return new TiedMapEntry(newTreeMapWithMapValue(element),null); } + UnmodifiableMapEntry newUMEWithMapValue(Object element) { return new UnmodifiableMapEntry(null,element); } + Object source() { return null; } void sink(Object o) { } @@ -99,21 +124,21 @@ public void test() { { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - DefaultKeyValue in = (DefaultKeyValue)newWithMapValue(source()); + DefaultKeyValue in = (DefaultKeyValue)newDKVWithMapValue(source()); out = in.setKey(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - MyAbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + MyAbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); out = in.mySetKey(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - MyAbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + MyAbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); out = in.mySetKey((Object)null); sink(out); // $hasValueFlow } @@ -148,56 +173,56 @@ public void test() { { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - UnmodifiableMapEntry in = (UnmodifiableMapEntry)newWithMapValue(source()); + UnmodifiableMapEntry in = (UnmodifiableMapEntry)newUMEWithMapValue(source()); out = in.setValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - DefaultKeyValue in = (DefaultKeyValue)newWithMapValue(source()); + DefaultKeyValue in = (DefaultKeyValue)newDKVWithMapValue(source()); out = in.setValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntry in = (MyAbstractMapEntry)newWithMapValue(source()); + AbstractMapEntry in = (MyAbstractMapEntry)newMAMEWithMapValue(source()); out = in.setValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntry in = (MyAbstractMapEntry)newWithMapValue(source()); + AbstractMapEntry in = (MyAbstractMapEntry)newMAMEWithMapValue(source()); out = in.setValue((Object)null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - MyAbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + MyAbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); out = in.mySetValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - MyAbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + MyAbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); out = in.mySetValue((Object)null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapKey of Argument[-1];ReturnValue;taint" String out = null; - AbstractKeyValue in = (MyAbstractKeyValue)newWithMapKey(source()); + AbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapKey(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapValue of Argument[-1];ReturnValue;taint" String out = null; - AbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + AbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); out = in.toString(); sink(out); // $hasTaintFlow } @@ -218,70 +243,70 @@ public void test() { { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapKey of Argument[0];MapKey of Argument[-1];value" AbstractMapEntryDecorator out = null; - Map.Entry in = (Map.Entry)newWithMapKey(source()); + Map.Entry in = (Map.Entry)newMAKVWithMapKey(source()); out = new MyAbstractMapEntryDecorator(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapValue of Argument[0];MapValue of Argument[-1];value" AbstractMapEntryDecorator out = null; - Map.Entry in = (Map.Entry)newWithMapValue(source()); + Map.Entry in = (Map.Entry)newMAKVWithMapValue(source()); out = new MyAbstractMapEntryDecorator(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value" Map.Entry out = null; - MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapKey(source()); + MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapKey(source()); out = in.myGetMapEntry(); - sink(getMapKey(out)); // $hasValueFlow + sink(getMapKeyFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value" Map.Entry out = null; - MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapValue(source()); + MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapValue(source()); out = in.myGetMapEntry(); - sink(getMapValue(out)); // $hasValueFlow + sink(getMapValueFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapKey of Argument[-1];ReturnValue;taint" String out = null; - AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapKey(source()); + AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapKey(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapValue of Argument[-1];ReturnValue;taint" String out = null; - AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapValue(source()); + AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapValue(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultKeyValue out = null; - Map.Entry in = (Map.Entry)newWithMapKey(source()); + Map.Entry in = (Map.Entry)newMAKVWithMapKey(source()); out = new DefaultKeyValue(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultKeyValue out = null; - Map.Entry in = (Map.Entry)newWithMapValue(source()); + Map.Entry in = (Map.Entry)newMAKVWithMapValue(source()); out = new DefaultKeyValue(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultKeyValue out = null; - KeyValue in = (KeyValue)newWithMapKey(source()); + KeyValue in = (KeyValue)newMAKVWithMapKey(source()); out = new DefaultKeyValue(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultKeyValue out = null; - KeyValue in = (KeyValue)newWithMapValue(source()); + KeyValue in = (KeyValue)newMAKVWithMapValue(source()); out = new DefaultKeyValue(in); sink(getMapValue(out)); // $hasValueFlow } @@ -302,42 +327,42 @@ public void test() { { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value" Map.Entry out = null; - DefaultKeyValue in = (DefaultKeyValue)newWithMapKey(source()); + DefaultKeyValue in = (DefaultKeyValue)newDKVWithMapKey(source()); out = in.toMapEntry(); - sink(getMapKey(out)); // $hasValueFlow + sink(getMapKeyFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value" Map.Entry out = null; - DefaultKeyValue in = (DefaultKeyValue)newWithMapValue(source()); + DefaultKeyValue in = (DefaultKeyValue)newDKVWithMapValue(source()); out = in.toMapEntry(); - sink(getMapValue(out)); // $hasValueFlow + sink(getMapValueFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultMapEntry out = null; - Map.Entry in = (Map.Entry)newWithMapKey(source()); + Map.Entry in = (Map.Entry)newMAKVWithMapKey(source()); out = new DefaultMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultMapEntry out = null; - Map.Entry in = (Map.Entry)newWithMapValue(source()); + Map.Entry in = (Map.Entry)newMAKVWithMapValue(source()); out = new DefaultMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultMapEntry out = null; - KeyValue in = (KeyValue)newWithMapKey(source()); + KeyValue in = (KeyValue)newMAKVWithMapKey(source()); out = new DefaultMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultMapEntry out = null; - KeyValue in = (KeyValue)newWithMapValue(source()); + KeyValue in = (KeyValue)newMAKVWithMapValue(source()); out = new DefaultMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } @@ -360,40 +385,40 @@ public void test() { TiedMapEntry out = null; Object in = (Object)source(); out = new TiedMapEntry(null, in); - sink(getMapKey(out)); // $hasValueFlow + sink(getMapKeyFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;TiedMapEntry;true;TiedMapEntry;;;MapValue of Argument[0];MapValue of Argument[-1];value" TiedMapEntry out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = new TiedMapEntry(in, null); - sink(getMapValue(out)); // $hasValueFlow + sink(getMapValueFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" UnmodifiableMapEntry out = null; - Map.Entry in = (Map.Entry)newWithMapKey(source()); + Map.Entry in = (Map.Entry)newMAKVWithMapKey(source()); out = new UnmodifiableMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" UnmodifiableMapEntry out = null; - Map.Entry in = (Map.Entry)newWithMapValue(source()); + Map.Entry in = (Map.Entry)newMAKVWithMapValue(source()); out = new UnmodifiableMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value" UnmodifiableMapEntry out = null; - KeyValue in = (KeyValue)newWithMapKey(source()); + KeyValue in = (KeyValue)newMAKVWithMapKey(source()); out = new UnmodifiableMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value" UnmodifiableMapEntry out = null; - KeyValue in = (KeyValue)newWithMapValue(source()); + KeyValue in = (KeyValue)newMAKVWithMapValue(source()); out = new UnmodifiableMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } @@ -414,56 +439,56 @@ public void test() { { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - TiedMapEntry in = (TiedMapEntry)newWithMapKey(source()); + TiedMapEntry in = (TiedMapEntry)newTMEWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - KeyValue in = (KeyValue)newWithMapKey(source()); + KeyValue in = (KeyValue)newMAKVWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapKey(source()); + AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (MyAbstractKeyValue)newWithMapKey(source()); + AbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - TiedMapEntry in = (TiedMapEntry)newWithMapValue(source()); + TiedMapEntry in = (TiedMapEntry)newTMEWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - KeyValue in = (KeyValue)newWithMapValue(source()); + KeyValue in = (KeyValue)newMAKVWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newWithMapValue(source()); + AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (MyAbstractKeyValue)newWithMapValue(source()); + AbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } @@ -477,28 +502,28 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.fixedSizeMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.fixedSizeMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapKey(source()); + SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); out = MapUtils.fixedSizeSortedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapValue(source()); + SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); out = MapUtils.fixedSizeSortedMap(in); sink(getMapValue(out)); // $hasValueFlow } @@ -512,14 +537,14 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;getMap;;;MapValue of Argument[0];ReturnValue;value" Map out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.getMap(in, null, null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;getMap;;;MapValue of Argument[0];ReturnValue;value" Map out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.getMap(in, null); sink(out); // $hasValueFlow } @@ -533,14 +558,14 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;getObject;;;MapValue of Argument[0];ReturnValue;value" Object out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.getObject(in, null, null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;getObject;;;MapValue of Argument[0];ReturnValue;value" Object out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.getObject(in, null); sink(out); // $hasValueFlow } @@ -554,168 +579,168 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;getString;;;MapValue of Argument[0];ReturnValue;value" String out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.getString(in, null, null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;getString;;;MapValue of Argument[0];ReturnValue;value" String out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.getString(in, null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapKey of Argument[0];MapValue of ReturnValue;value" Map out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.invertMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapValue of Argument[0];MapKey of ReturnValue;value" Map out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.invertMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;iterableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.iterableMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;iterableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.iterableMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableSortedMap out = null; - SortedMap in = (SortedMap)newWithMapKey(source()); + SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); out = MapUtils.iterableSortedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableSortedMap out = null; - SortedMap in = (SortedMap)newWithMapValue(source()); + SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); out = MapUtils.iterableSortedMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.lazyMap(in, (Transformer)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.lazyMap(in, (Factory)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.lazyMap(in, (Transformer)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.lazyMap(in, (Factory)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapKey(source()); + SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); out = MapUtils.lazySortedMap(in, (Transformer)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapKey(source()); + SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); out = MapUtils.lazySortedMap(in, (Factory)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapValue(source()); + SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); out = MapUtils.lazySortedMap(in, (Transformer)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapValue(source()); + SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); out = MapUtils.lazySortedMap(in, (Factory)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.multiValueMap(in, (Factory)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.multiValueMap(in, (Class)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.multiValueMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.multiValueMap(in, (Factory)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.multiValueMap(in, (Class)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.multiValueMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;orderedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" OrderedMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.orderedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;orderedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" OrderedMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.orderedMap(in); sink(getMapValue(out)); // $hasValueFlow } @@ -738,28 +763,28 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.predicatedMap(in, null, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.predicatedMap(in, null, null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapKey(source()); + SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); out = MapUtils.predicatedSortedMap(in, null, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapValue(source()); + SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); out = MapUtils.predicatedSortedMap(in, null, null); sink(getMapValue(out)); // $hasValueFlow } @@ -822,28 +847,28 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of Argument[0];value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newWithMapKey(source())); + Object[] in = (Object[])newWithArrayElement(newMAKVWithMapKey(source())); MapUtils.putAll(out, in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of ReturnValue;value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newWithMapKey(source())); + Object[] in = (Object[])newWithArrayElement(newMAKVWithMapKey(source())); out = MapUtils.putAll(null, in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of Argument[0];value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newWithMapValue(source())); + Object[] in = (Object[])newWithArrayElement(newMAKVWithMapValue(source())); MapUtils.putAll(out, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of ReturnValue;value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newWithMapValue(source())); + Object[] in = (Object[])newWithArrayElement(newMAKVWithMapValue(source())); out = MapUtils.putAll(null, in); sink(getMapValue(out)); // $hasValueFlow } @@ -864,98 +889,98 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" Map out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.synchronizedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" Map out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.synchronizedMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapKey(source()); + SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); out = MapUtils.synchronizedSortedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapValue(source()); + SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); out = MapUtils.synchronizedSortedMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;toMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" Map out = null; - ResourceBundle in = (ResourceBundle)newWithMapKey(source()); + ResourceBundle in = (ResourceBundle)newRBWithMapKey(source()); out = MapUtils.toMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;toMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" Map out = null; - ResourceBundle in = (ResourceBundle)newWithMapValue(source()); + ResourceBundle in = (ResourceBundle)newRBWithMapValue(source()); out = MapUtils.toMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;transformedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.transformedMap(in, null, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;transformedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.transformedMap(in, null, null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapKey(source()); + SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); out = MapUtils.transformedSortedMap(in, null, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapValue(source()); + SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); out = MapUtils.transformedSortedMap(in, null, null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" Map out = null; - Map in = (Map)newWithMapKey(source()); + Map in = (Map)newTreeMapWithMapKey(source()); out = MapUtils.unmodifiableMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" Map out = null; - Map in = (Map)newWithMapValue(source()); + Map in = (Map)newTreeMapWithMapValue(source()); out = MapUtils.unmodifiableMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapKey(source()); + SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); out = MapUtils.unmodifiableSortedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newWithMapValue(source()); + SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); out = MapUtils.unmodifiableSortedMap(in); sink(getMapValue(out)); // $hasValueFlow } diff --git a/java/ql/test/library-tests/frameworks/apache-collections/test.ql b/java/ql/test/library-tests/frameworks/apache-collections/test.ql index 4ec971af08b8..611fcd302ee8 100644 --- a/java/ql/test/library-tests/frameworks/apache-collections/test.ql +++ b/java/ql/test/library-tests/frameworks/apache-collections/test.ql @@ -9,12 +9,8 @@ class SummaryModelTest extends SummaryModelCsv { row = [ //"package;type;overrides;name;signature;ext;inputspec;outputspec;kind", - "generatedtest;Test;false;getMapValue;;;MapValue of Argument[0];ReturnValue;value", - "generatedtest;Test;false;getMapKey;;;MapKey of Argument[0];ReturnValue;value", - "generatedtest;Test;false;newWithMapValue;;;Argument[0];MapValue of ReturnValue;value", - "generatedtest;Test;false;newWithElement;;;Argument[0];Element of ReturnValue;value", - "generatedtest;Test;false;newWithArrayElement;;;Argument[0];ArrayElement of ReturnValue;value", - "generatedtest;Test;false;newWithMapKey;;;Argument[0];MapKey of ReturnValue;value" + "generatedtest;Test;false;newRBWithMapValue;;;Argument[0];MapValue of ReturnValue;value", + "generatedtest;Test;false;newRBWithMapKey;;;Argument[0];MapKey of ReturnValue;value" ] } } @@ -29,6 +25,8 @@ class ValueFlowConf extends DataFlow::Configuration { override predicate isSink(DataFlow::Node n) { n.asExpr().(Argument).getCall().getCallee().hasName("sink") } + + override int fieldFlowBranchLimit() { result = 1000 } } class TaintFlowConf extends TaintTracking::Configuration { @@ -41,6 +39,8 @@ class TaintFlowConf extends TaintTracking::Configuration { override predicate isSink(DataFlow::Node n) { n.asExpr().(Argument).getCall().getCallee().hasName("sink") } + + override int fieldFlowBranchLimit() { result = 1000 } } class HasFlowTest extends InlineExpectationsTest { From e2803800dc9e6b4f937383abceec8a6cd5d0d5a5 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 25 Jun 2021 11:22:26 +0100 Subject: [PATCH 13/15] Add change note --- .../2021-06-25-apache-collections-maputils-keyvalue.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 java/change-notes/2021-06-25-apache-collections-maputils-keyvalue.md diff --git a/java/change-notes/2021-06-25-apache-collections-maputils-keyvalue.md b/java/change-notes/2021-06-25-apache-collections-maputils-keyvalue.md new file mode 100644 index 000000000000..d3949b3b3df6 --- /dev/null +++ b/java/change-notes/2021-06-25-apache-collections-maputils-keyvalue.md @@ -0,0 +1,2 @@ +lgtm,codescanning +* Added models for the package `keyvalue` and the classes `KeyValue` and `MapUtils` from Apache Commons Collections. This may lead to more results from any query using data-flow analysis where a relevant path uses one of these container types. From 044ecc51e532bf28149bcef6f9feff5c4e9c9446 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 25 Jun 2021 13:51:18 +0100 Subject: [PATCH 14/15] Manually improve tests #2 --- .../frameworks/apache-collections/Test.java | 258 +++++++++--------- 1 file changed, 129 insertions(+), 129 deletions(-) diff --git a/java/ql/test/library-tests/frameworks/apache-collections/Test.java b/java/ql/test/library-tests/frameworks/apache-collections/Test.java index d7c070fe9a3a..f043b30399ed 100644 --- a/java/ql/test/library-tests/frameworks/apache-collections/Test.java +++ b/java/ql/test/library-tests/frameworks/apache-collections/Test.java @@ -35,14 +35,14 @@ public class Test { static Object getMapValue(Map container) { return container.get(null); } Object[] newWithArrayElement(Object element) { return new Object[] {element}; } - Object newWithElement(Object element) { Vector v = new Vector(); v.add((String)element); return v; } + Iterable newWithElement(String element) { Vector v = new Vector(); v.add(element); return v; } MyAbstractKeyValue newMAKVWithMapKey(Object element) { return new MyAbstractKeyValue(element,null); } DefaultKeyValue newDKVWithMapKey(Object element) { return new DefaultKeyValue(element,null); } MyAbstractMapEntry newMAMEWithMapKey(Object element) { return new MyAbstractMapEntry(element,null); } MyAbstractMapEntryDecorator newMAMEDWithMapKey(Object element) { return new MyAbstractMapEntryDecorator(newMAMEWithMapKey(element)); } ResourceBundle newRBWithMapKey(Object element) { return (ResourceBundle)null; } - Map newTreeMapWithMapKey(Object element) { Map m = new TreeMap(); m.put(element,null); return m; } + SortedMap newTreeMapWithMapKey(Object element) { SortedMap m = new TreeMap(); m.put(element,null); return m; } TiedMapEntry newTMEWithMapKey(Object element) { return new TiedMapEntry(newTreeMapWithMapKey(element),element); } MyAbstractKeyValue newMAKVWithMapValue(Object element) { return new MyAbstractKeyValue(null,element); } @@ -50,7 +50,7 @@ public class Test { MyAbstractMapEntry newMAMEWithMapValue(Object element) { return new MyAbstractMapEntry(null,element); } MyAbstractMapEntryDecorator newMAMEDWithMapValue(Object element) { return new MyAbstractMapEntryDecorator(newMAMEWithMapValue(element)); } ResourceBundle newRBWithMapValue(Object element) { return (ResourceBundle)null; } - Map newTreeMapWithMapValue(Object element) { Map m = new TreeMap(); m.put(null,element); return m; } + SortedMap newTreeMapWithMapValue(Object element) { SortedMap m = new TreeMap(); m.put(null,element); return m; } TiedMapEntry newTMEWithMapValue(Object element) { return new TiedMapEntry(newTreeMapWithMapValue(element),null); } UnmodifiableMapEntry newUMEWithMapValue(Object element) { return new UnmodifiableMapEntry(null,element); } @@ -96,399 +96,399 @@ public void test() { { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[0];MapKey of Argument[-1];value" AbstractKeyValue out = null; - Object in = (Object)source(); + Object in = source(); out = new MyAbstractKeyValue(in, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;AbstractKeyValue;;;Argument[1];MapValue of Argument[-1];value" AbstractKeyValue out = null; - Object in = (Object)source(); + Object in = source(); out = new MyAbstractKeyValue(null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;Argument[0];MapKey of Argument[-1];value" DefaultKeyValue out = null; - Object in = (Object)source(); + Object in = source(); out.setKey(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;Argument[0];MapKey of Argument[-1];value" MyAbstractKeyValue out = null; - Object in = (Object)source(); + Object in = source(); out.mySetKey(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - DefaultKeyValue in = (DefaultKeyValue)newDKVWithMapValue(source()); + DefaultKeyValue in = newDKVWithMapValue(source()); out = in.setKey(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - MyAbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); + MyAbstractKeyValue in = newMAKVWithMapValue(source()); out = in.mySetKey(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setKey;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - MyAbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); + MyAbstractKeyValue in = newMAKVWithMapValue(source()); out = in.mySetKey((Object)null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value" UnmodifiableMapEntry out = null; - Object in = (Object)source(); + Object in = source(); out.setValue(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value" DefaultKeyValue out = null; - Object in = (Object)source(); + Object in = source(); out.setValue(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value" AbstractMapEntry out = null; - Object in = (Object)source(); + Object in = source(); out.setValue(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;Argument[0];MapValue of Argument[-1];value" MyAbstractKeyValue out = null; - Object in = (Object)source(); + Object in = source(); out.mySetValue(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - UnmodifiableMapEntry in = (UnmodifiableMapEntry)newUMEWithMapValue(source()); + UnmodifiableMapEntry in = newUMEWithMapValue(source()); out = in.setValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - DefaultKeyValue in = (DefaultKeyValue)newDKVWithMapValue(source()); + DefaultKeyValue in = newDKVWithMapValue(source()); out = in.setValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntry in = (MyAbstractMapEntry)newMAMEWithMapValue(source()); + AbstractMapEntry in = newMAMEWithMapValue(source()); out = in.setValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntry in = (MyAbstractMapEntry)newMAMEWithMapValue(source()); - out = in.setValue((Object)null); + AbstractMapEntry in = newMAMEWithMapValue(source()); + out = in.setValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - MyAbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); + MyAbstractKeyValue in = newMAKVWithMapValue(source()); out = in.mySetValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;setValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - MyAbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); - out = in.mySetValue((Object)null); + MyAbstractKeyValue in = newMAKVWithMapValue(source()); + out = in.mySetValue(null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapKey of Argument[-1];ReturnValue;taint" String out = null; - AbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapKey(source()); + AbstractKeyValue in = newMAKVWithMapKey(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;AbstractKeyValue;true;toString;;;MapValue of Argument[-1];ReturnValue;taint" String out = null; - AbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); + AbstractKeyValue in = newMAKVWithMapValue(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[0];MapKey of Argument[-1];value" AbstractMapEntry out = null; - Object in = (Object)source(); + Object in = source(); out = new MyAbstractMapEntry(in, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntry;true;AbstractMapEntry;;;Argument[1];MapValue of Argument[-1];value" AbstractMapEntry out = null; - Object in = (Object)source(); + Object in = source(); out = new MyAbstractMapEntry(null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapKey of Argument[0];MapKey of Argument[-1];value" AbstractMapEntryDecorator out = null; - Map.Entry in = (Map.Entry)newMAKVWithMapKey(source()); + Map.Entry in = newMAMEWithMapKey(source()); out = new MyAbstractMapEntryDecorator(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;AbstractMapEntryDecorator;;;MapValue of Argument[0];MapValue of Argument[-1];value" AbstractMapEntryDecorator out = null; - Map.Entry in = (Map.Entry)newMAKVWithMapValue(source()); + Map.Entry in = newMAMEWithMapValue(source()); out = new MyAbstractMapEntryDecorator(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value" Map.Entry out = null; - MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapKey(source()); + MyAbstractMapEntryDecorator in = newMAMEDWithMapKey(source()); out = in.myGetMapEntry(); sink(getMapKeyFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;getMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value" Map.Entry out = null; - MyAbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapValue(source()); + MyAbstractMapEntryDecorator in = newMAMEDWithMapValue(source()); out = in.myGetMapEntry(); sink(getMapValueFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapKey of Argument[-1];ReturnValue;taint" String out = null; - AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapKey(source()); + AbstractMapEntryDecorator in = newMAMEDWithMapKey(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;AbstractMapEntryDecorator;true;toString;;;MapValue of Argument[-1];ReturnValue;taint" String out = null; - AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapValue(source()); + AbstractMapEntryDecorator in = newMAMEDWithMapValue(source()); out = in.toString(); sink(out); // $hasTaintFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultKeyValue out = null; - Map.Entry in = (Map.Entry)newMAKVWithMapKey(source()); + Map.Entry in = newMAMEWithMapKey(source()); out = new DefaultKeyValue(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultKeyValue out = null; - Map.Entry in = (Map.Entry)newMAKVWithMapValue(source()); + Map.Entry in = newMAMEWithMapValue(source()); out = new DefaultKeyValue(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultKeyValue out = null; - KeyValue in = (KeyValue)newMAKVWithMapKey(source()); + KeyValue in = newMAKVWithMapKey(source()); out = new DefaultKeyValue(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultKeyValue out = null; - KeyValue in = (KeyValue)newMAKVWithMapValue(source()); + KeyValue in = newMAKVWithMapValue(source()); out = new DefaultKeyValue(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[0];MapKey of Argument[-1];value" DefaultKeyValue out = null; - Object in = (Object)source(); + Object in = source(); out = new DefaultKeyValue(in, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;DefaultKeyValue;(Object,Object);;Argument[1];MapValue of Argument[-1];value" DefaultKeyValue out = null; - Object in = (Object)source(); + Object in = source(); out = new DefaultKeyValue(null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapKey of Argument[-1];MapKey of ReturnValue;value" Map.Entry out = null; - DefaultKeyValue in = (DefaultKeyValue)newDKVWithMapKey(source()); + DefaultKeyValue in = newDKVWithMapKey(source()); out = in.toMapEntry(); sink(getMapKeyFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultKeyValue;true;toMapEntry;;;MapValue of Argument[-1];MapValue of ReturnValue;value" Map.Entry out = null; - DefaultKeyValue in = (DefaultKeyValue)newDKVWithMapValue(source()); + DefaultKeyValue in = newDKVWithMapValue(source()); out = in.toMapEntry(); sink(getMapValueFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultMapEntry out = null; - Map.Entry in = (Map.Entry)newMAKVWithMapKey(source()); + Map.Entry in = newMAMEWithMapKey(source()); out = new DefaultMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultMapEntry out = null; - Map.Entry in = (Map.Entry)newMAKVWithMapValue(source()); + Map.Entry in = newMAMEWithMapValue(source()); out = new DefaultMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value" DefaultMapEntry out = null; - KeyValue in = (KeyValue)newMAKVWithMapKey(source()); + KeyValue in = newMAKVWithMapKey(source()); out = new DefaultMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value" DefaultMapEntry out = null; - KeyValue in = (KeyValue)newMAKVWithMapValue(source()); + KeyValue in = newMAKVWithMapValue(source()); out = new DefaultMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value" DefaultMapEntry out = null; - Object in = (Object)source(); + Object in = source(); out = new DefaultMapEntry(in, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;DefaultMapEntry;true;DefaultMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value" DefaultMapEntry out = null; - Object in = (Object)source(); + Object in = source(); out = new DefaultMapEntry(null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;TiedMapEntry;true;TiedMapEntry;;;Argument[1];MapKey of Argument[-1];value" TiedMapEntry out = null; - Object in = (Object)source(); + Object in = source(); out = new TiedMapEntry(null, in); sink(getMapKeyFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;TiedMapEntry;true;TiedMapEntry;;;MapValue of Argument[0];MapValue of Argument[-1];value" TiedMapEntry out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = new TiedMapEntry(in, null); sink(getMapValueFromEntry(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapKey of Argument[0];MapKey of Argument[-1];value" UnmodifiableMapEntry out = null; - Map.Entry in = (Map.Entry)newMAKVWithMapKey(source()); + Map.Entry in = newMAMEWithMapKey(source()); out = new UnmodifiableMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Entry);;MapValue of Argument[0];MapValue of Argument[-1];value" UnmodifiableMapEntry out = null; - Map.Entry in = (Map.Entry)newMAKVWithMapValue(source()); + Map.Entry in = newMAMEWithMapValue(source()); out = new UnmodifiableMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapKey of Argument[0];MapKey of Argument[-1];value" UnmodifiableMapEntry out = null; - KeyValue in = (KeyValue)newMAKVWithMapKey(source()); + KeyValue in = newMAKVWithMapKey(source()); out = new UnmodifiableMapEntry(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(KeyValue);;MapValue of Argument[0];MapValue of Argument[-1];value" UnmodifiableMapEntry out = null; - KeyValue in = (KeyValue)newMAKVWithMapValue(source()); + KeyValue in = newMAKVWithMapValue(source()); out = new UnmodifiableMapEntry(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[0];MapKey of Argument[-1];value" UnmodifiableMapEntry out = null; - Object in = (Object)source(); + Object in = source(); out = new UnmodifiableMapEntry(in, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4.keyvalue;UnmodifiableMapEntry;true;UnmodifiableMapEntry;(Object,Object);;Argument[1];MapValue of Argument[-1];value" UnmodifiableMapEntry out = null; - Object in = (Object)source(); + Object in = source(); out = new UnmodifiableMapEntry(null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - TiedMapEntry in = (TiedMapEntry)newTMEWithMapKey(source()); + TiedMapEntry in = newTMEWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - KeyValue in = (KeyValue)newMAKVWithMapKey(source()); + KeyValue in = newMAKVWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapKey(source()); + AbstractMapEntryDecorator in = newMAMEDWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getKey;;;MapKey of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapKey(source()); + AbstractKeyValue in = newMAKVWithMapKey(source()); out = in.getKey(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - TiedMapEntry in = (TiedMapEntry)newTMEWithMapValue(source()); + TiedMapEntry in = newTMEWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - KeyValue in = (KeyValue)newMAKVWithMapValue(source()); + KeyValue in = newMAKVWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractMapEntryDecorator in = (MyAbstractMapEntryDecorator)newMAMEDWithMapValue(source()); + AbstractMapEntryDecorator in = newMAMEDWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;KeyValue;true;getValue;;;MapValue of Argument[-1];ReturnValue;value" Object out = null; - AbstractKeyValue in = (MyAbstractKeyValue)newMAKVWithMapValue(source()); + AbstractKeyValue in = newMAKVWithMapValue(source()); out = in.getValue(); sink(out); // $hasValueFlow } @@ -502,28 +502,28 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.fixedSizeMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;fixedSizeMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.fixedSizeMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); + SortedMap in = newTreeMapWithMapKey(source()); out = MapUtils.fixedSizeSortedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;fixedSizeSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); + SortedMap in = newTreeMapWithMapValue(source()); out = MapUtils.fixedSizeSortedMap(in); sink(getMapValue(out)); // $hasValueFlow } @@ -537,35 +537,35 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;getMap;;;MapValue of Argument[0];ReturnValue;value" Map out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.getMap(in, null, null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;getMap;;;MapValue of Argument[0];ReturnValue;value" Map out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.getMap(in, null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;getObject;;;Argument[2];ReturnValue;value" Object out = null; - Object in = (Object)source(); + Object in = source(); out = MapUtils.getObject(null, null, in); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;getObject;;;MapValue of Argument[0];ReturnValue;value" Object out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.getObject(in, null, null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;getObject;;;MapValue of Argument[0];ReturnValue;value" Object out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.getObject(in, null); sink(out); // $hasValueFlow } @@ -579,175 +579,175 @@ public void test() { { // "org.apache.commons.collections4;MapUtils;true;getString;;;MapValue of Argument[0];ReturnValue;value" String out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.getString(in, null, null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;getString;;;MapValue of Argument[0];ReturnValue;value" String out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.getString(in, null); sink(out); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapKey of Argument[0];MapValue of ReturnValue;value" Map out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.invertMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;invertMap;;;MapValue of Argument[0];MapKey of ReturnValue;value" Map out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.invertMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;iterableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.iterableMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;iterableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.iterableMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableSortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); + SortedMap in = newTreeMapWithMapKey(source()); out = MapUtils.iterableSortedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;iterableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableSortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); + SortedMap in = newTreeMapWithMapValue(source()); out = MapUtils.iterableSortedMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.lazyMap(in, (Transformer)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.lazyMap(in, (Factory)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.lazyMap(in, (Transformer)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazyMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.lazyMap(in, (Factory)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); + SortedMap in = newTreeMapWithMapKey(source()); out = MapUtils.lazySortedMap(in, (Transformer)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); + SortedMap in = newTreeMapWithMapKey(source()); out = MapUtils.lazySortedMap(in, (Factory)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); + SortedMap in = newTreeMapWithMapValue(source()); out = MapUtils.lazySortedMap(in, (Transformer)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;lazySortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); + SortedMap in = newTreeMapWithMapValue(source()); out = MapUtils.lazySortedMap(in, (Factory)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.multiValueMap(in, (Factory)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.multiValueMap(in, (Class)null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.multiValueMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.multiValueMap(in, (Factory)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.multiValueMap(in, (Class)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;multiValueMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" MultiValueMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.multiValueMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;orderedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" OrderedMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.orderedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;orderedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" OrderedMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.orderedMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;populateMap;(Map,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value" Map out = null; - Iterable in = (Iterable)newWithElement(source()); + Iterable in = newWithElement((String)source()); MapUtils.populateMap(out, in, (Transformer)null); sink(getMapValue(out)); // $hasValueFlow } @@ -756,231 +756,231 @@ public void test() { // which overload it should choose unless you put the generic types in correctly // "org.apache.commons.collections4;MapUtils;true;populateMap;(MultiMap,Iterable,Transformer);;Element of Argument[1];MapValue of Argument[0];value" MultiMap out = null; - Iterable in = (Iterable)newWithElement(source()); + Iterable in = newWithElement((String)source()); MapUtils.populateMap(out, in, (Transformer)null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.predicatedMap(in, null, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;predicatedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.predicatedMap(in, null, null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); + SortedMap in = newTreeMapWithMapKey(source()); out = MapUtils.predicatedSortedMap(in, null, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;predicatedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); + SortedMap in = newTreeMapWithMapValue(source()); out = MapUtils.predicatedSortedMap(in, null, null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of Argument[0];value" Map out = null; - Object[] in = (Object[])newWithArrayElement(source()); + Object[] in = newWithArrayElement(source()); MapUtils.putAll(out, in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapKey of ReturnValue;value" Map out = null; - Object[] in = (Object[])newWithArrayElement(source()); + Object[] in = newWithArrayElement(source()); out = MapUtils.putAll(null, in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapValue of Argument[0];value" Map out = null; - Object[] in = (Object[])newWithArrayElement(source()); + Object[] in = newWithArrayElement(source()); MapUtils.putAll(out, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of Argument[1];MapValue of ReturnValue;value" Map out = null; - Object[] in = (Object[])newWithArrayElement(source()); + Object[] in = newWithArrayElement(source()); out = MapUtils.putAll(null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapKey of Argument[0];value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newWithArrayElement(source())); + Object[] in = newWithArrayElement(newWithArrayElement(source())); MapUtils.putAll(out, in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapKey of ReturnValue;value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newWithArrayElement(source())); + Object[] in = newWithArrayElement(newWithArrayElement(source())); out = MapUtils.putAll(null, in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapValue of Argument[0];value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newWithArrayElement(source())); + Object[] in = newWithArrayElement(newWithArrayElement(source())); MapUtils.putAll(out, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;ArrayElement of ArrayElement of Argument[1];MapValue of ReturnValue;value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newWithArrayElement(source())); + Object[] in = newWithArrayElement(newWithArrayElement(source())); out = MapUtils.putAll(null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of Argument[0];value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newMAKVWithMapKey(source())); + Object[] in = newWithArrayElement(newMAKVWithMapKey(source())); MapUtils.putAll(out, in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapKey of ArrayElement of Argument[1];MapKey of ReturnValue;value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newMAKVWithMapKey(source())); + Object[] in = newWithArrayElement(newMAKVWithMapKey(source())); out = MapUtils.putAll(null, in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of Argument[0];value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newMAKVWithMapValue(source())); + Object[] in = newWithArrayElement(newMAKVWithMapValue(source())); MapUtils.putAll(out, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;putAll;;;MapValue of ArrayElement of Argument[1];MapValue of ReturnValue;value" Map out = null; - Object[] in = (Object[])newWithArrayElement(newMAKVWithMapValue(source())); + Object[] in = newWithArrayElement(newMAKVWithMapValue(source())); out = MapUtils.putAll(null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;safeAddToMap;;;Argument[1];MapKey of Argument[0];value" Map out = null; - Object in = (Object)source(); + Object in = source(); MapUtils.safeAddToMap(out, in, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;safeAddToMap;;;Argument[2];MapValue of Argument[0];value" Map out = null; - Object in = (Object)source(); + Object in = source(); MapUtils.safeAddToMap(out, null, in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" Map out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.synchronizedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;synchronizedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" Map out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.synchronizedMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); + SortedMap in = newTreeMapWithMapKey(source()); out = MapUtils.synchronizedSortedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;synchronizedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); + SortedMap in = newTreeMapWithMapValue(source()); out = MapUtils.synchronizedSortedMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;toMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" Map out = null; - ResourceBundle in = (ResourceBundle)newRBWithMapKey(source()); + ResourceBundle in = newRBWithMapKey(source()); out = MapUtils.toMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;toMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" Map out = null; - ResourceBundle in = (ResourceBundle)newRBWithMapValue(source()); + ResourceBundle in = newRBWithMapValue(source()); out = MapUtils.toMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;transformedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.transformedMap(in, null, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;transformedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" IterableMap out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.transformedMap(in, null, null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); + SortedMap in = newTreeMapWithMapKey(source()); out = MapUtils.transformedSortedMap(in, null, null); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;transformedSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); + SortedMap in = newTreeMapWithMapValue(source()); out = MapUtils.transformedSortedMap(in, null, null); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" Map out = null; - Map in = (Map)newTreeMapWithMapKey(source()); + Map in = newTreeMapWithMapKey(source()); out = MapUtils.unmodifiableMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;unmodifiableMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" Map out = null; - Map in = (Map)newTreeMapWithMapValue(source()); + Map in = newTreeMapWithMapValue(source()); out = MapUtils.unmodifiableMap(in); sink(getMapValue(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapKey(source()); + SortedMap in = newTreeMapWithMapKey(source()); out = MapUtils.unmodifiableSortedMap(in); sink(getMapKey(out)); // $hasValueFlow } { // "org.apache.commons.collections4;MapUtils;true;unmodifiableSortedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value" SortedMap out = null; - SortedMap in = (SortedMap)newTreeMapWithMapValue(source()); + SortedMap in = newTreeMapWithMapValue(source()); out = MapUtils.unmodifiableSortedMap(in); sink(getMapValue(out)); // $hasValueFlow } From bad32716e85c373a3a8f000851d21ce7ce838edc Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 25 Jun 2021 14:51:09 +0100 Subject: [PATCH 15/15] Import Apache Collections models in ExternalFlow --- java/ql/src/semmle/code/java/dataflow/ExternalFlow.qll | 1 + 1 file changed, 1 insertion(+) diff --git a/java/ql/src/semmle/code/java/dataflow/ExternalFlow.qll b/java/ql/src/semmle/code/java/dataflow/ExternalFlow.qll index abaaab001718..f43dcf774f2f 100644 --- a/java/ql/src/semmle/code/java/dataflow/ExternalFlow.qll +++ b/java/ql/src/semmle/code/java/dataflow/ExternalFlow.qll @@ -78,6 +78,7 @@ private import FlowSummary private module Frameworks { private import internal.ContainerFlow private import semmle.code.java.frameworks.ApacheHttp + private import semmle.code.java.frameworks.apache.Collections private import semmle.code.java.frameworks.apache.Lang private import semmle.code.java.frameworks.guava.Guava private import semmle.code.java.frameworks.jackson.JacksonSerializability