File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed
src/semmle/code/java/frameworks/guava
library-tests/frameworks/guava
stubs/guava-30.0/com/google/common/base Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change
1
+ lgtm,codescanning
2
+ * Increase coverage of the Guava framework by adding support for ` com.google.common.base.MoreObjects#firstNonNull ` .
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ private class GuavaBaseCsv extends SummaryModelCsv {
35
35
"com.google.common.base;Splitter;false;splitToList;(CharSequence);;Argument[0];ReturnValue;taint" ,
36
36
"com.google.common.base;Splitter;false;splitToStream;(CharSequence);;Argument[0];ReturnValue;taint" ,
37
37
"com.google.common.base;Splitter$MapSplitter;false;split;(CharSequence);;Argument[0];ReturnValue;taint" ,
38
- "com.google.common.base;Preconditions;false;checkNotNull;;;Argument[0];ReturnValue;value"
38
+ "com.google.common.base;Preconditions;false;checkNotNull;;;Argument[0];ReturnValue;value" ,
39
+ "com.google.common.base;MoreObjects;false;firstNonNull;;;Argument[0..1];ReturnValue;value"
39
40
]
40
41
}
41
42
}
Original file line number Diff line number Diff line change @@ -60,4 +60,10 @@ void test3() {
60
60
void test4 () {
61
61
sink (Preconditions .checkNotNull (taint ())); // $numTaintFlow=1
62
62
}
63
+
64
+ void test5 () {
65
+ sink (MoreObjects .firstNonNull (taint (), taint ())); // $numTaintFlow=2
66
+ sink (MoreObjects .firstNonNull (null , taint ())); // $numTaintFlow=1
67
+ sink (MoreObjects .firstNonNull (taint (), null )); // $numTaintFlow=1
68
+ }
63
69
}
Original file line number Diff line number Diff line change
1
+ package com .google .common .base ;
2
+
3
+ import org .checkerframework .checker .nullness .qual .Nullable ;
4
+
5
+ public final class MoreObjects {
6
+ public static <T > T firstNonNull (@ Nullable T first , @ Nullable T second ) {
7
+ return null ;
8
+ }
9
+ }
You can’t perform that action at this time.
0 commit comments