diff --git a/Makefile b/Makefile index 6d0bf1523..90a318341 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,8 @@ DIRECT_TESTS += \ java_bufferoverrun \ java_checkers \ java_classloads \ - java_eradicate \ + java_nullsafe-default \ + java_nullsafe-gradual \ java_hoisting \ java_hoistingExpensive \ java_inefficientKeysetIterator \ diff --git a/infer/tests/codetoanalyze/java/eradicate/issues.exp b/infer/tests/codetoanalyze/java/eradicate/issues.exp deleted file mode 100644 index 133e76f61..000000000 --- a/infer/tests/codetoanalyze/java/eradicate/issues.exp +++ /dev/null @@ -1,127 +0,0 @@ -codetoanalyze/java/eradicate/ActivityFieldNotInitialized.java, codetoanalyze.java.eradicate.ActivityFieldNotInitialized$BadActivityWithOnCreate.(codetoanalyze.java.eradicate.ActivityFieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `ActivityFieldNotInitialized$BadActivityWithOnCreate.field` is not initialized in the constructor and is not declared `@Nullable`] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestModeledTrueOnNull.testIsEmptyOrNullBad(java.lang.String):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `string` in the call to `contains(...)` is nullable and is not locally checked for null. (Origin: method parameter string)] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestPropagatesNullable.m12Bad1():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m12(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m12(...) at line 114)] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestPropagatesNullable.m12Bad2():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m12(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m12(...) at line 118)] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestPropagatesNullable.m2Bad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m2(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m2(...) at line 101)] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestPropagatesNullable.mBad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m(...) at line 79)] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestTextUtilsIsEmpty.myTextUtilsIsEmpty(java.lang.CharSequence):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter s)] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestTextUtilsIsEmpty.myTextUtilsNotIsNotEmpty(java.lang.CharSequence):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter s)] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestTextUtilsIsEmpty.textUtilsIsEmpty(java.lang.CharSequence):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`TextUtils.isEmpty(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: method parameter s)] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestTextUtilsIsEmpty.textUtilsIsEmpty(java.lang.CharSequence):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter s)] -codetoanalyze/java/eradicate/CustomAnnotations.java, codetoanalyze.java.eradicate.CustomAnnotations$TestTextUtilsIsEmpty.textUtilsNotIsEmpty(java.lang.CharSequence):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`TextUtils.isEmpty(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: method parameter s)] -codetoanalyze/java/eradicate/FieldNotInitialized.java, codetoanalyze.java.eradicate.FieldNotInitialized$ConditionalFieldInit.(codetoanalyze.java.eradicate.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$ConditionalFieldInit.o1` is not initialized in the constructor and is not declared `@Nullable`] -codetoanalyze/java/eradicate/FieldNotInitialized.java, codetoanalyze.java.eradicate.FieldNotInitialized$InitCircular.(codetoanalyze.java.eradicate.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$InitCircular.s` is not initialized in the constructor and is not declared `@Nullable`] -codetoanalyze/java/eradicate/FieldNotInitialized.java, codetoanalyze.java.eradicate.FieldNotInitialized$OnlyRead.(codetoanalyze.java.eradicate.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$OnlyRead.o` is not initialized in the constructor and is not declared `@Nullable`] -codetoanalyze/java/eradicate/FieldNotInitialized.java, codetoanalyze.java.eradicate.FieldNotInitialized$OnlyReadIndirect.(codetoanalyze.java.eradicate.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$OnlyReadIndirect.o1` is not initialized in the constructor and is not declared `@Nullable`] -codetoanalyze/java/eradicate/FieldNotInitialized.java, codetoanalyze.java.eradicate.FieldNotInitialized$Swap.(codetoanalyze.java.eradicate.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$Swap.o1` is not initialized in the constructor and is not declared `@Nullable`] -codetoanalyze/java/eradicate/FieldNotInitialized.java, codetoanalyze.java.eradicate.FieldNotInitialized$WriteItself.(codetoanalyze.java.eradicate.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$WriteItself.o` is not initialized in the constructor and is not declared `@Nullable`] -codetoanalyze/java/eradicate/FieldNotInitialized.java, codetoanalyze.java.eradicate.FieldNotInitialized.(), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized.a` is not initialized in the constructor and is not declared `@Nullable`] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.FieldNotNullable.(java.lang.Integer), -25, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.static_s` can be null but is not declared `@Nullable`. (Origin: null constant at line 44)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.FieldNotNullable.(java.lang.String), -2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.static_s` can be null but is not declared `@Nullable`. (Origin: null constant at line 44)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.FieldNotNullable.setYNull():void, 1, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.y` can be null but is not declared `@Nullable`. (Origin: null constant at line 62)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.FieldNotNullable.setYNullable(java.lang.String):void, 1, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.y` can be null but is not declared `@Nullable`. (Origin: method parameter s)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.FragmentExample.(), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FragmentExample.view` is not initialized in the constructor and is not declared `@Nullable`] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.NestedFieldAccess$TestFunctionsIdempotent.FlatBAD1(codetoanalyze.java.eradicate.NestedFieldAccess$TestFunctionsIdempotent):void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 258)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.NestedFieldAccess$TestFunctionsIdempotent.FlatBAD2(codetoanalyze.java.eradicate.NestedFieldAccess$TestFunctionsIdempotent):void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 264)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.NestedFieldAccess$TestFunctionsIdempotent.NestedBAD1():void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 282)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.NestedFieldAccess$TestFunctionsIdempotent.NestedBAD2():void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 288)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.NestedFieldAccess$TestFunctionsIdempotent.NestedBAD3():void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 294)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.NestedFieldAccess$TestPut.putNull(java.util.Map,java.lang.String):void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Map.put(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 332)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.NestedFieldAccess$TestPut.putNull(java.util.Map,java.lang.String):void, 3, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestPut.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: null constant at line 332)] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.TestInitializerBuilder.build():codetoanalyze.java.eradicate.TestInitializer, 2, ERADICATE_CONDITION_REDUNDANT, no_bucket, WARNING, [The condition TestInitializerBuilder.required1 is always true according to the existing annotations.] -codetoanalyze/java/eradicate/FieldNotNullable.java, codetoanalyze.java.eradicate.TestInitializerBuilder.build():codetoanalyze.java.eradicate.TestInitializer, 2, ERADICATE_CONDITION_REDUNDANT, no_bucket, WARNING, [The condition TestInitializerBuilder.required2 is always true according to the existing annotations.] -codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java, codetoanalyze.java.eradicate.ExtendsExternalLibrary.externalMethod2(java.lang.Object):void, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `object` of method `ExtendsExternalLibrary.externalMethod2(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `SomeExternalClass.externalMethod2(...)`.] -codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java, codetoanalyze.java.eradicate.InconsistentSubclassAnnotation.implementInAnotherFile(java.lang.String):java.lang.String, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `s` of method `InconsistentSubclassAnnotation.implementInAnotherFile(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `InconsistentSubclassAnnotationInterface.implementInAnotherFile(...)`.] -codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java, codetoanalyze.java.eradicate.InconsistentSubclassAnnotation.overloadedMethod():java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `InconsistentSubclassAnnotation.overloadedMethod()` is annotated with `@Nullable` but overrides unannotated method `InconsistentSubclassAnnotationInterface.overloadedMethod()`.] -codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java, codetoanalyze.java.eradicate.Sub.overloadingMethodLookupFP(java.lang.Object):java.lang.String, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `Sub.overloadingMethodLookupFP(...)` is annotated with `@Nullable` but overrides unannotated method `Super.overloadingMethodLookupFP(...)`.] -codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java, codetoanalyze.java.eradicate.SubclassExample$B.foo():codetoanalyze.java.eradicate.SubclassExample$T, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `SubclassExample$B.foo()` is annotated with `@Nullable` but overrides unannotated method `SubclassExample$A.foo()`.] -codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java, codetoanalyze.java.eradicate.SubclassExample$C.baz():codetoanalyze.java.eradicate.SubclassExample$T, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `SubclassExample$C.baz()` is annotated with `@Nullable` but overrides unannotated method `SubclassExample$I.baz()`.] -codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java, codetoanalyze.java.eradicate.SubclassExample$D.deref(codetoanalyze.java.eradicate.SubclassExample$T):void, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `t` of method `SubclassExample$D.deref(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `SubclassExample$A.deref(...)`.] -codetoanalyze/java/eradicate/LibraryCalls.java, codetoanalyze.java.eradicate.LibraryCalls.badAtomicReferenceDereference(java.util.concurrent.atomic.AtomicReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 35)] -codetoanalyze/java/eradicate/LibraryCalls.java, codetoanalyze.java.eradicate.LibraryCalls.badPhantomReferenceDereference(java.lang.ref.PhantomReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 27)] -codetoanalyze/java/eradicate/LibraryCalls.java, codetoanalyze.java.eradicate.LibraryCalls.badReferenceDereference(java.lang.ref.Reference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 19)] -codetoanalyze/java/eradicate/LibraryCalls.java, codetoanalyze.java.eradicate.LibraryCalls.badSoftReferenceDereference(java.lang.ref.SoftReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 31)] -codetoanalyze/java/eradicate/LibraryCalls.java, codetoanalyze.java.eradicate.LibraryCalls.badWeakReferenceDereference(java.lang.ref.WeakReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 23)] -codetoanalyze/java/eradicate/NullFieldAccess.java, codetoanalyze.java.eradicate.NullFieldAccess.arrayAccess():java.lang.Object, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `NullFieldAccess.objects` is nullable and is not locally checked for null when accessing element at index `0`. (Origin: field NullFieldAccess.objects at line 56)] -codetoanalyze/java/eradicate/NullFieldAccess.java, codetoanalyze.java.eradicate.NullFieldAccess.arrayLength():int, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `NullFieldAccess.objects` is nullable and is not locally checked for null when accessing field `length`. (Origin: field NullFieldAccess.objects at line 52)] -codetoanalyze/java/eradicate/NullFieldAccess.java, codetoanalyze.java.eradicate.NullFieldAccess.useInterface(codetoanalyze.java.eradicate.NullFieldAccess$I):int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `c` is nullable and is not locally checked for null when accessing field `NullFieldAccess$C.n`. (Origin: field NullFieldAccess$I.c at line 45)] -codetoanalyze/java/eradicate/NullFieldAccess.java, codetoanalyze.java.eradicate.NullFieldAccess.useX():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `c` is nullable and is not locally checked for null when accessing field `NullFieldAccess$C.n`. (Origin: field NullFieldAccess.x at line 30)] -codetoanalyze/java/eradicate/NullFieldAccess.java, codetoanalyze.java.eradicate.NullFieldAccess.useZ():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `c` is nullable and is not locally checked for null when accessing field `NullFieldAccess$C.n`. (Origin: field NullFieldAccess.z at line 40)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall$Inner.outerField():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NullMethodCall.fld at line 69)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall$Inner.outerPrivateField():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NullMethodCall.pfld at line 80)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.FP_propagatesNonNullAfterComparisonFieldOkay(java.lang.Object):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `NullMethodCall.nullableField` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field NullMethodCall.nullableField at line 275)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.FP_propagatesNonNullAfterComparisonParameterOkay(java.lang.Object,java.lang.Object):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `nullableParameter` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter nullableParameter)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.callOnNull():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: null constant at line 25)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.callingSeverSideNullableGetter(codetoanalyze.java.eradicate.ServerSideDeserializer):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, ERROR, [The value of `deserializer.nullableGetter()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to nullableGetter() at line 307)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.nullMethodCallWithAlarmManager(android.app.AlarmManager,android.app.PendingIntent):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`AlarmManager.cancel(...)` needs a non-null value in parameter 1 but argument `intent` can be null. (Origin: method parameter intent)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.nullabilityNotPreservedAfterAssignment():void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `t` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getNullable() at line 340)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.nullabilityStoredInBooleanFP():void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `getNullable()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getNullable() at line 346)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testExceptionPerInstruction(int):void, 6, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: null constant at line 181)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testFieldAssignmentIfThenElse(java.lang.String):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: null constant at line 172)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testInAssignmentFP(java.lang.Object):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `t` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getNullable() at line 354)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testMapGetBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m.get(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get(...) modelled in modelTables.ml at line 260)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testMapGetBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `hm.get(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get(...) modelled in modelTables.ml at line 261)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testMapGetBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 4, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `chm.get(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get(...) modelled in modelTables.ml at line 262)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testMapRemoveBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m.remove(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to remove(...) modelled in modelTables.ml at line 267)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testMapRemoveBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `hm.remove(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to remove(...) modelled in modelTables.ml at line 268)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testMapRemoveBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 4, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `chm.remove(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to remove(...) modelled in modelTables.ml at line 269)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testNotDetectingInvariantFP(java.lang.Object,java.lang.Object):java.lang.String, 4, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `object2` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter object2)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testPathGetParent():java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `get(...).getParent()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getParent() modelled in modelTables.ml at line 360)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testSystemGetPropertyReturn():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to getProperty(...) modelled in modelTables.ml at line 235)] -codetoanalyze/java/eradicate/NullMethodCall.java, codetoanalyze.java.eradicate.NullMethodCall.testSystemGetenvBad():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [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 240)] -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_NULLABLE_DEREFERENCE, 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_NULLABLE_DEREFERENCE, 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, [`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, [`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, [`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, [`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, [`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, [`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, [`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, [`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, [`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, [`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, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`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, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`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, [`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, [`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, [`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, [`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, [`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, [`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, [`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.testImmutableMapOfnotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`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.testImmutableSetCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`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, [`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, [`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, [`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, [`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, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`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, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`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, [`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, [`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.testParsingNullStringToNumber():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Long.parseLong(...)` needs a non-null value in parameter 1 but argument `ns` can be null. (Origin: null constant at line 185)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testParsingNullStringToNumber():void, 3, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Integer.parseInt(...)` needs a non-null value in parameter 1 but argument `ns` can be null. (Origin: null constant at line 185)] -codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testSystemGetPropertyArgument():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`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, [`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, [`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, [`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, [`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/Redundant.java, Redundant.bad():void, 2, ERADICATE_CONDITION_REDUNDANT, no_bucket, WARNING, [The condition s is always true according to the existing annotations.] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable$ConditionalAssignment.test(boolean):java.lang.Object, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `test(...)` may return null but it is not annotated with `@Nullable`. (Origin: field ReturnNotNullable$ConditionalAssignment.f1 at line 213)] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.constantToNullableIsOverannotated():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `constantToNullableIsOverannotated()` is annotated with `@Nullable` but never returns null.] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.getResourceNullable(java.lang.Class,java.lang.String):java.net.URL, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `getResourceNullable(...)` may return null but it is not annotated with `@Nullable`. (Origin: call to getResource(...) modelled in modelTables.ml at line 191)] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.nonNullToNullableIsOverannotated(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `nonNullToNullableIsOverannotated(...)` is annotated with `@Nullable` but never returns null.] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.notAnnotatedNullableIsOverannotated(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `notAnnotatedNullableIsOverannotated(...)` is annotated with `@Nullable` but never returns null.] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.nullToNonnullIsBad():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullToNonnullIsBad()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 60)] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.nullToNotAnnotatedIsBad():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullToNotAnnotatedIsBad()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 35)] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.nullableToNonnullIsBad(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullableToNonnullIsBad(...)` may return null but it is not annotated with `@Nullable`. (Origin: method parameter s)] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.nullableToNotAnnotatedIsBad(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullableToNotAnnotatedIsBad(...)` may return null but it is not annotated with `@Nullable`. (Origin: method parameter s)] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.redundantEq():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `redundantEq()` is annotated with `@Nullable` but never returns null.] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.redundantEq():java.lang.String, 2, ERADICATE_CONDITION_REDUNDANT_NONNULL, no_bucket, WARNING, [The condition s is always false according to the existing annotations.] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.redundantNeq():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `redundantNeq()` is annotated with `@Nullable` but never returns null.] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.redundantNeq():java.lang.String, 2, ERADICATE_CONDITION_REDUNDANT_NONNULL, no_bucket, WARNING, [The condition s is always true according to the existing annotations.] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.return_null_in_catch():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `return_null_in_catch()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 174)] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.return_null_in_catch_after_throw():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `return_null_in_catch_after_throw()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 186)] -codetoanalyze/java/eradicate/ReturnNotNullable.java, codetoanalyze.java.eradicate.ReturnNotNullable.tryWithResourcesReturnNullable(java.lang.String):java.lang.Object, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `tryWithResourcesReturnNullable(...)` may return null but it is not annotated with `@Nullable`. (Origin: call to nullToNullableIsOK() at line 156)] diff --git a/infer/tests/codetoanalyze/java/eradicate/.inferconfig b/infer/tests/codetoanalyze/java/nullsafe-default/.inferconfig similarity index 100% rename from infer/tests/codetoanalyze/java/eradicate/.inferconfig rename to infer/tests/codetoanalyze/java/nullsafe-default/.inferconfig diff --git a/infer/tests/codetoanalyze/java/eradicate/ActivityFieldNotInitialized.java b/infer/tests/codetoanalyze/java/nullsafe-default/ActivityFieldNotInitialized.java similarity index 90% rename from infer/tests/codetoanalyze/java/eradicate/ActivityFieldNotInitialized.java rename to infer/tests/codetoanalyze/java/nullsafe-default/ActivityFieldNotInitialized.java index f7570805e..4f6bcf604 100644 --- a/infer/tests/codetoanalyze/java/eradicate/ActivityFieldNotInitialized.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/ActivityFieldNotInitialized.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import android.app.Activity; import android.os.Bundle; diff --git a/infer/tests/codetoanalyze/java/eradicate/CustomAnnotations.java b/infer/tests/codetoanalyze/java/nullsafe-default/CustomAnnotations.java similarity index 98% rename from infer/tests/codetoanalyze/java/eradicate/CustomAnnotations.java rename to infer/tests/codetoanalyze/java/nullsafe-default/CustomAnnotations.java index df6c2aea4..38f2c4664 100644 --- a/infer/tests/codetoanalyze/java/eradicate/CustomAnnotations.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/CustomAnnotations.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import android.text.TextUtils; import com.facebook.infer.annotation.FalseOnNull; diff --git a/infer/tests/codetoanalyze/java/eradicate/FieldNotInitialized.java b/infer/tests/codetoanalyze/java/nullsafe-default/FieldNotInitialized.java similarity index 98% rename from infer/tests/codetoanalyze/java/eradicate/FieldNotInitialized.java rename to infer/tests/codetoanalyze/java/nullsafe-default/FieldNotInitialized.java index eb57d4f3f..218c64f1e 100644 --- a/infer/tests/codetoanalyze/java/eradicate/FieldNotInitialized.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/FieldNotInitialized.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import android.support.annotation.NonNull; import android.widget.EditText; diff --git a/infer/tests/codetoanalyze/java/eradicate/FieldNotNullable.java b/infer/tests/codetoanalyze/java/nullsafe-default/FieldNotNullable.java similarity index 99% rename from infer/tests/codetoanalyze/java/eradicate/FieldNotNullable.java rename to infer/tests/codetoanalyze/java/nullsafe-default/FieldNotNullable.java index bc8015823..635ca2712 100644 --- a/infer/tests/codetoanalyze/java/eradicate/FieldNotNullable.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/FieldNotNullable.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import android.app.Activity; import android.os.Bundle; diff --git a/infer/tests/codetoanalyze/java/eradicate/GeneratedGraphQL.java b/infer/tests/codetoanalyze/java/nullsafe-default/GeneratedGraphQL.java similarity index 90% rename from infer/tests/codetoanalyze/java/eradicate/GeneratedGraphQL.java rename to infer/tests/codetoanalyze/java/nullsafe-default/GeneratedGraphQL.java index 17c468541..13f35dbc1 100644 --- a/infer/tests/codetoanalyze/java/eradicate/GeneratedGraphQL.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/GeneratedGraphQL.java @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/infer/tests/codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java b/infer/tests/codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java similarity index 98% rename from infer/tests/codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java rename to infer/tests/codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java index e9598e8e9..765c0fc2f 100644 --- a/infer/tests/codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import external.library.SomeExternalClass; import javax.annotation.Nullable; diff --git a/infer/tests/codetoanalyze/java/eradicate/InconsistentSubclassAnnotationInterface.java b/infer/tests/codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotationInterface.java similarity index 90% rename from infer/tests/codetoanalyze/java/eradicate/InconsistentSubclassAnnotationInterface.java rename to infer/tests/codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotationInterface.java index 404c553fe..399084fb7 100644 --- a/infer/tests/codetoanalyze/java/eradicate/InconsistentSubclassAnnotationInterface.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotationInterface.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import javax.annotation.Nullable; diff --git a/infer/tests/codetoanalyze/java/eradicate/JunitExample.java b/infer/tests/codetoanalyze/java/nullsafe-default/JunitExample.java similarity index 100% rename from infer/tests/codetoanalyze/java/eradicate/JunitExample.java rename to infer/tests/codetoanalyze/java/nullsafe-default/JunitExample.java diff --git a/infer/tests/codetoanalyze/java/eradicate/LibraryCalls.java b/infer/tests/codetoanalyze/java/nullsafe-default/LibraryCalls.java similarity index 95% rename from infer/tests/codetoanalyze/java/eradicate/LibraryCalls.java rename to infer/tests/codetoanalyze/java/nullsafe-default/LibraryCalls.java index 041b280dd..c7f339d5c 100644 --- a/infer/tests/codetoanalyze/java/eradicate/LibraryCalls.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/LibraryCalls.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import java.lang.ref.PhantomReference; import java.lang.ref.Reference; diff --git a/infer/tests/codetoanalyze/java/eradicate/Makefile b/infer/tests/codetoanalyze/java/nullsafe-default/Makefile similarity index 100% rename from infer/tests/codetoanalyze/java/eradicate/Makefile rename to infer/tests/codetoanalyze/java/nullsafe-default/Makefile diff --git a/infer/tests/codetoanalyze/java/eradicate/MyPreconditions.java b/infer/tests/codetoanalyze/java/nullsafe-default/MyPreconditions.java similarity index 90% rename from infer/tests/codetoanalyze/java/eradicate/MyPreconditions.java rename to infer/tests/codetoanalyze/java/nullsafe-default/MyPreconditions.java index 95f5ddb8d..42758b33b 100644 --- a/infer/tests/codetoanalyze/java/eradicate/MyPreconditions.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/MyPreconditions.java @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import javax.annotation.Nullable; diff --git a/infer/tests/codetoanalyze/java/eradicate/NoReuseUndefFunctionValues.java b/infer/tests/codetoanalyze/java/nullsafe-default/NoReuseUndefFunctionValues.java similarity index 93% rename from infer/tests/codetoanalyze/java/eradicate/NoReuseUndefFunctionValues.java rename to infer/tests/codetoanalyze/java/nullsafe-default/NoReuseUndefFunctionValues.java index 94f47287a..57457be67 100644 --- a/infer/tests/codetoanalyze/java/eradicate/NoReuseUndefFunctionValues.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/NoReuseUndefFunctionValues.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import javax.annotation.Nullable; diff --git a/infer/tests/codetoanalyze/java/eradicate/NullFieldAccess.java b/infer/tests/codetoanalyze/java/nullsafe-default/NullFieldAccess.java similarity index 94% rename from infer/tests/codetoanalyze/java/eradicate/NullFieldAccess.java rename to infer/tests/codetoanalyze/java/nullsafe-default/NullFieldAccess.java index 173d8d271..16105a7e5 100644 --- a/infer/tests/codetoanalyze/java/eradicate/NullFieldAccess.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/NullFieldAccess.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import javax.annotation.Nullable; diff --git a/infer/tests/codetoanalyze/java/eradicate/NullMethodCall.java b/infer/tests/codetoanalyze/java/nullsafe-default/NullMethodCall.java similarity index 99% rename from infer/tests/codetoanalyze/java/eradicate/NullMethodCall.java rename to infer/tests/codetoanalyze/java/nullsafe-default/NullMethodCall.java index 1b3982bed..0067a0f93 100644 --- a/infer/tests/codetoanalyze/java/eradicate/NullMethodCall.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/NullMethodCall.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import android.app.AlarmManager; import android.app.PendingIntent; diff --git a/infer/tests/codetoanalyze/java/eradicate/ParameterNotNullable.java b/infer/tests/codetoanalyze/java/nullsafe-default/ParameterNotNullable.java similarity index 98% rename from infer/tests/codetoanalyze/java/eradicate/ParameterNotNullable.java rename to infer/tests/codetoanalyze/java/nullsafe-default/ParameterNotNullable.java index 2cf6e6705..ac825be37 100644 --- a/infer/tests/codetoanalyze/java/eradicate/ParameterNotNullable.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/ParameterNotNullable.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import android.annotation.SuppressLint; import com.google.common.collect.ImmutableList; diff --git a/infer/tests/codetoanalyze/java/eradicate/Redundant.java b/infer/tests/codetoanalyze/java/nullsafe-default/Redundant.java similarity index 100% rename from infer/tests/codetoanalyze/java/eradicate/Redundant.java rename to infer/tests/codetoanalyze/java/nullsafe-default/Redundant.java diff --git a/infer/tests/codetoanalyze/java/eradicate/ReturnNotNullable.java b/infer/tests/codetoanalyze/java/nullsafe-default/ReturnNotNullable.java similarity index 99% rename from infer/tests/codetoanalyze/java/eradicate/ReturnNotNullable.java rename to infer/tests/codetoanalyze/java/nullsafe-default/ReturnNotNullable.java index ba8a81610..4ac2ecee1 100644 --- a/infer/tests/codetoanalyze/java/eradicate/ReturnNotNullable.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/ReturnNotNullable.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import com.google.common.base.Optional; import java.io.BufferedReader; diff --git a/infer/tests/codetoanalyze/java/eradicate/ServerSideDeserializer.java b/infer/tests/codetoanalyze/java/nullsafe-default/ServerSideDeserializer.java similarity index 88% rename from infer/tests/codetoanalyze/java/eradicate/ServerSideDeserializer.java rename to infer/tests/codetoanalyze/java/nullsafe-default/ServerSideDeserializer.java index 14b4b7d00..026a42a63 100644 --- a/infer/tests/codetoanalyze/java/eradicate/ServerSideDeserializer.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/ServerSideDeserializer.java @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import javax.annotation.Nullable; diff --git a/infer/tests/codetoanalyze/java/eradicate/SomeAnnotationEndingWithNullable.java b/infer/tests/codetoanalyze/java/nullsafe-default/SomeAnnotationEndingWithNullable.java similarity index 87% rename from infer/tests/codetoanalyze/java/eradicate/SomeAnnotationEndingWithNullable.java rename to infer/tests/codetoanalyze/java/nullsafe-default/SomeAnnotationEndingWithNullable.java index 06493fb9f..2cdaf4e57 100644 --- a/infer/tests/codetoanalyze/java/eradicate/SomeAnnotationEndingWithNullable.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/SomeAnnotationEndingWithNullable.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; // Test annotation to ensure Infer does not confuse it with @Nullable @interface SomeAnnotationEndingWithNullable {} diff --git a/infer/tests/codetoanalyze/java/eradicate/SuppressedFieldNotInitializedExample.java b/infer/tests/codetoanalyze/java/nullsafe-default/SuppressedFieldNotInitializedExample.java similarity index 94% rename from infer/tests/codetoanalyze/java/eradicate/SuppressedFieldNotInitializedExample.java rename to infer/tests/codetoanalyze/java/nullsafe-default/SuppressedFieldNotInitializedExample.java index bc321d1a7..4335c84af 100644 --- a/infer/tests/codetoanalyze/java/eradicate/SuppressedFieldNotInitializedExample.java +++ b/infer/tests/codetoanalyze/java/nullsafe-default/SuppressedFieldNotInitializedExample.java @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -package codetoanalyze.java.eradicate; +package codetoanalyze.java.nullsafe_default; import android.annotation.SuppressLint; import java.lang.annotation.ElementType; diff --git a/infer/tests/codetoanalyze/java/nullsafe-default/issues.exp b/infer/tests/codetoanalyze/java/nullsafe-default/issues.exp new file mode 100644 index 000000000..e4cf5611f --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-default/issues.exp @@ -0,0 +1,127 @@ +codetoanalyze/java/nullsafe-default/ActivityFieldNotInitialized.java, codetoanalyze.java.nullsafe_default.ActivityFieldNotInitialized$BadActivityWithOnCreate.(codetoanalyze.java.nullsafe_default.ActivityFieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `ActivityFieldNotInitialized$BadActivityWithOnCreate.field` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestModeledTrueOnNull.testIsEmptyOrNullBad(java.lang.String):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `string` in the call to `contains(...)` is nullable and is not locally checked for null. (Origin: method parameter string)] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestPropagatesNullable.m12Bad1():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m12(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m12(...) at line 114)] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestPropagatesNullable.m12Bad2():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m12(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m12(...) at line 118)] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestPropagatesNullable.m2Bad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m2(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m2(...) at line 101)] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestPropagatesNullable.mBad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m(...) at line 79)] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestTextUtilsIsEmpty.myTextUtilsIsEmpty(java.lang.CharSequence):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestTextUtilsIsEmpty.myTextUtilsNotIsNotEmpty(java.lang.CharSequence):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestTextUtilsIsEmpty.textUtilsIsEmpty(java.lang.CharSequence):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`TextUtils.isEmpty(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestTextUtilsIsEmpty.textUtilsIsEmpty(java.lang.CharSequence):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-default/CustomAnnotations.java, codetoanalyze.java.nullsafe_default.CustomAnnotations$TestTextUtilsIsEmpty.textUtilsNotIsEmpty(java.lang.CharSequence):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`TextUtils.isEmpty(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-default/FieldNotInitialized.java, codetoanalyze.java.nullsafe_default.FieldNotInitialized$ConditionalFieldInit.(codetoanalyze.java.nullsafe_default.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$ConditionalFieldInit.o1` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-default/FieldNotInitialized.java, codetoanalyze.java.nullsafe_default.FieldNotInitialized$InitCircular.(codetoanalyze.java.nullsafe_default.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$InitCircular.s` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-default/FieldNotInitialized.java, codetoanalyze.java.nullsafe_default.FieldNotInitialized$OnlyRead.(codetoanalyze.java.nullsafe_default.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$OnlyRead.o` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-default/FieldNotInitialized.java, codetoanalyze.java.nullsafe_default.FieldNotInitialized$OnlyReadIndirect.(codetoanalyze.java.nullsafe_default.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$OnlyReadIndirect.o1` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-default/FieldNotInitialized.java, codetoanalyze.java.nullsafe_default.FieldNotInitialized$Swap.(codetoanalyze.java.nullsafe_default.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$Swap.o1` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-default/FieldNotInitialized.java, codetoanalyze.java.nullsafe_default.FieldNotInitialized$WriteItself.(codetoanalyze.java.nullsafe_default.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$WriteItself.o` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-default/FieldNotInitialized.java, codetoanalyze.java.nullsafe_default.FieldNotInitialized.(), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized.a` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.FieldNotNullable.(java.lang.Integer), -25, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.static_s` can be null but is not declared `@Nullable`. (Origin: null constant at line 44)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.FieldNotNullable.(java.lang.String), -2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.static_s` can be null but is not declared `@Nullable`. (Origin: null constant at line 44)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.FieldNotNullable.setYNull():void, 1, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.y` can be null but is not declared `@Nullable`. (Origin: null constant at line 62)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.FieldNotNullable.setYNullable(java.lang.String):void, 1, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.y` can be null but is not declared `@Nullable`. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.FragmentExample.(), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FragmentExample.view` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestFunctionsIdempotent.FlatBAD1(codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestFunctionsIdempotent):void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 258)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestFunctionsIdempotent.FlatBAD2(codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestFunctionsIdempotent):void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 264)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestFunctionsIdempotent.NestedBAD1():void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 282)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestFunctionsIdempotent.NestedBAD2():void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 288)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestFunctionsIdempotent.NestedBAD3():void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 294)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestPut.putNull(java.util.Map,java.lang.String):void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Map.put(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 332)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestPut.putNull(java.util.Map,java.lang.String):void, 3, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestPut.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: null constant at line 332)] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.TestInitializerBuilder.build():codetoanalyze.java.nullsafe_default.TestInitializer, 2, ERADICATE_CONDITION_REDUNDANT, no_bucket, WARNING, [The condition TestInitializerBuilder.required1 is always true according to the existing annotations.] +codetoanalyze/java/nullsafe-default/FieldNotNullable.java, codetoanalyze.java.nullsafe_default.TestInitializerBuilder.build():codetoanalyze.java.nullsafe_default.TestInitializer, 2, ERADICATE_CONDITION_REDUNDANT, no_bucket, WARNING, [The condition TestInitializerBuilder.required2 is always true according to the existing annotations.] +codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_default.ExtendsExternalLibrary.externalMethod2(java.lang.Object):void, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `object` of method `ExtendsExternalLibrary.externalMethod2(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `SomeExternalClass.externalMethod2(...)`.] +codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_default.InconsistentSubclassAnnotation.implementInAnotherFile(java.lang.String):java.lang.String, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `s` of method `InconsistentSubclassAnnotation.implementInAnotherFile(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `InconsistentSubclassAnnotationInterface.implementInAnotherFile(...)`.] +codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_default.InconsistentSubclassAnnotation.overloadedMethod():java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `InconsistentSubclassAnnotation.overloadedMethod()` is annotated with `@Nullable` but overrides unannotated method `InconsistentSubclassAnnotationInterface.overloadedMethod()`.] +codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_default.Sub.overloadingMethodLookupFP(java.lang.Object):java.lang.String, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `Sub.overloadingMethodLookupFP(...)` is annotated with `@Nullable` but overrides unannotated method `Super.overloadingMethodLookupFP(...)`.] +codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_default.SubclassExample$B.foo():codetoanalyze.java.nullsafe_default.SubclassExample$T, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `SubclassExample$B.foo()` is annotated with `@Nullable` but overrides unannotated method `SubclassExample$A.foo()`.] +codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_default.SubclassExample$C.baz():codetoanalyze.java.nullsafe_default.SubclassExample$T, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `SubclassExample$C.baz()` is annotated with `@Nullable` but overrides unannotated method `SubclassExample$I.baz()`.] +codetoanalyze/java/nullsafe-default/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_default.SubclassExample$D.deref(codetoanalyze.java.nullsafe_default.SubclassExample$T):void, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `t` of method `SubclassExample$D.deref(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `SubclassExample$A.deref(...)`.] +codetoanalyze/java/nullsafe-default/LibraryCalls.java, codetoanalyze.java.nullsafe_default.LibraryCalls.badAtomicReferenceDereference(java.util.concurrent.atomic.AtomicReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 35)] +codetoanalyze/java/nullsafe-default/LibraryCalls.java, codetoanalyze.java.nullsafe_default.LibraryCalls.badPhantomReferenceDereference(java.lang.ref.PhantomReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 27)] +codetoanalyze/java/nullsafe-default/LibraryCalls.java, codetoanalyze.java.nullsafe_default.LibraryCalls.badReferenceDereference(java.lang.ref.Reference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 19)] +codetoanalyze/java/nullsafe-default/LibraryCalls.java, codetoanalyze.java.nullsafe_default.LibraryCalls.badSoftReferenceDereference(java.lang.ref.SoftReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 31)] +codetoanalyze/java/nullsafe-default/LibraryCalls.java, codetoanalyze.java.nullsafe_default.LibraryCalls.badWeakReferenceDereference(java.lang.ref.WeakReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 23)] +codetoanalyze/java/nullsafe-default/NullFieldAccess.java, codetoanalyze.java.nullsafe_default.NullFieldAccess.arrayAccess():java.lang.Object, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `NullFieldAccess.objects` is nullable and is not locally checked for null when accessing element at index `0`. (Origin: field NullFieldAccess.objects at line 56)] +codetoanalyze/java/nullsafe-default/NullFieldAccess.java, codetoanalyze.java.nullsafe_default.NullFieldAccess.arrayLength():int, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `NullFieldAccess.objects` is nullable and is not locally checked for null when accessing field `length`. (Origin: field NullFieldAccess.objects at line 52)] +codetoanalyze/java/nullsafe-default/NullFieldAccess.java, codetoanalyze.java.nullsafe_default.NullFieldAccess.useInterface(codetoanalyze.java.nullsafe_default.NullFieldAccess$I):int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `c` is nullable and is not locally checked for null when accessing field `NullFieldAccess$C.n`. (Origin: field NullFieldAccess$I.c at line 45)] +codetoanalyze/java/nullsafe-default/NullFieldAccess.java, codetoanalyze.java.nullsafe_default.NullFieldAccess.useX():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `c` is nullable and is not locally checked for null when accessing field `NullFieldAccess$C.n`. (Origin: field NullFieldAccess.x at line 30)] +codetoanalyze/java/nullsafe-default/NullFieldAccess.java, codetoanalyze.java.nullsafe_default.NullFieldAccess.useZ():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `c` is nullable and is not locally checked for null when accessing field `NullFieldAccess$C.n`. (Origin: field NullFieldAccess.z at line 40)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall$Inner.outerField():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NullMethodCall.fld at line 69)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall$Inner.outerPrivateField():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NullMethodCall.pfld at line 80)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.FP_propagatesNonNullAfterComparisonFieldOkay(java.lang.Object):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `NullMethodCall.nullableField` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field NullMethodCall.nullableField at line 275)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.FP_propagatesNonNullAfterComparisonParameterOkay(java.lang.Object,java.lang.Object):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `nullableParameter` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter nullableParameter)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.callOnNull():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: null constant at line 25)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.callingSeverSideNullableGetter(codetoanalyze.java.nullsafe_default.ServerSideDeserializer):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, ERROR, [The value of `deserializer.nullableGetter()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to nullableGetter() at line 307)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.nullMethodCallWithAlarmManager(android.app.AlarmManager,android.app.PendingIntent):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`AlarmManager.cancel(...)` needs a non-null value in parameter 1 but argument `intent` can be null. (Origin: method parameter intent)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.nullabilityNotPreservedAfterAssignment():void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `t` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getNullable() at line 340)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.nullabilityStoredInBooleanFP():void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `getNullable()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getNullable() at line 346)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testExceptionPerInstruction(int):void, 6, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: null constant at line 181)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testFieldAssignmentIfThenElse(java.lang.String):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: null constant at line 172)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testInAssignmentFP(java.lang.Object):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `t` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getNullable() at line 354)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testMapGetBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m.get(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get(...) modelled in modelTables.ml at line 260)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testMapGetBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `hm.get(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get(...) modelled in modelTables.ml at line 261)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testMapGetBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 4, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `chm.get(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get(...) modelled in modelTables.ml at line 262)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testMapRemoveBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m.remove(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to remove(...) modelled in modelTables.ml at line 267)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testMapRemoveBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `hm.remove(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to remove(...) modelled in modelTables.ml at line 268)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testMapRemoveBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 4, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `chm.remove(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to remove(...) modelled in modelTables.ml at line 269)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testNotDetectingInvariantFP(java.lang.Object,java.lang.Object):java.lang.String, 4, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `object2` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter object2)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testPathGetParent():java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `get(...).getParent()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getParent() modelled in modelTables.ml at line 360)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testSystemGetPropertyReturn():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to getProperty(...) modelled in modelTables.ml at line 235)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.testSystemGetenvBad():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [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 240)] +codetoanalyze/java/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.withConditionalAssignemnt(codetoanalyze.java.nullsafe_default.NullMethodCall$AnotherI,boolean,java.lang.Object,java.lang.Object):void, 2, ERADICATE_NULLABLE_DEREFERENCE, 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/nullsafe-default/NullMethodCall.java, codetoanalyze.java.nullsafe_default.NullMethodCall.withConjuction(codetoanalyze.java.nullsafe_default.NullMethodCall$AnotherI,boolean,boolean):void, 1, ERADICATE_NULLABLE_DEREFERENCE, 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/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable$ConstructorCall.(codetoanalyze.java.nullsafe_default.ParameterNotNullable,int), 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable$ConstructorCall(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 101)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.callNull():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.test(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: null constant at line 39)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.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/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.callWithConditionalAssignment(java.lang.Object,boolean):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.doesNotAcceptNullableFirstParameter(...)` needs a non-null value in parameter 1 but argument `object` can be null. (Origin: null constant at line 116)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.callWithNullableFirstParameter(boolean,boolean):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`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/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testClassGetResourceArgument(java.lang.Class):java.net.URL, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Class.getResource(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 81)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableListCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterable` can be null. (Origin: null constant at line 131)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableListCopyOfNotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterator` can be null. (Origin: null constant at line 132)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableListCopyOfNotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.copyOf(...)` needs a non-null value in parameter 1 but argument `nullCollection` can be null. (Origin: null constant at line 133)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 123)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 124)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 124)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 126)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableListSortedCopyOfNotNullArguments():void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.sortedCopyOf(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 141)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableListSortedCopyOfNotNullArguments():void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.sortedCopyOf(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 141)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableMapCopyOfNotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterable` can be null. (Origin: null constant at line 177)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableMapCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.copyOf(...)` needs a non-null value in parameter 1 but argument `nullMap` can be null. (Origin: null constant at line 178)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 170)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 170)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 172)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.of(...)` needs a non-null value in parameter 4 but argument `null` can be null. (Origin: null constant at line 172)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableSetCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterable` can be null. (Origin: null constant at line 157)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableSetCopyOfNotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterator` can be null. (Origin: null constant at line 158)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableSetCopyOfNotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.copyOf(...)` needs a non-null value in parameter 1 but argument `nullCollection` can be null. (Origin: null constant at line 159)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 148)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 149)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 149)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 151)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 152)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 4 but argument `null` can be null. (Origin: null constant at line 152)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testParsingNullStringToNumber():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Long.parseLong(...)` needs a non-null value in parameter 1 but argument `ns` can be null. (Origin: null constant at line 185)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testParsingNullStringToNumber():void, 3, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Integer.parseInt(...)` needs a non-null value in parameter 1 but argument `ns` can be null. (Origin: null constant at line 185)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testSystemGetPropertyArgument():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`System.getProperty(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 71)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testSystemGetenvBad():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`System.getenv(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 77)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testThreeParameters():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 88)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testThreeParameters():void, 3, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 89)] +codetoanalyze/java/nullsafe-default/ParameterNotNullable.java, codetoanalyze.java.nullsafe_default.ParameterNotNullable.testThreeParameters():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 3 but argument `null` can be null. (Origin: null constant at line 90)] +codetoanalyze/java/nullsafe-default/Redundant.java, Redundant.bad():void, 2, ERADICATE_CONDITION_REDUNDANT, no_bucket, WARNING, [The condition s is always true according to the existing annotations.] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable$ConditionalAssignment.test(boolean):java.lang.Object, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `test(...)` may return null but it is not annotated with `@Nullable`. (Origin: field ReturnNotNullable$ConditionalAssignment.f1 at line 213)] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.constantToNullableIsOverannotated():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `constantToNullableIsOverannotated()` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.getResourceNullable(java.lang.Class,java.lang.String):java.net.URL, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `getResourceNullable(...)` may return null but it is not annotated with `@Nullable`. (Origin: call to getResource(...) modelled in modelTables.ml at line 191)] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.nonNullToNullableIsOverannotated(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `nonNullToNullableIsOverannotated(...)` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.notAnnotatedNullableIsOverannotated(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `notAnnotatedNullableIsOverannotated(...)` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.nullToNonnullIsBad():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullToNonnullIsBad()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 60)] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.nullToNotAnnotatedIsBad():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullToNotAnnotatedIsBad()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 35)] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.nullableToNonnullIsBad(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullableToNonnullIsBad(...)` may return null but it is not annotated with `@Nullable`. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.nullableToNotAnnotatedIsBad(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullableToNotAnnotatedIsBad(...)` may return null but it is not annotated with `@Nullable`. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.redundantEq():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `redundantEq()` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.redundantEq():java.lang.String, 2, ERADICATE_CONDITION_REDUNDANT_NONNULL, no_bucket, WARNING, [The condition s is always false according to the existing annotations.] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.redundantNeq():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `redundantNeq()` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.redundantNeq():java.lang.String, 2, ERADICATE_CONDITION_REDUNDANT_NONNULL, no_bucket, WARNING, [The condition s is always true according to the existing annotations.] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.return_null_in_catch():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `return_null_in_catch()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 174)] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.return_null_in_catch_after_throw():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `return_null_in_catch_after_throw()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 186)] +codetoanalyze/java/nullsafe-default/ReturnNotNullable.java, codetoanalyze.java.nullsafe_default.ReturnNotNullable.tryWithResourcesReturnNullable(java.lang.String):java.lang.Object, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `tryWithResourcesReturnNullable(...)` may return null but it is not annotated with `@Nullable`. (Origin: call to nullToNullableIsOK() at line 156)] diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/.inferconfig b/infer/tests/codetoanalyze/java/nullsafe-gradual/.inferconfig new file mode 100644 index 000000000..9914a46a4 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/.inferconfig @@ -0,0 +1,6 @@ +{ + "external-java-packages": [ + "external." + ], + "nullsafe-strict-containers": true +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/ActivityFieldNotInitialized.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/ActivityFieldNotInitialized.java new file mode 100644 index 000000000..da4afdfe1 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/ActivityFieldNotInitialized.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import android.app.Activity; +import android.os.Bundle; + +public class ActivityFieldNotInitialized { + + class BadActivityWithOnCreate extends Activity { + + private String field; + + protected void onCreate(Bundle bundle) {} + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java new file mode 100644 index 000000000..277aee95b --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java @@ -0,0 +1,140 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import android.text.TextUtils; +import com.facebook.infer.annotation.FalseOnNull; +import com.facebook.infer.annotation.PropagatesNullable; +import com.facebook.infer.annotation.TrueOnNull; +import com.google.common.base.Strings; +import javax.annotation.Nullable; + +public class CustomAnnotations { + + static class MyTextUtils { + + @TrueOnNull + static boolean isEmpty(@Nullable java.lang.CharSequence s) { + return s == null || s.equals(""); + } + + @FalseOnNull + static boolean isNotEmpty(@Nullable java.lang.CharSequence s) { + return s != null && s.length() > 0; + } + } + + class TestTextUtilsIsEmpty { + void textUtilsNotIsEmpty(@Nullable CharSequence s) { + if (!TextUtils.isEmpty(s)) { + s.toString(); // OK + } + } + + void textUtilsIsEmpty(@Nullable CharSequence s) { + if (TextUtils.isEmpty(s)) { + s.toString(); // BAD + } + } + + void myTextUtilsNotIsEmpty(@Nullable CharSequence s) { + if (!MyTextUtils.isEmpty(s)) { + s.toString(); // OK + } + } + + void myTextUtilsIsEmpty(@Nullable CharSequence s) { + if (MyTextUtils.isEmpty(s)) { + s.toString(); // BAD + } + } + + void myTextUtilsIsNotEmpty(@Nullable CharSequence s) { + if (MyTextUtils.isNotEmpty(s)) { + s.toString(); // OK + } + } + + void myTextUtilsNotIsNotEmpty(@Nullable CharSequence s) { + if (!MyTextUtils.isNotEmpty(s)) { + s.toString(); // BAD + } + } + } + + // Tests for the annotation @PropagatesNullable + class TestPropagatesNullable { + + // one parameter: means return null iff s is null + String m(@PropagatesNullable String s) { + return s; + } + + void mBad() { + m(null).length(); // bad: m returns null + } + + void mGood() { + m("").length(); + } + + // limitation: we currently cannot check the body, and just trust the annotation + String cannotCheckBody(@PropagatesNullable String s) { + return null; // nothing is reported here + } + + void illustrateFalseNegativeAsCannotCheckBody() { + cannotCheckBody("").length(); // this is an NPE but is not found + } + + // second parameter: means return null iff s2 is null + String m2(@Nullable String s1, @PropagatesNullable String s2) { + return s2; + } + + void m2Bad() { + m2(null, null).length(); // bad: m2 returns null + } + + void m2Good() { + m2(null, "").length(); + } + + // two parameters: means return null iff either s1 or s2 is null + String m12(@PropagatesNullable String s1, @PropagatesNullable String s2) { + return s1 == null ? s1 : s2; + } + + void m12Bad1() { + m12(null, "").length(); // bad: m12 returns null + } + + void m12Bad2() { + m12("", null).length(); // bad: m12 returns null + } + + void m12Good() { + m12("", "").length(); + } + } + + class TestModeledTrueOnNull { + + void testIsEmptyOrNullOk(@Nullable String string) { + if (!Strings.isNullOrEmpty(string)) { + string.contains("Infer"); + } + } + + void testIsEmptyOrNullBad(@Nullable String string) { + if (Strings.isNullOrEmpty(string)) { + string.contains("Infer"); + } + } + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java new file mode 100644 index 000000000..a10cccb49 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java @@ -0,0 +1,162 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import android.support.annotation.NonNull; +import android.widget.EditText; +import com.facebook.infer.annotation.SuppressViewNullability; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.inject.Inject; + +// for butterknife +@interface Bind {} + +public class FieldNotInitialized { + + String a; + + @Nullable String b; + + @Nonnull String c; // Means: assume it will be initialized to a nonnull value somewhere else. + + @Inject String d; // Means: assume it will be initialized via dependency injection + + @NonNull String e; + + @Bind EditText f; // Means: assume it will be initialized, and ignore null assignment + + @SuppressViewNullability EditText g; + + // Eradicate should only report one initialization error + FieldNotInitialized() {} + + void testNullifyFields() { + f = null; // OK the framework could write null into the field + g = null; // OK the framework could write null into the field + } + + class OnlyRead { + Object o; + + OnlyRead() { + Object x = o; // not initialized + } + } + + class WriteItself { + Object o; + + WriteItself() { + o = o; // not initialized + } + } + + class Swap { + Object o1; + Object o2; + + Swap() { + o1 = o2; // not initialized + o2 = new Object(); + } + } + + class SwapOK { + Object o1; + Object o2; + + SwapOK() { + o1 = new Object(); + o2 = o1; + } + } + + class OnlyReadIndirect { + Object o1; + Object o2; + + private void indirect() { + Object x = o1; // not initialized + o2 = new Object(); + } + + OnlyReadIndirect() { + indirect(); + } + } + + class ConditionalFieldInit { + Object o1; + @Nullable Object o2 = null; + + public ConditionalFieldInit() { + if (o2 != null) { + o1 = new Object(); // Not always initialized + } + } + } + + class InitIfNull { + Object o; + + public InitIfNull() { + if (o == null) o = new Object(); + } + } + + class InitIfNull2 { + Object o; + + public InitIfNull2(Object x) { + if (o == null) o = x; + } + } + + class InitIfNull3 { + Object o; + + Object getNotNull() { + return new Object(); + } + + public InitIfNull3() { + if (o == null) o = getNotNull(); + } + } + + class InitCircular { + String s; + + InitCircular() { + String tmp = s; + s = tmp; // s is not initialized: circular initialization + } + } + + class InitWithOtherClass { + class OtherClass { + String s = ""; + } + + String s; + + InitWithOtherClass(OtherClass x) { + s = x.s; + } + } + + class InitWithThisClass { + + String s; + + InitWithThisClass(InitWithThisClass x) { + s = x.s; + } + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java new file mode 100644 index 000000000..c43acfc25 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java @@ -0,0 +1,367 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import android.app.Activity; +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.view.View; +import com.facebook.infer.annotation.Assertions; +import com.facebook.infer.annotation.Cleanup; +import com.facebook.infer.annotation.Initializer; +import javax.annotation.Nullable; + +abstract class A { + final String fld; + + A(String s) { + this.fld = s; + } +} + +// for butterknife +@interface InjectView {} + +class FragmentExample extends Fragment { + + View view; + + @Override + public void onDestroyView() { + view = null; + } +} + +public class FieldNotNullable extends A { + @Nullable String x; + String y; + String fld; // Shadow the field defined in A + String static_s = null; // Static initializer error + + FieldNotNullable(String s) { + super(s); + x = null; + y = s; + this.fld = s; + } + + void setXNull() { + x = null; + } + + void setXNullable(@Nullable String s) { + x = s; + } + + void setYNull() { + y = null; + } + + void setYNullable(@Nullable String s) { + y = s; + } + + FieldNotNullable(Integer n) { + super(""); + this.fld = ""; + y = x == null ? "abc" : "def"; + } +} + +class MixedInitializers extends Activity { + + private String field1 = "1"; + private String field2; + private String field3; + + MixedInitializers() { + field2 = "2"; + } + + protected void onCreate(Bundle bundle) { + field3 = "3"; + } +} + +class TestInitializerBuilder { + String required1; + String required2; + @Nullable String optional; + + // No FIELD_NOT_INITIALIZED error should be reported, because of the @Initializer annotations. + TestInitializerBuilder() {} + + // This is an initializer and must always be called before build(). + @Initializer + TestInitializerBuilder setRequired1(String required1) { + this.required1 = required1; + return this; + } + + // This is an initializer and must always be called before build(). + @Initializer + TestInitializerBuilder setRequired2(String required2) { + this.required2 = required2; + return this; + } + + TestInitializerBuilder setOptional(String optional) { + this.optional = optional; + return this; + } + + TestInitializer build() { + // Fail hard if the required fields are not initialzed + Assertions.assertCondition(required1 != null && required2 != null); + + return new TestInitializer(this); + } + + @Cleanup + void testCleanup() { + this.required1 = null; + this.required2 = null; + this.optional = null; + } +} + +class TestInitializer { + String required1; // should always be set + String required2; // should always be set + @Nullable String optional; // optionally set + + TestInitializer(TestInitializerBuilder b) { + required1 = b.required1; + required2 = b.required2; + optional = b.optional; + } + + static void testInitializerClientA() { + TestInitializerBuilder b = new TestInitializerBuilder(); + b.setRequired1("hello"); + b.setRequired2("world"); + TestInitializer x = b.build(); + } + + static void testInitializerClientB() { + TestInitializerBuilder b = new TestInitializerBuilder(); + b.setRequired1("a"); + b.setRequired2("b"); + b.setOptional("c"); + TestInitializer x = b.build(); + } +} + +class NestedFieldAccess { + + class C { + @Nullable String s; + } + + class CC { + @Nullable C c; + } + + class CCC { + @Nullable CC cc; + } + + public class Test { + @Nullable String s; + C myc; + + Test() { + myc = new C(); + } + + void test() { + if (s != null) { + int n = s.length(); + } + } + + void test1() { + if (myc.s != null) { + int n = myc.s.length(); + } + } + + void test2(C c) { + if (c.s != null) { + int n = c.s.length(); + } + } + + void test2_local() { + C c = new C(); + if (c.s != null) { + int n = c.s.length(); + } + } + + void test3(CC cc) { + if (cc.c != null && cc.c.s != null) { + int n = cc.c.s.length(); + } + } + + void test4(CCC ccc) { + if (ccc.cc != null && ccc.cc.c != null && ccc.cc.c.s != null) { + int n = ccc.cc.c.s.length(); + } + } + + void test5(@Nullable CCC ccc) { + if (ccc == null || ccc.cc == null || ccc.cc.c == null || ccc.cc.c.s == null) { + } else { + int n = ccc.cc.c.s.length(); + } + } + } + + class TestFunctionsIdempotent { + @Nullable String s; + String dontAssignNull; + + TestFunctionsIdempotent() { + dontAssignNull = ""; + } + + @Nullable + String getS(int n) { + return s; + } + + TestFunctionsIdempotent getSelf() { + return this; + } + + void FlatOK1(TestFunctionsIdempotent x) { + if (getS(3) != null) { + dontAssignNull = getS(3); + } + } + + void FlatOK2(TestFunctionsIdempotent x) { + if (x.getS(3) != null) { + dontAssignNull = x.getS(3); + } + } + + void FlatBAD1(TestFunctionsIdempotent x) { + if (x.getS(3) != null) { + dontAssignNull = getS(3); + } + } + + void FlatBAD2(TestFunctionsIdempotent x) { + if (x.getS(3) != null) { + dontAssignNull = x.getS(4); + } + } + + void NestedOK1() { + if (getSelf().getS(3) != null) { + dontAssignNull = getSelf().getS(3); + } + } + + void NestedOK2() { + if (getSelf().getSelf().getS(3) != null) { + dontAssignNull = getSelf().getSelf().getS(3); + } + } + + void NestedBAD1() { + if (getSelf().getS(3) != null) { + dontAssignNull = getSelf().getS(4); + } + } + + void NestedBAD2() { + if (getS(3) != null) { + dontAssignNull = getSelf().getS(3); + } + } + + void NestedBAD3() { + if (getSelf().getSelf().getS(3) != null) { + dontAssignNull = getSelf().getS(3); + } + } + } + + class TestContainsKey { + void testMapContainsKey(java.util.Map m) { + if (m.containsKey(3)) { + m.get(3).isEmpty(); + } + } + + void testMapContainsKeyInsideWhileLoop(java.util.Map m) { + while (true) { + if (m.containsKey(3)) { + m.get(3).isEmpty(); + } + } + } + + void testImmutableMapContainsKey(com.google.common.collect.ImmutableMap m) { + if (m.containsKey(3)) { + m.get(3).isEmpty(); + } + } + } + + // Test Map.put() + class TestPut { + String dontAssignNull = ""; + + public void putConstString(java.util.Map map, String key) { + map.put(key, "abc"); + dontAssignNull = map.get(key); + } + + public void putNull(java.util.Map map, String key) { + map.put(key, "abc"); + map.put(key, null); + dontAssignNull = map.get(key); + } + + public void putWithContainsKey(java.util.Map map, String key) { + if (!map.containsKey(key)) { + map.put(key, "abc"); + } + dontAssignNull = map.get(key); + } + } + + // support assignments of null to @InjectView fields, generated by butterknife + class SupportButterKnife { + @InjectView String s; + + SupportButterKnife() {} + + void dereferencingIsOK() { + int n = s.length(); + } + + void assignNullIsOK() { + s = null; + } + } + + void methodWithNullableCapturedParameterBad_FN(@Nullable Object parameter) { + Object object = + new Object() { + void foo() { + parameter.toString(); + } + }; + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/GeneratedGraphQL.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/GeneratedGraphQL.java new file mode 100644 index 000000000..a4e93a08d --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/GeneratedGraphQL.java @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +package codetoanalyze.java.nullsafe_gradual; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.CLASS) +@Target(ElementType.TYPE) +public @interface GeneratedGraphQL {} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java new file mode 100644 index 000000000..6787db2ad --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java @@ -0,0 +1,136 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import external.library.SomeExternalClass; +import javax.annotation.Nullable; + +class SubclassExample { + + class T { + public void f() {} + } + + class A { + + public T foo() { + return new T(); + } + + public @Nullable T bar() { + return null; + } + + public void deref(@Nullable T t) { + if (t != null) { + t.f(); + } + } + + public void noDeref(T t) {} + } + + class B extends A { + + public @Nullable T foo() { + return null; + } + + public T bar() { + return new T(); + } + } + + interface I { + public T baz(); + } + + class C implements I { + + public @Nullable T baz() { + return null; + } + } + + class D extends A { + + public void deref(T t) { + t.f(); + } + + public void noDeref(@Nullable T t) { + if (t != null) { + t.f(); + } + } + } +} + +class ConstructorsAreExcluded { + class Base { + Base(@Nullable String s) {} + } + + class Derived extends Base { + Derived(String s) { // OK: there's no sub-typing between constructors + super(s); + } + } +} + +class ExtendsExternalLibrary extends SomeExternalClass { + + @Override + public @Nullable Object externalMethod1() { + // subtyping error on the return type not reported as we cannot + // rely on the external libraries to be correctly annotated + return null; + } + + @Override + public void externalMethod2(Object object) { + // subtyping error on the parameter type are reported + } +} + +public class InconsistentSubclassAnnotation implements InconsistentSubclassAnnotationInterface { + + public static void callFromSuperclass(SubclassExample.A a) { + SubclassExample.T t = a.foo(); + t.f(); + } + + public static void callWithNullableParam(SubclassExample.A a, @Nullable SubclassExample.T t) { + a.deref(t); + } + + public String implementInAnotherFile(String s) { + return ""; + } + + public @Nullable Object overloadedMethod() { + return null; + } + + public Object overloadedMethod(Object object) { + return object; + } +} + +class Super { + String overloadingMethodLookupFP(int i) { + return Integer.toString(i); + } +} + +class Sub extends Super { + @Nullable + String overloadingMethodLookupFP(Object object) { + return null; + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotationInterface.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotationInterface.java new file mode 100644 index 000000000..8226ef353 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotationInterface.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import javax.annotation.Nullable; + +public interface InconsistentSubclassAnnotationInterface { + + public String implementInAnotherFile(@Nullable String s); + + Object overloadedMethod(); + + Object overloadedMethod(Object object); +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/JunitExample.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/JunitExample.java new file mode 100644 index 000000000..c5e4d7864 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/JunitExample.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import junit.framework.TestCase; + +public class JunitExample extends TestCase { + + private Object mField; + + @Override + protected void setUp() throws Exception { + super.setUp(); + mField = new Object(); + } + + public void testSomething() { + mField.toString(); + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/LibraryCalls.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/LibraryCalls.java new file mode 100644 index 000000000..ad5b42480 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/LibraryCalls.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import java.lang.ref.PhantomReference; +import java.lang.ref.Reference; +import java.lang.ref.SoftReference; +import java.lang.ref.WeakReference; +import java.util.concurrent.atomic.AtomicReference; + +public class LibraryCalls { + + String badReferenceDereference(Reference ref) { + return ref.get().toString(); + } + + String badWeakReferenceDereference(WeakReference ref) { + return ref.get().toString(); + } + + String badPhantomReferenceDereference(PhantomReference ref) { + return ref.get().toString(); + } + + String badSoftReferenceDereference(SoftReference ref) { + return ref.get().toString(); + } + + String badAtomicReferenceDereference(AtomicReference ref) { + return ref.get().toString(); + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/Makefile b/infer/tests/codetoanalyze/java/nullsafe-gradual/Makefile new file mode 100644 index 000000000..aaba3f768 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/Makefile @@ -0,0 +1,16 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +TESTS_DIR = ../../.. + +INFER_OPTIONS = \ + --eradicate-only \ + --eradicate-return-over-annotated \ + --eradicate-condition-redundant \ + --debug-exceptions +INFERPRINT_OPTIONS = --issues-tests +SOURCES = $(wildcard *.java) $(wildcard $(TESTS_DIR)/external/library/*.java) + +include $(TESTS_DIR)/javac.make diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/MyPreconditions.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/MyPreconditions.java new file mode 100644 index 000000000..384e48bcb --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/MyPreconditions.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +package codetoanalyze.java.nullsafe_gradual; + +import javax.annotation.Nullable; + +public class MyPreconditions { + + public static native T checkNotNull(@Nullable T t); + + public static native void checkState(boolean expression); + + public static native void checkArgument(boolean expression); +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/NoReuseUndefFunctionValues.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/NoReuseUndefFunctionValues.java new file mode 100644 index 000000000..c72286405 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/NoReuseUndefFunctionValues.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import javax.annotation.Nullable; + +public class NoReuseUndefFunctionValues { + + Object mObject1; + Object mObject2; + + native Object create(); + + public NoReuseUndefFunctionValues(@Nullable Object object) { + if (object != null) { + this.mObject1 = object; + } else { + this.mObject1 = this.create(); + } + if (object != null) { + this.mObject2 = object; + } else { + this.mObject2 = this.create(); + } + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/NullFieldAccess.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/NullFieldAccess.java new file mode 100644 index 000000000..c762c0aa1 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/NullFieldAccess.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import javax.annotation.Nullable; + +public class NullFieldAccess { + class C { + int n; + } + + interface I { + @Nullable C c = null; + } + + @Nullable C x; + C y; + static final @Nullable C z = null; + + NullFieldAccess() { + y = new C(); + } + + int useX() { + C c = x; + return c.n; + } + + int useY() { + C c = y; + return c.n; + } + + int useZ() { + C c = z; + return c.n; + } + + int useInterface(I i) { + C c = i.c; + return c.n; + } + + @Nullable Object[] objects; + + int arrayLength() { + return objects.length; + } + + Object arrayAccess() { + return objects[0]; + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/NullMethodCall.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/NullMethodCall.java new file mode 100644 index 000000000..97f7bdf33 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/NullMethodCall.java @@ -0,0 +1,369 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import android.app.AlarmManager; +import android.app.PendingIntent; +import com.facebook.infer.annotation.Assertions; +import com.google.common.base.Preconditions; +import com.google.common.base.Verify; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import javax.annotation.Nullable; + +public class NullMethodCall { + + void callOnNull() { + String s = null; + int n = s.length(); + } + + void callOnEmptyString() { + String s = ""; + int n = s.length(); + } + + void callAfterYodaCondition(@Nullable String s) { + if (null != s) { + int n = s.length(); + } + } + + int objectLength(@Nullable Object o) { + if (o instanceof String) { + String s = (String) o; + return s.length(); // OK: s cannot be null because of instanceof + } + return 0; + } + + int testCheckState(@Nullable String s1, @Nullable String s2) { + Preconditions.checkState(s1 != null && s2 != null, "bad"); + return s1.length() + s2.length(); + } + + int testPrivateStaticInnerClassField() { + String s; + S.sfld = "abc"; + s = S.sfld; + return s.length(); + } + + private static class S { + private static @Nullable String sfld; + } + + @Nullable String fld; + private @Nullable String pfld; + + public class Inner { + int outerField() { + String s = fld; + return s.length(); + } + + int outerFieldInitialized() { + fld = "abc"; + String s = fld; + return s.length(); + } + + int outerPrivateField() { + String s = pfld; + return s.length(); + } + + int outerPrivateFieldInitialized() { + pfld = "abc"; + String s = pfld; + return s.length(); + } + + int outerPrivateFieldCheckNotNull() { + Preconditions.checkNotNull(pfld); + String s = pfld; + return s.length(); + } + + int outerPrivateFieldCheckState() { + Preconditions.checkState(pfld != null); + String s = pfld; + return s.length(); + } + + int outerPrivateFieldAssertNotNull() { + Assertions.assertNotNull(pfld); + String s = pfld; + return s.length(); + } + + int outerPrivateFieldAssumeNotNull() { + Assertions.assumeNotNull(pfld); + String s = pfld; + return s.length(); + } + + int outerPrivateFieldAssertCondition() { + Assertions.assertCondition(pfld != null, "explanation"); + String s = pfld; + return s.length(); + } + + int outerPrivateFieldAssumeCondition() { + Assertions.assumeCondition(pfld != null, "explanation"); + String s = pfld; + return s.length(); + } + + int outerPrivateFieldCheckStateYoda() { + Preconditions.checkState(null != pfld); + String s = pfld; + return s.length(); + } + + String outerFieldGuardPrivate() { + if (pfld != null) return pfld.toString(); + return ""; + } + + String outerFieldGuardPublic() { + if (fld != null) return fld.toString(); + return ""; + } + + public class InnerInner { + int outerouterPrivateFieldInitialized() { + pfld = "abc"; + String s = pfld; + return s.length(); + } + } + } + + @Nullable + String getNullable() { + return null; + } + + void testVariableAssigmentInsideConditional() { + String s = null; + if ((s = getNullable()) != null) { + int n = s.length(); + } + } + + void testFieldAssigmentInsideConditional() { + if ((fld = getNullable()) != null) { + int n = fld.length(); + } + } + + String abc = "abc"; + + void testFieldAssignmentIfThenElse(String name) { + String s = (name.length() == 0) ? null : abc; + int n = s.length(); + } + + static String throwsExn() throws java.io.IOException { + throw new java.io.IOException(); + } + + void testExceptionPerInstruction(int z) throws java.io.IOException { + String s = null; + + try { + s = throwsExn(); + } finally { + int n = s.length(); + } + } + + public class InitializeAndExceptions { + String s; + + String bad() throws java.io.IOException { + throw new java.io.IOException(); + } + + InitializeAndExceptions() throws java.io.IOException { + s = bad(); // should not report field not initialized + } + } + + public class InitializeViaPrivateMethod { + String name; + + private void reallyInitName(String s) { + name = s; + } + + private void initName(String s) { + reallyInitName(s); + } + + InitializeViaPrivateMethod() { + initName("abc"); + } + } + + class CheckNotNullVararg { + void checkNotNull(String msg, Object... objects) {} + + void testCheckNotNullVaratg(@Nullable String s1, @Nullable String s2) { + checkNotNull("hello", s1, s2); + s1.isEmpty(); + s2.isEmpty(); + } + + void testRepeatedCheckNotNull(@Nullable String s) { + checkNotNull("abc", s); + checkNotNull("abc", s.toString()); + s.toString().isEmpty(); + } + } + + public void testSystemGetPropertyReturn() { + String s = System.getProperty(""); + int n = s.length(); + } + + int testSystemGetenvBad() { + String envValue = System.getenv("WHATEVER"); + return envValue.length(); + } + + class SystemExitDoesNotReturn { + native boolean whoknows(); + + void testOK() { + String s = null; + if (whoknows()) { + s = "a"; + } else { + System.exit(1); + } + int n = s.length(); + } + } + + public void testMapGetBad( + Map m, HashMap hm, ConcurrentHashMap chm) { + m.get("foo").toString(); + hm.get("foo").toString(); + chm.get("foo").toString(); + } + + public void testMapRemoveBad( + Map m, HashMap hm, ConcurrentHashMap chm) { + m.remove("foo").toString(); + hm.remove("foo").toString(); + chm.remove("foo").toString(); + } + + @Nullable Object nullableField; + + void FP_propagatesNonNullAfterComparisonFieldOkay(Object nonNullObject) { + if (nullableField == nonNullObject) { + nullableField.toString(); + } + } + + void FP_propagatesNonNullAfterComparisonParameterOkay( + @Nullable Object nullableParameter, Object nonNullParameter) { + if (nullableParameter == nonNullParameter) { + nullableParameter.toString(); + } + } + + String customPreconditionsCheckNotNullOkay() { + MyPreconditions.checkNotNull(nullableField); + return nullableField.toString(); + } + + String customPreconditionsCheckStateOkay() { + MyPreconditions.checkState(nullableField != null); + return nullableField.toString(); + } + + String customPreconditionsCheckArgumentOkay(@Nullable Object arg) { + MyPreconditions.checkState(arg != null); + return arg.toString(); + } + + void nullMethodCallWithAlarmManager(AlarmManager manager, @Nullable PendingIntent intent) { + manager.cancel(intent); + } + + String callingSeverSideNullableGetter(ServerSideDeserializer deserializer) { + return deserializer.nullableGetter().toString(); + } + + interface AnotherI { + void withBooleanParameter(boolean test); + + void withObjectParameter(Object object); + } + + void withConjuction(@Nullable AnotherI i, boolean test1, boolean test2) { + i.withBooleanParameter(test1 && test2); + } + + void withConditionalAssignemnt( + @Nullable AnotherI i, boolean test, Object object1, Object object2) { + i.withObjectParameter(test ? object1 : object2); + } + + String assertGetOnMapOK(Map map, Integer key) { + return Assertions.assertGet(key, map).toString(); // No warning here + } + + String assertGetOnListOK(List list, int index) { + return Assertions.assertGet(index, list).toString(); // No warning here + } + + String guavaVerifyNotNullOK(@Nullable Object object) { + Verify.verifyNotNull(object); + return object.toString(); + } + + void nullabilityNotPreservedAfterAssignment() { + if (getNullable() != null) { + Object t = getNullable(); + t.toString(); // Should not warn here + } + } + + void nullabilityStoredInBooleanFP() { + boolean isNotNull = getNullable() != null; + if (isNotNull) { + getNullable().toString(); // Should not warn here + } + } + + void testInAssignmentFP(@Nullable Object object) { + Object t; + while ((t = getNullable()) != null) { + t.toString(); // Should not warn here + } + } + + String testPathGetParent() { + return Paths.get("foo").getParent().toString(); + } + + String testNotDetectingInvariantFP(@Nullable Object object1, @Nullable Object object2) { + if (object1 == null && object2 == null) { + return "both null"; + } + return object1 == null ? object2.toString() : "null"; + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java new file mode 100644 index 000000000..eff61e60e --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +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 { + + boolean field = false; + + ParameterNotNullable() { + testPrimitive(field); + } + + void testPrimitive(boolean f) {} + + void test(String s) { + int n = s.length(); + } + + void testN(@Nullable String s) { + int n = s != null ? s.length() : 0; + } + + void callNull() { + String s = null; + test(s); + } + + @SuppressLint("ERADICATE_PARAMETER_NOT_NULLABLE") + void callNullSuppressed() { + String s = null; + test(s); + } + + void callNullable(@Nullable String s) { + test(s); + } + + void callNullOK() { + String s = null; + testN(s); + } + + void callNullableOK(@Nullable String s) { + testN(s); + } + + private ParameterNotNullable(@Nullable String s) {} + + class Builder { + ParameterNotNullable getEradicateParameterNotNullable() { + return new ParameterNotNullable(null); + } + } + + public @Nullable String testSystemGetPropertyArgument() { + String s = System.getProperty(null); + return s; + } + + @Nullable + String testSystemGetenvBad() { + return System.getenv(null); + } + + static @Nullable URL testClassGetResourceArgument(Class cls) { + return cls.getResource(null); + } + + void threeParameters(String s1, String s2, String s3) {} + + void testThreeParameters() { + String s = ""; + threeParameters(null, s, s); + threeParameters(s, null, s); + threeParameters(s, s, null); + } + + class ConstructorCall { + ConstructorCall(int x, String s) {} + + ConstructorCall() { + this(3, ""); // OK + } + + ConstructorCall(int x) { + this(3, null); // NPE + } + } + + void indirectSignatureLookupOk(SomeClass c) { + c.acceptsNullableParameter(null); + } + + void doesNotAcceptNullableFirstParameter(Object object, boolean test) {} + + void callWithNullableFirstParameter(boolean t1, boolean t2) { + doesNotAcceptNullableFirstParameter(null, t1 && t2); + } + + 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); + } + + void testParsingNullStringToNumber() { + String ns = null; + long l = Long.parseLong(ns); + int i = Integer.parseInt(ns); + } +} + +interface SomeInterface { + void acceptsNullableParameter(@Nullable Object object); +} + +abstract class SomeClass implements SomeInterface {} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/Redundant.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/Redundant.java new file mode 100644 index 000000000..666eb5a3d --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/Redundant.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +public class Redundant { + + void bad() { + String s = "123"; + if (s != null) { + int n = s.length(); + } + } + + static void maythrow() throws java.io.IOException {} + + void good() throws java.io.IOException { + String s = null; + + try { + maythrow(); + s = "123"; + } finally { + if (s != null) { // this is not redundant + int n = s.length(); + } + } + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java new file mode 100644 index 000000000..cec0fcf1b --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import com.google.common.base.Optional; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.net.URL; +import java.util.stream.Stream; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +public class ReturnNotNullable { + + void returnvoid() { + // No warning here. + } + + Void returnVoid() { + // This is OK too. + return null; + } + + // ------------------------------------------------------------ + // Converting different things to not annotated types. + // By default, (not annotated type is treated as non nullable). + + String nullToNotAnnotatedIsBad() { + return null; + } + + String nullableToNotAnnotatedIsBad(@Nullable String s) { + return s; + } + + String notAnnotatedToNotAnnotatedIsOK(String s) { + return s; + } + + String nonNullToNotAnnotatedIsOK(@Nonnull String s) { + return s; + } + + String constantToNotAnnotatedIsOK() { + return "abc"; + } + + // ------------------------------------------------------------ + // Converting different things to @Nonnull. + // (Should be the same as converting to not annotated). + + @Nonnull + String nullToNonnullIsBad() { + return null; + } + + @Nonnull + String nullableToNonnullIsBad(@Nullable String s) { + return s; + } + + @Nonnull + String notAnnotatedToNonnullIsOK(String s) { + return s; + } + + @Nonnull + String nonNullToNonnullIsOK(@Nonnull String s) { + return s; + } + + @Nonnull + String constantToNonNullIsOK() { + return "abc"; + } + + // ------------------------------------------------------------ + // Converting different things to @Nullable. + // This is either + // 1. OK when inferred and annotated return types are both nullable, or + // 2. Leads to ERADICATE_RETURN_OVER_ANNOTATED when inferred return type + // is not nullable, but function is still annotated with @Nullable. + // This often happens when the API author decides to return @Nullable + // (anticipating future change) even though the current implementation returns non-null. + // Because of this the warning is currently turned off by default and is recommended + // to use only in specific scenarious, like code migrations. + + @Nullable + String nullToNullableIsOK() { + return null; + } + + @Nullable + String nullableToNullableIsOK(@Nullable String s) { + return s; + } + + @Nullable + String notAnnotatedNullableIsOverannotated(String s) { + return s; + } + + @Nullable + String nonNullToNullableIsOverannotated(@Nonnull String s) { + return s; + } + + @Nullable + String constantToNullableIsOverannotated() { + return "abc"; + } + + // ------------------------------------------------------- + + String throwException(@Nullable Exception e, boolean bad) throws Exception { + if (bad) { + throw (e); // no ERADICATE_RETURN_NOT_NULLABLE should be reported + } + return "OK"; + } + + @Nullable + String redundantEq() { + String s = constantToNonNullIsOK(); + int n = s == null ? 0 : s.length(); + return s; + } + + @Nullable + String redundantNeq() { + String s = constantToNonNullIsOK(); + int n = s != null ? 0 : s.length(); + return s; + } + + @Nonnull + BufferedReader nn(BufferedReader br) { + return br; + } + + void tryWithResources(String path) { + try (BufferedReader br = nn(new BufferedReader(new FileReader(path)))) { + } // no condition redundant should be reported on this line + catch (IOException e) { + } + } + + Object tryWithResourcesReturnNullable(String path) throws IOException { + try (BufferedReader br = nn(new BufferedReader(new FileReader(path)))) { + return nullToNullableIsOK(); + } + } + + /* + Check that orNull is modelled and RETURN_OVER_ANNOTATED is not returned. + */ + @Nullable + String testOptional(Optional os) { + return os.orNull(); + } + + class E extends Exception {} + + String return_null_in_catch() { + try { + throw new E(); + } catch (E e) { + return null; + } + } + + String return_null_in_catch_after_throw() { + try { + try { + throw new E(); + } catch (E e) { + throw e; + } + } catch (E e) { + return null; + } + } + + URL getResourceNullable(Class cls, String name) { + return cls.getResource(name); + } + + @SomeAnnotationEndingWithNullable + Object ensureWeDontConfuseSuchAnnotationsWithNullable() { + // No warnings expected + return new Object(); + } + + void testSomeAnnotationEndingWithNullable() { + // No warnings expected + ensureWeDontConfuseSuchAnnotationsWithNullable().toString(); + } + + static class ConditionalAssignment { + @Nullable Object f1; + + static Object test(boolean b) { + ConditionalAssignment x = new ConditionalAssignment(); + if (b) { + x.f1 = new Object(); + } + return x.f1; // can be null + } + } + + Stream methodUsesLambda(Stream stream) { + return stream.map(x -> null); // Intentionaly not reporting here + } + + Object $generatedReturnsNullOk() { + return null; + } + + int field; + + int returnsZero() { + field = 0; + return field; + } +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/ServerSideDeserializer.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/ServerSideDeserializer.java new file mode 100644 index 000000000..8984874bc --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/ServerSideDeserializer.java @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +package codetoanalyze.java.nullsafe_gradual; + +import javax.annotation.Nullable; + +@GeneratedGraphQL +public interface ServerSideDeserializer { + + public @Nullable Object nullableGetter(); +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/SomeAnnotationEndingWithNullable.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/SomeAnnotationEndingWithNullable.java new file mode 100644 index 000000000..1c2b51e58 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/SomeAnnotationEndingWithNullable.java @@ -0,0 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +// Test annotation to ensure Infer does not confuse it with @Nullable +@interface SomeAnnotationEndingWithNullable {} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/SuppressedFieldNotInitializedExample.java b/infer/tests/codetoanalyze/java/nullsafe-gradual/SuppressedFieldNotInitializedExample.java new file mode 100644 index 000000000..7c1a57c8c --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/SuppressedFieldNotInitializedExample.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package codetoanalyze.java.nullsafe_gradual; + +import android.annotation.SuppressLint; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.CLASS) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) +@interface SuppressFieldNotInitialized {} + +public class SuppressedFieldNotInitializedExample { + + @SuppressLint("eradicate-field-not-initialized") + String iKnowBetter; + + @SuppressFieldNotInitialized String annotationSuppressed; + + SuppressedFieldNotInitializedExample() {} +} diff --git a/infer/tests/codetoanalyze/java/nullsafe-gradual/issues.exp b/infer/tests/codetoanalyze/java/nullsafe-gradual/issues.exp new file mode 100644 index 000000000..345e74304 --- /dev/null +++ b/infer/tests/codetoanalyze/java/nullsafe-gradual/issues.exp @@ -0,0 +1,127 @@ +codetoanalyze/java/nullsafe-gradual/ActivityFieldNotInitialized.java, codetoanalyze.java.nullsafe_gradual.ActivityFieldNotInitialized$BadActivityWithOnCreate.(codetoanalyze.java.nullsafe_gradual.ActivityFieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `ActivityFieldNotInitialized$BadActivityWithOnCreate.field` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestModeledTrueOnNull.testIsEmptyOrNullBad(java.lang.String):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `string` in the call to `contains(...)` is nullable and is not locally checked for null. (Origin: method parameter string)] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestPropagatesNullable.m12Bad1():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m12(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m12(...) at line 114)] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestPropagatesNullable.m12Bad2():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m12(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m12(...) at line 118)] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestPropagatesNullable.m2Bad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m2(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m2(...) at line 101)] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestPropagatesNullable.mBad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m(...)` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to m(...) at line 79)] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestTextUtilsIsEmpty.myTextUtilsIsEmpty(java.lang.CharSequence):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestTextUtilsIsEmpty.myTextUtilsNotIsNotEmpty(java.lang.CharSequence):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestTextUtilsIsEmpty.textUtilsIsEmpty(java.lang.CharSequence):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`TextUtils.isEmpty(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestTextUtilsIsEmpty.textUtilsIsEmpty(java.lang.CharSequence):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-gradual/CustomAnnotations.java, codetoanalyze.java.nullsafe_gradual.CustomAnnotations$TestTextUtilsIsEmpty.textUtilsNotIsEmpty(java.lang.CharSequence):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`TextUtils.isEmpty(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java, codetoanalyze.java.nullsafe_gradual.FieldNotInitialized$ConditionalFieldInit.(codetoanalyze.java.nullsafe_gradual.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$ConditionalFieldInit.o1` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java, codetoanalyze.java.nullsafe_gradual.FieldNotInitialized$InitCircular.(codetoanalyze.java.nullsafe_gradual.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$InitCircular.s` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java, codetoanalyze.java.nullsafe_gradual.FieldNotInitialized$OnlyRead.(codetoanalyze.java.nullsafe_gradual.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$OnlyRead.o` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java, codetoanalyze.java.nullsafe_gradual.FieldNotInitialized$OnlyReadIndirect.(codetoanalyze.java.nullsafe_gradual.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$OnlyReadIndirect.o1` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java, codetoanalyze.java.nullsafe_gradual.FieldNotInitialized$Swap.(codetoanalyze.java.nullsafe_gradual.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$Swap.o1` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java, codetoanalyze.java.nullsafe_gradual.FieldNotInitialized$WriteItself.(codetoanalyze.java.nullsafe_gradual.FieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized$WriteItself.o` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-gradual/FieldNotInitialized.java, codetoanalyze.java.nullsafe_gradual.FieldNotInitialized.(), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FieldNotInitialized.a` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.FieldNotNullable.(java.lang.Integer), -25, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.static_s` can be null but is not declared `@Nullable`. (Origin: null constant at line 44)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.FieldNotNullable.(java.lang.String), -2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.static_s` can be null but is not declared `@Nullable`. (Origin: null constant at line 44)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.FieldNotNullable.setYNull():void, 1, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.y` can be null but is not declared `@Nullable`. (Origin: null constant at line 62)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.FieldNotNullable.setYNullable(java.lang.String):void, 1, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `FieldNotNullable.y` can be null but is not declared `@Nullable`. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.FragmentExample.(), 0, ERADICATE_FIELD_NOT_INITIALIZED, no_bucket, WARNING, [Field `FragmentExample.view` is not initialized in the constructor and is not declared `@Nullable`] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.NestedFieldAccess$TestFunctionsIdempotent.FlatBAD1(codetoanalyze.java.nullsafe_gradual.NestedFieldAccess$TestFunctionsIdempotent):void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 258)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.NestedFieldAccess$TestFunctionsIdempotent.FlatBAD2(codetoanalyze.java.nullsafe_gradual.NestedFieldAccess$TestFunctionsIdempotent):void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 264)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.NestedFieldAccess$TestFunctionsIdempotent.NestedBAD1():void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 282)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.NestedFieldAccess$TestFunctionsIdempotent.NestedBAD2():void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 288)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.NestedFieldAccess$TestFunctionsIdempotent.NestedBAD3():void, 2, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestFunctionsIdempotent.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: call to getS(...) at line 294)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.NestedFieldAccess$TestPut.putNull(java.util.Map,java.lang.String):void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Map.put(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 332)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.NestedFieldAccess$TestPut.putNull(java.util.Map,java.lang.String):void, 3, ERADICATE_FIELD_NOT_NULLABLE, no_bucket, WARNING, [Field `NestedFieldAccess$TestPut.dontAssignNull` can be null but is not declared `@Nullable`. (Origin: null constant at line 332)] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.TestInitializerBuilder.build():codetoanalyze.java.nullsafe_gradual.TestInitializer, 2, ERADICATE_CONDITION_REDUNDANT, no_bucket, WARNING, [The condition TestInitializerBuilder.required1 is always true according to the existing annotations.] +codetoanalyze/java/nullsafe-gradual/FieldNotNullable.java, codetoanalyze.java.nullsafe_gradual.TestInitializerBuilder.build():codetoanalyze.java.nullsafe_gradual.TestInitializer, 2, ERADICATE_CONDITION_REDUNDANT, no_bucket, WARNING, [The condition TestInitializerBuilder.required2 is always true according to the existing annotations.] +codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_gradual.ExtendsExternalLibrary.externalMethod2(java.lang.Object):void, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `object` of method `ExtendsExternalLibrary.externalMethod2(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `SomeExternalClass.externalMethod2(...)`.] +codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_gradual.InconsistentSubclassAnnotation.implementInAnotherFile(java.lang.String):java.lang.String, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `s` of method `InconsistentSubclassAnnotation.implementInAnotherFile(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `InconsistentSubclassAnnotationInterface.implementInAnotherFile(...)`.] +codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_gradual.InconsistentSubclassAnnotation.overloadedMethod():java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `InconsistentSubclassAnnotation.overloadedMethod()` is annotated with `@Nullable` but overrides unannotated method `InconsistentSubclassAnnotationInterface.overloadedMethod()`.] +codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_gradual.Sub.overloadingMethodLookupFP(java.lang.Object):java.lang.String, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `Sub.overloadingMethodLookupFP(...)` is annotated with `@Nullable` but overrides unannotated method `Super.overloadingMethodLookupFP(...)`.] +codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_gradual.SubclassExample$B.foo():codetoanalyze.java.nullsafe_gradual.SubclassExample$T, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `SubclassExample$B.foo()` is annotated with `@Nullable` but overrides unannotated method `SubclassExample$A.foo()`.] +codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_gradual.SubclassExample$C.baz():codetoanalyze.java.nullsafe_gradual.SubclassExample$T, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `SubclassExample$C.baz()` is annotated with `@Nullable` but overrides unannotated method `SubclassExample$I.baz()`.] +codetoanalyze/java/nullsafe-gradual/InconsistentSubclassAnnotation.java, codetoanalyze.java.nullsafe_gradual.SubclassExample$D.deref(codetoanalyze.java.nullsafe_gradual.SubclassExample$T):void, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `t` of method `SubclassExample$D.deref(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `SubclassExample$A.deref(...)`.] +codetoanalyze/java/nullsafe-gradual/LibraryCalls.java, codetoanalyze.java.nullsafe_gradual.LibraryCalls.badAtomicReferenceDereference(java.util.concurrent.atomic.AtomicReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 35)] +codetoanalyze/java/nullsafe-gradual/LibraryCalls.java, codetoanalyze.java.nullsafe_gradual.LibraryCalls.badPhantomReferenceDereference(java.lang.ref.PhantomReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 27)] +codetoanalyze/java/nullsafe-gradual/LibraryCalls.java, codetoanalyze.java.nullsafe_gradual.LibraryCalls.badReferenceDereference(java.lang.ref.Reference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 19)] +codetoanalyze/java/nullsafe-gradual/LibraryCalls.java, codetoanalyze.java.nullsafe_gradual.LibraryCalls.badSoftReferenceDereference(java.lang.ref.SoftReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 31)] +codetoanalyze/java/nullsafe-gradual/LibraryCalls.java, codetoanalyze.java.nullsafe_gradual.LibraryCalls.badWeakReferenceDereference(java.lang.ref.WeakReference):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ref.get()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get() modelled in modelTables.ml at line 23)] +codetoanalyze/java/nullsafe-gradual/NullFieldAccess.java, codetoanalyze.java.nullsafe_gradual.NullFieldAccess.arrayAccess():java.lang.Object, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `NullFieldAccess.objects` is nullable and is not locally checked for null when accessing element at index `0`. (Origin: field NullFieldAccess.objects at line 56)] +codetoanalyze/java/nullsafe-gradual/NullFieldAccess.java, codetoanalyze.java.nullsafe_gradual.NullFieldAccess.arrayLength():int, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `NullFieldAccess.objects` is nullable and is not locally checked for null when accessing field `length`. (Origin: field NullFieldAccess.objects at line 52)] +codetoanalyze/java/nullsafe-gradual/NullFieldAccess.java, codetoanalyze.java.nullsafe_gradual.NullFieldAccess.useInterface(codetoanalyze.java.nullsafe_gradual.NullFieldAccess$I):int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `c` is nullable and is not locally checked for null when accessing field `NullFieldAccess$C.n`. (Origin: field NullFieldAccess$I.c at line 45)] +codetoanalyze/java/nullsafe-gradual/NullFieldAccess.java, codetoanalyze.java.nullsafe_gradual.NullFieldAccess.useX():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `c` is nullable and is not locally checked for null when accessing field `NullFieldAccess$C.n`. (Origin: field NullFieldAccess.x at line 30)] +codetoanalyze/java/nullsafe-gradual/NullFieldAccess.java, codetoanalyze.java.nullsafe_gradual.NullFieldAccess.useZ():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `c` is nullable and is not locally checked for null when accessing field `NullFieldAccess$C.n`. (Origin: field NullFieldAccess.z at line 40)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall$Inner.outerField():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NullMethodCall.fld at line 69)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall$Inner.outerPrivateField():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NullMethodCall.pfld at line 80)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.FP_propagatesNonNullAfterComparisonFieldOkay(java.lang.Object):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `NullMethodCall.nullableField` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field NullMethodCall.nullableField at line 275)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.FP_propagatesNonNullAfterComparisonParameterOkay(java.lang.Object,java.lang.Object):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `nullableParameter` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter nullableParameter)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.callOnNull():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: null constant at line 25)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.callingSeverSideNullableGetter(codetoanalyze.java.nullsafe_gradual.ServerSideDeserializer):java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, ERROR, [The value of `deserializer.nullableGetter()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to nullableGetter() at line 307)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.nullMethodCallWithAlarmManager(android.app.AlarmManager,android.app.PendingIntent):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`AlarmManager.cancel(...)` needs a non-null value in parameter 1 but argument `intent` can be null. (Origin: method parameter intent)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.nullabilityNotPreservedAfterAssignment():void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `t` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getNullable() at line 340)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.nullabilityStoredInBooleanFP():void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `getNullable()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getNullable() at line 346)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testExceptionPerInstruction(int):void, 6, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: null constant at line 181)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testFieldAssignmentIfThenElse(java.lang.String):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: null constant at line 172)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testInAssignmentFP(java.lang.Object):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `t` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getNullable() at line 354)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testMapGetBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m.get(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get(...) modelled in modelTables.ml at line 260)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testMapGetBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `hm.get(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get(...) modelled in modelTables.ml at line 261)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testMapGetBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 4, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `chm.get(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to get(...) modelled in modelTables.ml at line 262)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testMapRemoveBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `m.remove(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to remove(...) modelled in modelTables.ml at line 267)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testMapRemoveBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `hm.remove(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to remove(...) modelled in modelTables.ml at line 268)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testMapRemoveBad(java.util.Map,java.util.HashMap,java.util.concurrent.ConcurrentHashMap):void, 4, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `chm.remove(...)` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to remove(...) modelled in modelTables.ml at line 269)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testNotDetectingInvariantFP(java.lang.Object,java.lang.Object):java.lang.String, 4, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `object2` in the call to `toString()` is nullable and is not locally checked for null. (Origin: method parameter object2)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testPathGetParent():java.lang.String, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `get(...).getParent()` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to getParent() modelled in modelTables.ml at line 360)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testSystemGetPropertyReturn():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `s` in the call to `length()` is nullable and is not locally checked for null. (Origin: call to getProperty(...) modelled in modelTables.ml at line 235)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.testSystemGetenvBad():int, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [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 240)] +codetoanalyze/java/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.withConditionalAssignemnt(codetoanalyze.java.nullsafe_gradual.NullMethodCall$AnotherI,boolean,java.lang.Object,java.lang.Object):void, 2, ERADICATE_NULLABLE_DEREFERENCE, 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/nullsafe-gradual/NullMethodCall.java, codetoanalyze.java.nullsafe_gradual.NullMethodCall.withConjuction(codetoanalyze.java.nullsafe_gradual.NullMethodCall$AnotherI,boolean,boolean):void, 1, ERADICATE_NULLABLE_DEREFERENCE, 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/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable$ConstructorCall.(codetoanalyze.java.nullsafe_gradual.ParameterNotNullable,int), 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable$ConstructorCall(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 101)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.callNull():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.test(...)` needs a non-null value in parameter 1 but argument `s` can be null. (Origin: null constant at line 39)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.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/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.callWithConditionalAssignment(java.lang.Object,boolean):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.doesNotAcceptNullableFirstParameter(...)` needs a non-null value in parameter 1 but argument `object` can be null. (Origin: null constant at line 116)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.callWithNullableFirstParameter(boolean,boolean):void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`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/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testClassGetResourceArgument(java.lang.Class):java.net.URL, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Class.getResource(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 81)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableListCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterable` can be null. (Origin: null constant at line 131)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableListCopyOfNotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterator` can be null. (Origin: null constant at line 132)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableListCopyOfNotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.copyOf(...)` needs a non-null value in parameter 1 but argument `nullCollection` can be null. (Origin: null constant at line 133)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 123)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 124)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 124)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableListOfnotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 126)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableListSortedCopyOfNotNullArguments():void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.sortedCopyOf(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 141)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableListSortedCopyOfNotNullArguments():void, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableList.sortedCopyOf(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 141)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableMapCopyOfNotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterable` can be null. (Origin: null constant at line 177)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableMapCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.copyOf(...)` needs a non-null value in parameter 1 but argument `nullMap` can be null. (Origin: null constant at line 178)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 170)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 170)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 172)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableMapOfnotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableMap.of(...)` needs a non-null value in parameter 4 but argument `null` can be null. (Origin: null constant at line 172)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableSetCopyOfNotNullArguments():void, 6, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterable` can be null. (Origin: null constant at line 157)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableSetCopyOfNotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.copyOf(...)` needs a non-null value in parameter 1 but argument `nullIterator` can be null. (Origin: null constant at line 158)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableSetCopyOfNotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.copyOf(...)` needs a non-null value in parameter 1 but argument `nullCollection` can be null. (Origin: null constant at line 159)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 148)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 149)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 5, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 149)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 151)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 152)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ImmutableSet.of(...)` needs a non-null value in parameter 4 but argument `null` can be null. (Origin: null constant at line 152)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testParsingNullStringToNumber():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Long.parseLong(...)` needs a non-null value in parameter 1 but argument `ns` can be null. (Origin: null constant at line 185)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testParsingNullStringToNumber():void, 3, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`Integer.parseInt(...)` needs a non-null value in parameter 1 but argument `ns` can be null. (Origin: null constant at line 185)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testSystemGetPropertyArgument():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`System.getProperty(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 71)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testSystemGetenvBad():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`System.getenv(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 77)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testThreeParameters():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 88)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testThreeParameters():void, 3, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 89)] +codetoanalyze/java/nullsafe-gradual/ParameterNotNullable.java, codetoanalyze.java.nullsafe_gradual.ParameterNotNullable.testThreeParameters():void, 4, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 3 but argument `null` can be null. (Origin: null constant at line 90)] +codetoanalyze/java/nullsafe-gradual/Redundant.java, Redundant.bad():void, 2, ERADICATE_CONDITION_REDUNDANT, no_bucket, WARNING, [The condition s is always true according to the existing annotations.] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable$ConditionalAssignment.test(boolean):java.lang.Object, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `test(...)` may return null but it is not annotated with `@Nullable`. (Origin: field ReturnNotNullable$ConditionalAssignment.f1 at line 213)] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.constantToNullableIsOverannotated():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `constantToNullableIsOverannotated()` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.getResourceNullable(java.lang.Class,java.lang.String):java.net.URL, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `getResourceNullable(...)` may return null but it is not annotated with `@Nullable`. (Origin: call to getResource(...) modelled in modelTables.ml at line 191)] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.nonNullToNullableIsOverannotated(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `nonNullToNullableIsOverannotated(...)` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.notAnnotatedNullableIsOverannotated(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `notAnnotatedNullableIsOverannotated(...)` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.nullToNonnullIsBad():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullToNonnullIsBad()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 60)] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.nullToNotAnnotatedIsBad():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullToNotAnnotatedIsBad()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 35)] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.nullableToNonnullIsBad(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullableToNonnullIsBad(...)` may return null but it is not annotated with `@Nullable`. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.nullableToNotAnnotatedIsBad(java.lang.String):java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `nullableToNotAnnotatedIsBad(...)` may return null but it is not annotated with `@Nullable`. (Origin: method parameter s)] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.redundantEq():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `redundantEq()` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.redundantEq():java.lang.String, 2, ERADICATE_CONDITION_REDUNDANT_NONNULL, no_bucket, WARNING, [The condition s is always false according to the existing annotations.] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.redundantNeq():java.lang.String, 0, ERADICATE_RETURN_OVER_ANNOTATED, no_bucket, WARNING, [Method `redundantNeq()` is annotated with `@Nullable` but never returns null.] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.redundantNeq():java.lang.String, 2, ERADICATE_CONDITION_REDUNDANT_NONNULL, no_bucket, WARNING, [The condition s is always true according to the existing annotations.] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.return_null_in_catch():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `return_null_in_catch()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 174)] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.return_null_in_catch_after_throw():java.lang.String, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `return_null_in_catch_after_throw()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 186)] +codetoanalyze/java/nullsafe-gradual/ReturnNotNullable.java, codetoanalyze.java.nullsafe_gradual.ReturnNotNullable.tryWithResourcesReturnNullable(java.lang.String):java.lang.Object, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `tryWithResourcesReturnNullable(...)` may return null but it is not annotated with `@Nullable`. (Origin: call to nullToNullableIsOK() at line 156)]