Skip to content

Commit 1eacbd8

Browse files
Fix up some incorrect models; simplify/remove some redundand ones
1 parent a89bd32 commit 1eacbd8

File tree

1 file changed

+20
-38
lines changed

1 file changed

+20
-38
lines changed

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

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ private class GuavaCollectCsv extends SummaryModelCsv {
7272
// Misc collections and utilities
7373
"com.google.common.collect;ImmutableCollection;true;asList;();;Element of Argument[-1];Element of ReturnValue;value",
7474
"com.google.common.collect;ImmutableList;true;reverse;();;Element of Argument[-1];Element of ReturnValue;value",
75-
"com.google.common.collect;ImmutableList;true;subList;(int,int);;Element of Argument[-1];Element of ReturnValue;value",
7675
"com.google.common.collect;BiMap;true;forcePut;(Object,Object);;Argument[0];MapKey of Argument[-1];value",
7776
"com.google.common.collect;BiMap;true;forcePut;(Object,Object);;Argument[1];MapValue of Argument[-1];value",
7877
"com.google.common.collect;BiMap;true;inverse;();;MapKey of Argument[-1];MapValue of ReturnValue;value",
@@ -90,6 +89,7 @@ private class GuavaCollectCsv extends SummaryModelCsv {
9089
"com.google.common.collect;ImmutableCollection$Builder;true;addAll;(Iterator);;Element of Argument[0];Element of Argument[-1];value",
9190
"com.google.common.collect;ImmutableMultiset$Builder;true;addCopies;(Object,int);;Argument[-1];ReturnValue;value",
9291
"com.google.common.collect;ImmutableMultiset$Builder;true;addCopies;(Object,int);;Argument[0];Element of Argument[-1];value",
92+
"com.google.common.collect;ImmutableMultiset$Builder;true;setCount;(Object,int);;Argument[0];Element of Argument[-1];value",
9393
"com.google.common.collect;ImmutableMap$Builder;true;build;();;MapKey of Argument[-1];MapKey of ReturnValue;value",
9494
"com.google.common.collect;ImmutableMap$Builder;true;build;();;MapValue of Argument[-1];MapValue of ReturnValue;value",
9595
"com.google.common.collect;ImmutableMap$Builder;true;orderEntriesByValue;(Comparator);;Argument[-1];ReturnValue;value",
@@ -117,9 +117,8 @@ private class GuavaCollectCsv extends SummaryModelCsv {
117117
"com.google.common.collect;ImmutableMultimap$Builder;true;putAll;(Iterable);;MapValue of Element of Argument[0];MapValue of Argument[-1];value",
118118
"com.google.common.collect;ImmutableMultimap$Builder;true;putAll;(Multimap);;MapKey of Argument[0];MapKey of Argument[-1];value",
119119
"com.google.common.collect;ImmutableMultimap$Builder;true;putAll;(Multimap);;MapValue of Argument[0];MapValue of Argument[-1];value",
120-
"com.google.common.collect;ImmutableMultimap$Builder;true;putAll;(Object,Iterable);;Argument[0];MapKey of Argument[-1];value",
120+
"com.google.common.collect;ImmutableMultimap$Builder;true;putAll;;;Argument[0];MapKey of Argument[-1];value",
121121
"com.google.common.collect;ImmutableMultimap$Builder;true;putAll;(Object,Iterable);;Element of Argument[1];MapValue of Argument[-1];value",
122-
"com.google.common.collect;ImmutableMultimap$Builder;true;putAll;(Object,Iterable);;Argument[0];MapKey of Argument[-1];value",
123122
"com.google.common.collect;ImmutableMultimap$Builder;true;putAll;(Object,Object[]);;ArrayElement of Argument[1];MapValue of Argument[-1];value",
124123
"com.google.common.collect;ImmutableTable$Builder;true;build;();;SyntheticField[com.google.common.collect.Table.rowKey] of Argument[-1];SyntheticField[com.google.common.collect.Table.rowKey] of ReturnValue;value",
125124
"com.google.common.collect;ImmutableTable$Builder;true;build;();;SyntheticField[com.google.common.collect.Table.columnKey] of Argument[-1];SyntheticField[com.google.common.collect.Table.columnKey] of ReturnValue;value",
@@ -264,9 +263,9 @@ private class GuavaCollectCsv extends SummaryModelCsv {
264263
"com.google.common.collect;ArrayTable;true;create;(Iterable,Iterable);;Element of Argument[1];SyntheticField[com.google.common.collect.Table.columnKey] of ReturnValue;value",
265264
// Utility classes (a few methods depending on lambda flow are not included)
266265
"com.google.common.collect;Collections2;false;filter;(Collection,Predicate);;Element of Argument[0];Element of ReturnValue;value",
267-
"com.google.common.collect;Collections2;false;orderedPermutations;(Iterable,Comparator);;Element of Argument[0];Element of ReturnValue;value",
268-
"com.google.common.collect;Collections2;false;orderedPermutations;(Iterable);;Element of Argument[0];Element of ReturnValue;value",
269-
"com.google.common.collect;Collections2;false;permutations;(Collection);;Element of Argument[0];Element of ReturnValue;value",
266+
"com.google.common.collect;Collections2;false;orderedPermutations;(Iterable,Comparator);;Element of Argument[0];Element of Element of ReturnValue;value",
267+
"com.google.common.collect;Collections2;false;orderedPermutations;(Iterable);;Element of Argument[0];Element of Element of ReturnValue;value",
268+
"com.google.common.collect;Collections2;false;permutations;(Collection);;Element of Argument[0];Element of Element of ReturnValue;value",
270269
"com.google.common.collect;Iterators;false;addAll;(Collection,Iterator);;Element of Argument[1];Element of Argument[0];value",
271270
"com.google.common.collect;Iterators;false;asEnumeration;(Iterator);;Element of Argument[0];Element of ReturnValue;value",
272271
"com.google.common.collect;Iterators;false;concat;(Iterator);;Element of Element of Argument[0];Element of ReturnValue;value",
@@ -297,14 +296,14 @@ private class GuavaCollectCsv extends SummaryModelCsv {
297296
"com.google.common.collect;Iterators;false;getOnlyElement;(Iterator,Object);;Argument[1];ReturnValue;value",
298297
"com.google.common.collect;Iterators;false;limit;(Iterator,int);;Element of Argument[0];Element of ReturnValue;value",
299298
"com.google.common.collect;Iterators;false;mergeSorted;(Iterable,Comparator);;Element of Element of Argument[0];Element of ReturnValue;value",
300-
"com.google.common.collect;Iterators;false;partition;(Iterator,int);;Element of Element of Argument[0];Element of ReturnValue;value",
301-
"com.google.common.collect;Iterators;false;paddedPartition;(Iterator,int);;Element of Element of Argument[0];Element of ReturnValue;value",
299+
"com.google.common.collect;Iterators;false;partition;(Iterator,int);;Element of Argument[0];Element of Element of ReturnValue;value",
300+
"com.google.common.collect;Iterators;false;paddedPartition;(Iterator,int);;Element of Argument[0];Element of Element of ReturnValue;value",
302301
"com.google.common.collect;Iterators;false;peekingIterator;(Iterator);;Element of Argument[0];Element of ReturnValue;value",
303302
"com.google.common.collect;Iterators;false;peekingIterator;(PeekingIterator);;Element of Argument[0];Element of ReturnValue;value",
304303
"com.google.common.collect;Iterators;false;singletonIterator;(Object);;Argument[0];Element of ReturnValue;value",
305304
"com.google.common.collect;Iterators;false;toArray;(Iterator,Class);;Element of Argument[0];ArrayElement of ReturnValue;value",
306305
"com.google.common.collect;Iterators;false;tryFind;(Iterator,Predicate);;Element of Argument[0];Element of ReturnValue;value",
307-
"com.google.common.collect;Iterators;false;toString;(Iterator);;Element of Argument[0];ReturnValue;taint",
306+
// "com.google.common.collect;Iterators;false;toString;(Iterator);;Element of Argument[0];ReturnValue;taint",
308307
"com.google.common.collect;Iterators;false;unmodifiableIterator;(Iterator);;Element of Argument[0];Element of ReturnValue;value",
309308
"com.google.common.collect;Iterators;false;unmodifiableIterator;(UnmodifiableIterator);;Element of Argument[0];Element of ReturnValue;value",
310309
"com.google.common.collect;Iterables;false;addAll;(Collection,Iterable);;Element of Argument[1];Element of Argument[0];value",
@@ -332,8 +331,8 @@ private class GuavaCollectCsv extends SummaryModelCsv {
332331
"com.google.common.collect;Iterables;false;getOnlyElement;(Iterable,Object);;Argument[1];ReturnValue;value",
333332
"com.google.common.collect;Iterables;false;limit;(Iterable,int);;Element of Argument[0];Element of ReturnValue;value",
334333
"com.google.common.collect;Iterables;false;mergeSorted;(Iterable,Comparator);;Element of Element of Argument[0];Element of ReturnValue;value",
335-
"com.google.common.collect;Iterables;false;partition;(Iterable,int);;Element of Element of Argument[0];Element of ReturnValue;value",
336-
"com.google.common.collect;Iterables;false;paddedPartition;(Iterable,int);;Element of Element of Argument[0];Element of ReturnValue;value",
334+
"com.google.common.collect;Iterables;false;partition;(Iterable,int);;Element of Argument[0];Element of Element of ReturnValue;value",
335+
"com.google.common.collect;Iterables;false;paddedPartition;(Iterable,int);;Element of Argument[0];Element of Element of ReturnValue;value",
337336
"com.google.common.collect;Iterables;false;skip;(Iterable,int);;Element of Argument[0];Element of ReturnValue;value",
338337
"com.google.common.collect;Iterables;false;toArray;(Iterable,Class);;Element of Argument[0];ArrayElement of ReturnValue;value",
339338
"com.google.common.collect;Iterables;false;tryFind;(Iterable,Predicate);;Element of Argument[0];Element of ReturnValue;value",
@@ -370,34 +369,15 @@ private class GuavaCollectCsv extends SummaryModelCsv {
370369
"com.google.common.collect;Maps;false;difference;(SortedMap,Map);;MapValue of Argument[0];MapValue of SyntheticField[com.google.common.collect.MapDifference.left] of ReturnValue;value",
371370
"com.google.common.collect;Maps;false;difference;(SortedMap,Map);;MapKey of Argument[1];MapKey of SyntheticField[com.google.common.collect.MapDifference.right] of ReturnValue;value",
372371
"com.google.common.collect;Maps;false;difference;(SortedMap,Map);;MapValue of Argument[1];MapValue of SyntheticField[com.google.common.collect.MapDifference.right] of ReturnValue;value",
373-
"com.google.common.collect;Maps;false;filterEntries;(Map,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
374-
"com.google.common.collect;Maps;false;filterEntries;(Map,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
375-
"com.google.common.collect;Maps;false;filterEntries;(BiMap,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
376-
"com.google.common.collect;Maps;false;filterEntries;(BiMap,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
377-
"com.google.common.collect;Maps;false;filterEntries;(NavigableMap,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
378-
"com.google.common.collect;Maps;false;filterEntries;(NavigableMap,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
379-
"com.google.common.collect;Maps;false;filterEntries;(SortedMap,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
380-
"com.google.common.collect;Maps;false;filterEntries;(SortedMap,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
381-
"com.google.common.collect;Maps;false;filterKeys;(Map,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
382-
"com.google.common.collect;Maps;false;filterKeys;(Map,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
383-
"com.google.common.collect;Maps;false;filterKeys;(BiMap,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
384-
"com.google.common.collect;Maps;false;filterKeys;(BiMap,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
385-
"com.google.common.collect;Maps;false;filterKeys;(NavigableMap,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
386-
"com.google.common.collect;Maps;false;filterKeys;(NavigableMap,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
387-
"com.google.common.collect;Maps;false;filterKeys;(SortedMap,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
388-
"com.google.common.collect;Maps;false;filterKeys;(SortedMap,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
389-
"com.google.common.collect;Maps;false;filterValues;(Map,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
390-
"com.google.common.collect;Maps;false;filterValues;(Map,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
391-
"com.google.common.collect;Maps;false;filterValues;(BiMap,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
392-
"com.google.common.collect;Maps;false;filterValues;(BiMap,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
393-
"com.google.common.collect;Maps;false;filterValues;(NavigableMap,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
394-
"com.google.common.collect;Maps;false;filterValues;(NavigableMap,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
395-
"com.google.common.collect;Maps;false;filterValues;(SortedMap,Predicate);;MapKey of Argument[0];MapKey of ReturnValue;value",
396-
"com.google.common.collect;Maps;false;filterValues;(SortedMap,Predicate);;MapValue of Argument[0];MapValue of ReturnValue;value",
372+
"com.google.common.collect;Maps;false;filterEntries;;;MapKey of Argument[0];MapKey of ReturnValue;value",
373+
"com.google.common.collect;Maps;false;filterKeys;;;MapKey of Argument[0];MapKey of ReturnValue;value",
374+
"com.google.common.collect;Maps;false;filterValues;;;MapKey of Argument[0];MapKey of ReturnValue;value",
397375
"com.google.common.collect;Maps;false;fromProperties;(Properties);;MapKey of Argument[0];MapKey of ReturnValue;value",
398376
"com.google.common.collect;Maps;false;fromProperties;(Properties);;MapValue of Argument[0];MapValue of ReturnValue;value",
399377
"com.google.common.collect;Maps;false;immutableEntry;(Object,Object);;Argument[0];MapKey of ReturnValue;value",
400378
"com.google.common.collect;Maps;false;immutableEntry;(Object,Object);;Argument[1];MapValue of ReturnValue;value",
379+
"com.google.common.collect;Maps;false;immutableEnumMap;(Map);;MapValue of Argument[0];MapValue of ReturnValue;value",
380+
"com.google.common.collect;Maps;false;newEnumMap;(Map);;MapValue of Argument[0];MapValue of ReturnValue;value",
401381
"com.google.common.collect;Maps;false;newHashMap;(Map);;MapKey of Argument[0];MapKey of ReturnValue;value",
402382
"com.google.common.collect;Maps;false;newHashMap;(Map);;MapValue of Argument[0];MapValue of ReturnValue;value",
403383
"com.google.common.collect;Maps;false;newLinkedHashMap;(Map);;MapKey of Argument[0];MapKey of ReturnValue;value",
@@ -454,6 +434,7 @@ private class GuavaCollectCsv extends SummaryModelCsv {
454434
"com.google.common.collect;Sets;false;filter;(NavigableSet,Predicate);;Element of Argument[0];Element of ReturnValue;value",
455435
"com.google.common.collect;Sets;false;filter;(Set,Predicate);;Element of Argument[0];Element of ReturnValue;value",
456436
"com.google.common.collect;Sets;false;filter;(SortedSet,Predicate);;Element of Argument[0];Element of ReturnValue;value",
437+
"com.google.common.collect;Sets;false;intersection;(Set,Set);;Element of Argument[0..1];Element of ReturnValue;value",
457438
"com.google.common.collect;Sets;false;newConcurrentHashSet;(Iterable);;Element of Argument[0];Element of ReturnValue;value",
458439
"com.google.common.collect;Sets;false;newCopyOnWriteArraySet;(Iterable);;Element of Argument[0];Element of ReturnValue;value",
459440
"com.google.common.collect;Sets;false;newConcurrentHashSet;(Iterable);;Element of Argument[0];Element of ReturnValue;value",
@@ -473,6 +454,7 @@ private class GuavaCollectCsv extends SummaryModelCsv {
473454
"com.google.common.collect;Multisets;false;difference;(Multiset,Multiset);;Element of Argument[0];Element of ReturnValue;value",
474455
"com.google.common.collect;Multisets;false;filter;(Multiset,Predicate);;Element of Argument[0];Element of ReturnValue;value",
475456
"com.google.common.collect;Multisets;false;immutableEntry;(Object,int);;Argument[0];Element of ReturnValue;value",
457+
"com.google.common.collect;Mulisets;false;intersection;(Muliset,Muliset);;Element of Argument[0..1];Element of ReturnValue;value",
476458
"com.google.common.collect;Multisets;false;sum;(Multiset,Multiset);;Element of Argument[0..1];Element of ReturnValue;value",
477459
"com.google.common.collect;Multisets;false;union;(Multiset,Multiset);;Element of Argument[0..1];Element of ReturnValue;value",
478460
"com.google.common.collect;Multisets;false;unmodifiableMultiset;(Multiset);;Element of Argument[0];Element of ReturnValue;value",
@@ -502,8 +484,9 @@ private class GuavaCollectCsv extends SummaryModelCsv {
502484
"com.google.common.collect;Multimaps;false;forMap;(Map);;MapValue of Argument[0];MapValue of ReturnValue;value",
503485
"com.google.common.collect;Multimaps;false;index;(Iterable,Function);;Element of Argument[0];MapValue of ReturnValue;value",
504486
"com.google.common.collect;Multimaps;false;index;(Iterator,Function);;Element of Argument[0];MapValue of ReturnValue;value",
505-
"com.google.common.collect;Multimaps;false;invertFrom;(Multimap,Multimap);;MapKey of Argument[0];MapValue of ReturnValue;value",
506-
"com.google.common.collect;Multimaps;false;invertFrom;(Multimap,Multimap);;MapValue of Argument[0];MapKey of ReturnValue;value",
487+
"com.google.common.collect;Multimaps;false;invertFrom;(Multimap,Multimap);;MapKey of Argument[0];MapValue of Argument[1];value",
488+
"com.google.common.collect;Multimaps;false;invertFrom;(Multimap,Multimap);;MapValue of Argument[0];MapKey of Argument[1];value",
489+
"com.google.common.collect;Multimaps;false;invertFrom;(Multimap,Multimap);;Argument[1];ReturnValue;value",
507490
"com.google.common.collect;Multimaps;false;newMultimap;(Map,Supplier);;MapKey of Argument[0];MapKey of ReturnValue;value",
508491
"com.google.common.collect;Multimaps;false;newMultimap;(Map,Supplier);;Element of MapValue of Argument[0];MapValue of ReturnValue;value",
509492
"com.google.common.collect;Multimaps;false;newListMultimap;(Map,Supplier);;MapKey of Argument[0];MapKey of ReturnValue;value",
@@ -547,7 +530,6 @@ private class GuavaCollectCsv extends SummaryModelCsv {
547530
"com.google.common.collect;Tables;false;transpose;(Table);;MapValue of Argument[0];MapValue of ReturnValue;value",
548531
"com.google.common.collect;Tables;false;transformValues;(Table,Function);;SyntheticField[com.google.common.collect.Table.rowKey] of Argument[0];SyntheticField[com.google.common.collect.Table.rowKey] of ReturnValue;value",
549532
"com.google.common.collect;Tables;false;transformValues;(Table,Function);;SyntheticField[com.google.common.collect.Table.columnKey] of Argument[0];SyntheticField[com.google.common.collect.Table.columnKey] of ReturnValue;value",
550-
"com.google.common.collect;Tables;false;transformValues;(Table,Function);;MapValue of Argument[0];MapValue of ReturnValue;value",
551533
"com.google.common.collect;Tables;false;synchronizedTable;(Table);;SyntheticField[com.google.common.collect.Table.rowKey] of Argument[0];SyntheticField[com.google.common.collect.Table.rowKey] of ReturnValue;value",
552534
"com.google.common.collect;Tables;false;synchronizedTable;(Table);;SyntheticField[com.google.common.collect.Table.columnKey] of Argument[0];SyntheticField[com.google.common.collect.Table.columnKey] of ReturnValue;value",
553535
"com.google.common.collect;Tables;false;synchronizedTable;(Table);;MapValue of Argument[0];MapValue of ReturnValue;value",

0 commit comments

Comments
 (0)