Skip to content

Commit 207c753

Browse files
Update model for getAll
1 parent 227818a commit 207c753

File tree

2 files changed

+4
-5
lines changed
  • java/ql
    • src/semmle/code/java/frameworks/guava
    • test/library-tests/frameworks/guava/generated/cache

2 files changed

+4
-5
lines changed

java/ql/src/semmle/code/java/frameworks/guava/Cache.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private class GuavaBaseCsv extends SummaryModelCsv {
2121
"com.google.common.cache;LoadingCache;true;get;(Object);;MapValue of Argument[-1];ReturnValue;value",
2222
"com.google.common.cache;LoadingCache;true;getUnchecked;(Object);;MapValue of Argument[-1];ReturnValue;value",
2323
"com.google.common.cache;LoadingCache;true;apply;(Object);;MapValue of Argument[-1];ReturnValue;value",
24-
"com.google.common.cache;LoadingCache;true;getAll;(Iterable);;Element of Argument[0];MapKey of ReturnValue;value",
24+
"com.google.common.cache;LoadingCache;true;getAll;(Iterable);;MapKey of Argument[-1];MapKey of ReturnValue;value", // technically, an interestion between MapKey of Argument[-1] and Element of Argument[0]; but we don't model intersections.
2525
"com.google.common.cache;LoadingCache;true;getAll;(Iterable);;MapValue of Argument[-1];MapValue of ReturnValue;value"
2626
]
2727
}

java/ql/test/library-tests/frameworks/guava/generated/cache/Test.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,10 @@ public void test() throws Exception {
139139
sink(out); // $ hasValueFlow
140140
}
141141
{
142-
// "com.google.common.cache;LoadingCache;true;getAll;(Iterable);;Element of Argument[0];MapKey of ReturnValue;value"
142+
// "com.google.common.cache;LoadingCache;true;getAll;(Iterable);;MapKey of Argument[-1];MapKey of ReturnValue;value"
143143
ImmutableMap out = null;
144-
Iterable in = newWithElement(source());
145-
LoadingCache instance = null;
146-
out = instance.getAll(in);
144+
LoadingCache in = newCacheWithMapKey(source());
145+
out = in.getAll(null);
147146
sink(getMapKey(out)); // $ hasValueFlow
148147
}
149148
{

0 commit comments

Comments
 (0)