Fix more models based on review comments

This commit is contained in:
Owen Mansel-Chan
2021-08-12 14:50:14 +01:00
parent 2000985509
commit fe477ff989
2 changed files with 86 additions and 52 deletions

View File

@@ -290,11 +290,15 @@ private class ApacheCollectionUtilsModel extends SummaryModelCsv {
";CollectionUtils;true;predicatedCollection;;;Element of Argument[0];Element of ReturnValue;value", ";CollectionUtils;true;predicatedCollection;;;Element of Argument[0];Element of ReturnValue;value",
";CollectionUtils;true;removeAll;;;Element of Argument[0];Element of ReturnValue;value", ";CollectionUtils;true;removeAll;;;Element of Argument[0];Element of ReturnValue;value",
";CollectionUtils;true;retainAll;;;Element of Argument[0];Element of ReturnValue;value", ";CollectionUtils;true;retainAll;;;Element of Argument[0];Element of ReturnValue;value",
";CollectionUtils;true;select;;;Element of Argument[0];Element of ReturnValue;value", ";CollectionUtils;true;select;(Iterable,Predicate);;Element of Argument[0];Element of ReturnValue;value",
";CollectionUtils;true;select;;;Element of Argument[0];Element of Argument[2];value", ";CollectionUtils;true;select;(Iterable,Predicate,Collection);;Element of Argument[0];Element of Argument[2];value",
";CollectionUtils;true;select;;;Element of Argument[0];Element of Argument[3];value", ";CollectionUtils;true;select;(Iterable,Predicate,Collection);;Argument[2];ReturnValue;value",
";CollectionUtils;true;selectRejected;;;Element of Argument[0];Element of ReturnValue;value", ";CollectionUtils;true;select;(Iterable,Predicate,Collection,Collection);;Element of Argument[0];Element of Argument[2];value",
";CollectionUtils;true;selectRejected;;;Element of Argument[0];Element of Argument[2];value", ";CollectionUtils;true;select;(Iterable,Predicate,Collection,Collection);;Element of Argument[0];Element of Argument[3];value",
";CollectionUtils;true;select;(Iterable,Predicate,Collection,Collection);;Argument[2];ReturnValue;value",
";CollectionUtils;true;selectRejected;(Iterable,Predicate);;Element of Argument[0];Element of ReturnValue;value",
";CollectionUtils;true;selectRejected;(Iterable,Predicate,Collection);;Element of Argument[0];Element of Argument[2];value",
";CollectionUtils;true;selectRejected;(Iterable,Predicate,Collection);;Argument[2];ReturnValue;value",
";CollectionUtils;true;subtract;;;Element of Argument[0];Element of ReturnValue;value", ";CollectionUtils;true;subtract;;;Element of Argument[0];Element of ReturnValue;value",
";CollectionUtils;true;synchronizedCollection;;;Element of Argument[0];Element of ReturnValue;value", ";CollectionUtils;true;synchronizedCollection;;;Element of Argument[0];Element of ReturnValue;value",
";CollectionUtils;true;transformingCollection;;;Element of Argument[0];Element of ReturnValue;value", ";CollectionUtils;true;transformingCollection;;;Element of Argument[0];Element of ReturnValue;value",
@@ -372,6 +376,7 @@ private class ApacheIteratorUtilsModel extends SummaryModelCsv {
";IteratorUtils;true;filteredListIterator;;;Element of Argument[0];Element of ReturnValue;value", ";IteratorUtils;true;filteredListIterator;;;Element of Argument[0];Element of ReturnValue;value",
";IteratorUtils;true;find;;;Element of Argument[0];ReturnValue;value", ";IteratorUtils;true;find;;;Element of Argument[0];ReturnValue;value",
";IteratorUtils;true;first;;;Element of Argument[0];ReturnValue;value", ";IteratorUtils;true;first;;;Element of Argument[0];ReturnValue;value",
";IteratorUtils;true;forEachButLast;;;Element of Argument[0];ReturnValue;value",
";IteratorUtils;true;get;;;Element of Argument[0];ReturnValue;value", ";IteratorUtils;true;get;;;Element of Argument[0];ReturnValue;value",
";IteratorUtils;true;getIterator;;;Element of Argument[0];Element of ReturnValue;value", ";IteratorUtils;true;getIterator;;;Element of Argument[0];Element of ReturnValue;value",
";IteratorUtils;true;getIterator;;;ArrayElement of Argument[0];Element of ReturnValue;value", ";IteratorUtils;true;getIterator;;;ArrayElement of Argument[0];Element of ReturnValue;value",
@@ -432,6 +437,7 @@ private class ApacheIterableUtilsModel extends SummaryModelCsv {
";IterableUtils;true;filteredIterable;;;Element of Argument[0];Element of ReturnValue;value", ";IterableUtils;true;filteredIterable;;;Element of Argument[0];Element of ReturnValue;value",
";IterableUtils;true;find;;;Element of Argument[0];ReturnValue;value", ";IterableUtils;true;find;;;Element of Argument[0];ReturnValue;value",
";IterableUtils;true;first;;;Element of Argument[0];ReturnValue;value", ";IterableUtils;true;first;;;Element of Argument[0];ReturnValue;value",
";IterableUtils;true;forEachButLast;;;Element of Argument[0];ReturnValue;value",
";IterableUtils;true;get;;;Element of Argument[0];ReturnValue;value", ";IterableUtils;true;get;;;Element of Argument[0];ReturnValue;value",
";IterableUtils;true;loopingIterable;;;Element of Argument[0];Element of ReturnValue;value", ";IterableUtils;true;loopingIterable;;;Element of Argument[0];Element of ReturnValue;value",
";IterableUtils;true;partition;;;Element of Argument[0];Element of Element of ReturnValue;value", ";IterableUtils;true;partition;;;Element of Argument[0];Element of Element of ReturnValue;value",
@@ -475,9 +481,9 @@ private class ApacheMultiMapUtilsModel extends SummaryModelCsv {
[ [
";MultiMapUtils;true;emptyIfNull;;;Argument[0];ReturnValue;value", ";MultiMapUtils;true;emptyIfNull;;;Argument[0];ReturnValue;value",
";MultiMapUtils;true;getCollection;;;MapValue of Argument[0];ReturnValue;value", ";MultiMapUtils;true;getCollection;;;MapValue of Argument[0];ReturnValue;value",
";MultiMapUtils;true;getValuesAsBag;;;MapValue of Argument[0];ReturnValue;value", ";MultiMapUtils;true;getValuesAsBag;;;Element of MapValue of Argument[0];Element of ReturnValue;value",
";MultiMapUtils;true;getValuesAsList;;;MapValue of Argument[0];ReturnValue;value", ";MultiMapUtils;true;getValuesAsList;;;Element of MapValue of Argument[0];Element of ReturnValue;value",
";MultiMapUtils;true;getValuesAsSet;;;MapValue of Argument[0];ReturnValue;value", ";MultiMapUtils;true;getValuesAsSet;;;Element of MapValue of Argument[0];Element of ReturnValue;value",
";MultiMapUtils;true;transformedMultiValuedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", ";MultiMapUtils;true;transformedMultiValuedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value",
";MultiMapUtils;true;transformedMultiValuedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value", ";MultiMapUtils;true;transformedMultiValuedMap;;;MapValue of Argument[0];MapValue of ReturnValue;value",
";MultiMapUtils;true;unmodifiableMultiValuedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value", ";MultiMapUtils;true;unmodifiableMultiValuedMap;;;MapKey of Argument[0];MapKey of ReturnValue;value",

View File

@@ -1446,68 +1446,82 @@ public class Test {
sink(getElement(out)); // $ hasValueFlow sink(getElement(out)); // $ hasValueFlow
} }
{ {
// "org.apache.commons.collections4;CollectionUtils;true;select;;;Element of Argument[0];Element of Argument[2];value" // "org.apache.commons.collections4;CollectionUtils;true;select;(Iterable,Predicate);;Element of Argument[0];Element of ReturnValue;value"
Collection out = null;
Iterable in = newVectorWithElement((String)source());
CollectionUtils.select(in, null, out, null);
sink(getElement(out)); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;select;;;Element of Argument[0];Element of Argument[2];value"
Collection out = null;
Iterable in = newVectorWithElement((String)source());
CollectionUtils.select(in, null, out);
sink(getElement(out)); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;select;;;Element of Argument[0];Element of Argument[3];value"
Collection out = null;
Iterable in = newVectorWithElement((String)source());
CollectionUtils.select(in, null, null, out);
sink(getElement(out)); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;select;;;Element of Argument[0];Element of ReturnValue;value"
Collection out = null;
Iterable in = newVectorWithElement((String)source());
out = CollectionUtils.select(in, null, null, null);
sink(getElement(out)); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;select;;;Element of Argument[0];Element of ReturnValue;value"
Collection out = null;
Iterable in = newVectorWithElement((String)source());
out = CollectionUtils.select(in, null, null);
sink(getElement(out)); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;select;;;Element of Argument[0];Element of ReturnValue;value"
Collection out = null; Collection out = null;
Iterable in = newVectorWithElement((String)source()); Iterable in = newVectorWithElement((String)source());
out = CollectionUtils.select(in, null); out = CollectionUtils.select(in, null);
sink(getElement(out)); // $ hasValueFlow sink(getElement(out)); // $ hasValueFlow
} }
{ {
// "org.apache.commons.collections4;CollectionUtils;true;selectRejected;;;Element of Argument[0];Element of Argument[2];value" // "org.apache.commons.collections4;CollectionUtils;true;select;(Iterable,Predicate,Collection);;Argument[2];ReturnValue;value"
Collection out = null;
Collection in = (Collection)source();
out = CollectionUtils.select(null, null, in);
sink(out); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;select;(Iterable,Predicate,Collection);;Element of Argument[0];Element of Argument[2];value"
Collection out = null; Collection out = null;
Iterable in = newVectorWithElement((String)source()); Iterable in = newVectorWithElement((String)source());
CollectionUtils.selectRejected(in, null, out); CollectionUtils.select(in, null, out);
sink(getElement(out)); // $ hasValueFlow sink(getElement(out)); // $ hasValueFlow
} }
{ {
// "org.apache.commons.collections4;CollectionUtils;true;selectRejected;;;Element of Argument[0];Element of ReturnValue;value" Collection mid = null;
Collection out = null; Collection out = null;
Iterable in = newVectorWithElement((String)source()); Iterable in = newVectorWithElement((String)source());
out = CollectionUtils.selectRejected(in, null, null); out = CollectionUtils.select(in, null, mid);
sink(getElement(out)); // $ hasValueFlow sink(getElement(out)); // $ hasValueFlow
} }
{ {
// "org.apache.commons.collections4;CollectionUtils;true;selectRejected;;;Element of Argument[0];Element of ReturnValue;value" // "org.apache.commons.collections4;CollectionUtils;true;select;(Iterable,Predicate,Collection,Collection);;Argument[2];ReturnValue;value"
Collection out = null;
Collection in = (Collection)source();
out = CollectionUtils.select(null, null, in, null);
sink(out); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;select;(Iterable,Predicate,Collection,Collection);;Element of Argument[0];Element of Argument[2];value"
Collection out = null;
Iterable in = newVectorWithElement((String)source());
CollectionUtils.select(in, null, out, null);
sink(getElement(out)); // $ hasValueFlow
}
{
Collection mid = null;
Collection out = null;
Iterable in = newVectorWithElement((String)source());
out = CollectionUtils.select(in, null, mid, null);
sink(getElement(out)); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;select;(Iterable,Predicate,Collection,Collection);;Element of Argument[0];Element of Argument[3];value"
Collection out = null;
Iterable in = newVectorWithElement((String)source());
CollectionUtils.select(in, null, null, out);
sink(getElement(out)); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;selectRejected;(Iterable,Predicate);;Element of Argument[0];Element of ReturnValue;value"
Collection out = null; Collection out = null;
Iterable in = newVectorWithElement((String)source()); Iterable in = newVectorWithElement((String)source());
out = CollectionUtils.selectRejected(in, null); out = CollectionUtils.selectRejected(in, null);
sink(getElement(out)); // $ hasValueFlow sink(getElement(out)); // $ hasValueFlow
} }
{
// "org.apache.commons.collections4;CollectionUtils;true;selectRejected;(Iterable,Predicate,Collection);;Argument[2];ReturnValue;value"
Collection out = null;
Collection in = (Collection)source();
out = CollectionUtils.selectRejected(null, null, in);
sink(out); // $ hasValueFlow
}
{
// "org.apache.commons.collections4;CollectionUtils;true;selectRejected;(Iterable,Predicate,Collection);;Element of Argument[0];Element of Argument[2];value"
Collection out = null;
Iterable in = newVectorWithElement((String)source());
CollectionUtils.selectRejected(in, null, out);
sink(getElement(out)); // $ hasValueFlow
}
{ {
// "org.apache.commons.collections4;CollectionUtils;true;subtract;;;Element of Argument[0];Element of ReturnValue;value" // "org.apache.commons.collections4;CollectionUtils;true;subtract;;;Element of Argument[0];Element of ReturnValue;value"
Collection out = null; Collection out = null;
@@ -2088,6 +2102,13 @@ public class Test {
out = IterableUtils.first(in); out = IterableUtils.first(in);
sink(out); // $ hasValueFlow sink(out); // $ hasValueFlow
} }
{
// "org.apache.commons.collections4;IterableUtils;true;forEachButLast;;;Element of Argument[0];ReturnValue;value"
Object out = null;
Iterable in = newVectorWithElement((String)source());
out = IterableUtils.forEachButLast(in, null);
sink(out); // $ hasValueFlow
}
{ {
// "org.apache.commons.collections4;IterableUtils;true;get;;;Element of Argument[0];ReturnValue;value" // "org.apache.commons.collections4;IterableUtils;true;get;;;Element of Argument[0];ReturnValue;value"
Object out = null; Object out = null;
@@ -2424,6 +2445,13 @@ public class Test {
out = IteratorUtils.first(in); out = IteratorUtils.first(in);
sink(out); // $ hasValueFlow sink(out); // $ hasValueFlow
} }
{
// "org.apache.commons.collections4;IteratorUtils;true;forEachButLast;;;Element of Argument[0];ReturnValue;value"
Object out = null;
Iterator in = newListIteratorWithElement((String)source());
out = IteratorUtils.forEachButLast(in, null);
sink(out); // $ hasValueFlow
}
{ {
// "org.apache.commons.collections4;IteratorUtils;true;get;;;Element of Argument[0];ReturnValue;value" // "org.apache.commons.collections4;IteratorUtils;true;get;;;Element of Argument[0];ReturnValue;value"
Object out = null; Object out = null;
@@ -2936,21 +2964,21 @@ public class Test {
sink(getElement(out)); // $ hasValueFlow sink(getElement(out)); // $ hasValueFlow
} }
{ {
// "org.apache.commons.collections4;MultiMapUtils;true;getValuesAsBag;;;MapValue of Argument[0];ReturnValue;value" // "org.apache.commons.collections4;MultiMapUtils;true;getValuesAsBag;;;Element of MapValue of Argument[0];Element of ReturnValue;value"
Bag out = null; Bag out = null;
MultiValuedMap in = newALVHMWithMapValue((String)source()); MultiValuedMap in = newALVHMWithMapValue((String)source());
out = MultiMapUtils.getValuesAsBag(in, null); out = MultiMapUtils.getValuesAsBag(in, null);
sink(getElement(out)); // $ hasValueFlow sink(getElement(out)); // $ hasValueFlow
} }
{ {
// "org.apache.commons.collections4;MultiMapUtils;true;getValuesAsList;;;MapValue of Argument[0];ReturnValue;value" // "org.apache.commons.collections4;MultiMapUtils;true;getValuesAsList;;;Element of MapValue of Argument[0];Element of ReturnValue;value"
List out = null; List out = null;
MultiValuedMap in = newALVHMWithMapValue((String)source()); MultiValuedMap in = newALVHMWithMapValue((String)source());
out = MultiMapUtils.getValuesAsList(in, null); out = MultiMapUtils.getValuesAsList(in, null);
sink(getElement(out)); // $ hasValueFlow sink(getElement(out)); // $ hasValueFlow
} }
{ {
// "org.apache.commons.collections4;MultiMapUtils;true;getValuesAsSet;;;MapValue of Argument[0];ReturnValue;value" // "org.apache.commons.collections4;MultiMapUtils;true;getValuesAsSet;;;Element of MapValue of Argument[0];Element of ReturnValue;value"
Set out = null; Set out = null;
MultiValuedMap in = newALVHMWithMapValue((String)source()); MultiValuedMap in = newALVHMWithMapValue((String)source());
out = MultiMapUtils.getValuesAsSet(in, null); out = MultiMapUtils.getValuesAsSet(in, null);