From ea530390d3f76911602e8dfe99d615cf71e53b37 Mon Sep 17 00:00:00 2001 From: Boris Valkov Date: Tue, 12 Feb 2019 10:28:01 -0800 Subject: [PATCH] [nullsafe][android] warn when passing null to ImmutableList, ImmutableSet, and ImmutableMap Reviewed By: jeremydubreil Differential Revision: D13933976 fbshipit-source-id: 771fc985c --- infer/bin/inferTraceBugs | 1 - infer/src/nullsafe/modelTables.ml | 138 +++++++++++++++++- .../java/eradicate/ParameterNotNullable.java | 71 +++++++++ .../codetoanalyze/java/eradicate/issues.exp | 44 ++++-- 4 files changed, 240 insertions(+), 14 deletions(-) delete mode 120000 infer/bin/inferTraceBugs diff --git a/infer/bin/inferTraceBugs b/infer/bin/inferTraceBugs deleted file mode 120000 index a602e4d98..000000000 --- a/infer/bin/inferTraceBugs +++ /dev/null @@ -1 +0,0 @@ -../lib/python/inferTraceBugs \ No newline at end of file diff --git a/infer/src/nullsafe/modelTables.ml b/infer/src/nullsafe/modelTables.ml index 42d7fb336..030f7962a 100644 --- a/infer/src/nullsafe/modelTables.ml +++ b/infer/src/nullsafe/modelTables.ml @@ -21,14 +21,47 @@ let o = false and n = true +(* create unannotated signature with n argument *) +let unannotated n = + let rec loop l = function i when i <= 0 -> (o, l) | i -> loop (o :: l) (i - 1) in + loop [] n + + (* not annotated with one unannotated argument *) -let o1 = (o, [o]) +let o1 = unannotated 1 (* not annotated with two unannotated arguments *) -let o2 = (o, [o; o]) +let o2 = unannotated 2 (* not annotated with three unannotated arguments *) -let o3 = (o, [o; o; o]) +let o3 = unannotated 3 + +(* not annotated with four unannotated arguments *) +let o4 = unannotated 4 + +(* not annotated with five unannotated arguments *) +let o5 = unannotated 5 + +(* not annotated with six unannotated arguments *) +let o6 = unannotated 6 + +(* not annotated with seven unannotated arguments *) +let o7 = unannotated 7 + +(* not annotated with eight unannotated arguments *) +let o8 = unannotated 8 + +(* not annotated with nine unannotated arguments *) +let o9 = unannotated 9 + +(* not annotated with ten unannotated arguments *) +let o10 = unannotated 10 + +(* not annotated with eleven unannotated arguments *) +let o11 = unannotated 11 + +(* not annotated with twelve unannotated arguments *) +let o12 = unannotated 12 (* one argument nullable *) let n1 = (o, [n]) @@ -216,9 +249,108 @@ let annotated_list_nullable = ; ( o1 , "com.google.common.collect.ImmutableList$Builder.addAll(java.lang.Iterable):com.google.common.collect.ImmutableList$Builder" ) + ; ( o1 + , "com.google.common.collect.ImmutableList.of(java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o2 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o3 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o4 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o5 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o6 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o7 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o8 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o9 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o10 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o11 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o12 + , "com.google.common.collect.ImmutableList.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o1 + , "com.google.common.collect.ImmutableList.copyOf(java.lang.Iterable):com.google.common.collect.ImmutableList" + ) + ; ( o1 + , "com.google.common.collect.ImmutableList.copyOf(java.util.Collection):com.google.common.collect.ImmutableList" + ) + ; ( o1 + , "com.google.common.collect.ImmutableList.copyOf(java.util.Iterator):com.google.common.collect.ImmutableList" + ) + ; ( o1 + , "com.google.common.collect.ImmutableList.copyOf(java.lang.Object):com.google.common.collect.ImmutableList" + ) + ; ( o2 + , "com.google.common.collect.ImmutableList.sortedCopyOf(java.util.Comparator,java.lang.Iterable):com.google.common.collect.ImmutableList" + ) + ; ( o1 + , "com.google.common.collect.ImmutableSet.of(java.lang.Object):com.google.common.collect.ImmutableSet" + ) + ; ( o2 + , "com.google.common.collect.ImmutableSet.of(java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableSet" + ) + ; ( o3 + , "com.google.common.collect.ImmutableSet.of(java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableSet" + ) + ; ( o4 + , "com.google.common.collect.ImmutableSet.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableSet" + ) + ; ( o5 + , "com.google.common.collect.ImmutableSet.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableSet" + ) + ; ( o1 + , "com.google.common.collect.ImmutableSet.copyOf(java.lang.Iterable):com.google.common.collect.ImmutableSet" + ) + ; ( o1 + , "com.google.common.collect.ImmutableSet.copyOf(java.util.Collection):com.google.common.collect.ImmutableSet" + ) + ; ( o1 + , "com.google.common.collect.ImmutableSet.copyOf(java.util.Iterator):com.google.common.collect.ImmutableSet" + ) + ; ( o1 + , "com.google.common.collect.ImmutableSet.copyOf(java.lang.Object):com.google.common.collect.ImmutableSet" + ) ; ( o1 , "com.google.common.collect.ImmutableSortedSet$Builder.add(java.lang.Object):com.google.common.collect.ImmutableSortedSet$Builder" ) + ; ( o2 + , "com.google.common.collect.ImmutableMap.of(java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableMap" + ) + ; ( o4 + , "com.google.common.collect.ImmutableMap.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableMap" + ) + ; ( o6 + , "com.google.common.collect.ImmutableMap.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableMap" + ) + ; ( o8 + , "com.google.common.collect.ImmutableMap.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableMap" + ) + ; ( o10 + , "com.google.common.collect.ImmutableMap.of(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object):com.google.common.collect.ImmutableMap" + ) + ; ( o1 + , "com.google.common.collect.ImmutableMap.copyOf(java.util.Map):com.google.common.collect.ImmutableMap" + ) + ; ( o1 + , "com.google.common.collect.ImmutableMap.copyOf(java.lang.Iterable):com.google.common.collect.ImmutableMap" + ) ; ( on , "com.google.common.collect.Iterables.getFirst(java.lang.Iterable,java.lang.Object):java.lang.Object" ) diff --git a/infer/tests/codetoanalyze/java/eradicate/ParameterNotNullable.java b/infer/tests/codetoanalyze/java/eradicate/ParameterNotNullable.java index 4506a18c1..75ae8a21c 100644 --- a/infer/tests/codetoanalyze/java/eradicate/ParameterNotNullable.java +++ b/infer/tests/codetoanalyze/java/eradicate/ParameterNotNullable.java @@ -8,7 +8,13 @@ package codetoanalyze.java.eradicate; import android.annotation.SuppressLint; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; import java.net.URL; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; import javax.annotation.Nullable; public class ParameterNotNullable { @@ -109,6 +115,71 @@ public class ParameterNotNullable { void callWithConditionalAssignment(Object object, boolean test) { doesNotAcceptNullableFirstParameter(test ? object : null, test); } + + void testImmutableListOfnotNullArguments() { + + Object notNull = new Object(); + + ImmutableList.of(null); + ImmutableList.of(null, null); + ImmutableList.of(notNull, notNull); + ImmutableList.of(notNull, null); + } + + void testImmutableListCopyOfNotNullArguments() { + + Iterable nullIterable = null; + Iterator nullIterator = null; + Collection nullCollection = null; + + ImmutableList.copyOf(nullIterable); + ImmutableList.copyOf(nullIterator); + ImmutableList.copyOf(nullCollection); + } + + void testImmutableListSortedCopyOfNotNullArguments() { + ImmutableList.sortedCopyOf(null, null); + } + + void testImmutableSetOfnotNullArguments() { + + Object notNull = new Object(); + + ImmutableSet.of(null); + ImmutableSet.of(null, null); + ImmutableSet.of(notNull, notNull); + ImmutableSet.of(notNull, null); + ImmutableSet.of(notNull, null, notNull, null, notNull); + } + + void testImmutableSetCopyOfNotNullArguments() { + + Iterable nullIterable = null; + Iterator nullIterator = null; + Collection nullCollection = null; + + ImmutableSet.copyOf(nullIterable); + ImmutableSet.copyOf(nullIterator); + ImmutableSet.copyOf(nullCollection); + } + + void testImmutableMapOfnotNullArguments() { + + Object notNull = new Object(); + + ImmutableMap.of(null, null); + ImmutableMap.of(notNull, notNull); + ImmutableMap.of(notNull, null, notNull, null); + } + + void testImmutableMapCopyOfNotNullArguments() { + + Iterable nullIterable = null; + Map nullMap = null; + + ImmutableMap.copyOf(nullIterable); + ImmutableMap.copyOf(nullMap); + } } interface SomeInterface { diff --git a/infer/tests/codetoanalyze/java/eradicate/issues.exp b/infer/tests/codetoanalyze/java/eradicate/issues.exp index bdd4b9768..236812fe7 100644 --- a/infer/tests/codetoanalyze/java/eradicate/issues.exp +++ b/infer/tests/codetoanalyze/java/eradicate/issues.exp @@ -65,17 +65,41 @@ codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.N codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testSystemGetenvBad():int, 2, ERADICATE_NULL_METHOD_CALL, no_bucket, WARNING, [origin,The value of `envValue` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to getenv(...) modelled in modelTables.ml at line 239)] codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.withConditionalAssignemnt(codetoanalyze.java.eradicate.NullMethodCall$AnotherI,boolean,java.lang.Object,java.lang.Object):void, 2, ERADICATE_NULL_METHOD_CALL, no_bucket, WARNING, [The value of `i` in the call to `withObjectParameter(...)` is nullable and is not locally checked for null. (Origin: method parameter i)] codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.withConjuction(codetoanalyze.java.eradicate.NullMethodCall$AnotherI,boolean,boolean):void, 1, ERADICATE_NULL_METHOD_CALL, no_bucket, WARNING, [The value of `i` in the call to `withBooleanParameter(...)` is nullable and is not locally checked for null. (Origin: method parameter i)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable$ConstructorCall.(codetoanalyze.java.eradicate.ParameterNotNullable,int), 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable$ConstructorCall(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 95)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.callNull():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.test(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: null constant at line 33)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable$ConstructorCall.(codetoanalyze.java.eradicate.ParameterNotNullable,int), 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable$ConstructorCall(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 101)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.callNull():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.test(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: null constant at line 39)] codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.callNullable(java.lang.String):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.test(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: method parameter s)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.callWithConditionalAssignment(java.lang.Object,boolean):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.doesNotAcceptNullableFirstParameter(...)` needs a non-null value in parameter 1 but argument `object` can be null. (Origin: null constant at line 110)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.callWithNullableFirstParameter(boolean,boolean):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.doesNotAcceptNullableFirstParameter(...)` needs a non-null value in parameter 1 but argument `formal parameter object` can be null. (Origin: null constant at line 106)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testClassGetResourceArgument(java.lang.Class):java.net.URL, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`Class.getResource(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 75)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testSystemGetPropertyArgument():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`System.getProperty(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 65)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testSystemGetenvBad():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`System.getenv(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 71)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testThreeParameters():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 82)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testThreeParameters():void, 3, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 83)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testThreeParameters():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 3 but argument `null` can be null. (Origin: null constant at line 84)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.callWithConditionalAssignment(java.lang.Object,boolean):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.doesNotAcceptNullableFirstParameter(...)` needs a non-null value in parameter 1 but argument `object` can be null. (Origin: null constant at line 116)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.callWithNullableFirstParameter(boolean,boolean):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.doesNotAcceptNullableFirstParameter(...)` needs a non-null value in parameter 1 but argument `formal parameter object` can be null. (Origin: null constant at line 112)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testClassGetResourceArgument(java.lang.Class):java.net.URL, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`Class.getResource(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 81)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableListCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableList.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterable` can be null. (Origin: null constant at line 131)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableListCopyOfNotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableList.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterator` can be null. (Origin: null constant at line 132)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableListCopyOfNotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableList.copyOf(...)` needs a non-null value in parameter 1 but argument `nullCollection` can be null. (Origin: null constant at line 133)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableList.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 123)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableList.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 124)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableList.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 124)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableList.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 126)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableListSortedCopyOfNotNullArguments():void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableList.sortedCopyOf(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 141)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableListSortedCopyOfNotNullArguments():void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableList.sortedCopyOf(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 141)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableMapCopyOfNotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableMap.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterable` can be null. (Origin: null constant at line 177)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableMapCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableMap.copyOf(...)` needs a non-null value in parameter 1 but argument `nullMap` can be null. (Origin: null constant at line 178)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableMap.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 170)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableMap.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 170)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableMap.of(...)` needs a non-null value in parameter 4 but argument `null` can be null. (Origin: null constant at line 172)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableMap.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 172)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterable` can be null. (Origin: null constant at line 157)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetCopyOfNotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterator` can be null. (Origin: null constant at line 158)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetCopyOfNotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.copyOf(...)` needs a non-null value in parameter 1 but argument `nullCollection` can be null. (Origin: null constant at line 159)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 148)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 149)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 149)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 151)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 152)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.of(...)` needs a non-null value in parameter 4 but argument `null` can be null. (Origin: null constant at line 152)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testSystemGetPropertyArgument():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`System.getProperty(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 71)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testSystemGetenvBad():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`System.getenv(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 77)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testThreeParameters():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 88)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testThreeParameters():void, 3, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 89)] +codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testThreeParameters():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 3 but argument `null` can be null. (Origin: null constant at line 90)] codetoanalyze/java/eradicate/PresentTest.java, codetoanalyze.java.eradicate.PresentTest$TestPresentAnnotationBasic.returnPresentBad():com.google.common.base.Optional, 0, ERADICATE_RETURN_VALUE_NOT_PRESENT, no_bucket, WARNING, [origin,Method `returnPresentBad()` may return an absent value but it is annotated with `@Present`. (Origin: field PresentTest$TestPresentAnnotationBasic.absent at line 44)] codetoanalyze/java/eradicate/PresentTest.java, codetoanalyze.java.eradicate.PresentTest$TestPresentAnnotationBasic.returnPresentBad():com.google.common.base.Optional, 1, ERADICATE_VALUE_NOT_PRESENT, no_bucket, WARNING, [origin,The value of `PresentTest$TestPresentAnnotationBasic.absent` in the call to `get()` is not `@Present`. (Origin: field PresentTest$TestPresentAnnotationBasic.absent at line 44)] codetoanalyze/java/eradicate/PresentTest.java, codetoanalyze.java.eradicate.PresentTest$TestPresentAnnotationBasic.testOptionalAbsent():void, 1, ERADICATE_PARAMETER_VALUE_ABSENT, no_bucket, WARNING, [origin,`PresentTest$TestPresentAnnotationBasic.expectPresent(...)` needs a present value in parameter 1 but argument `absent()` can be absent. (Origin: call to absent() at line 61)]