Summary: This is to fix the conflicts between Eradicate and the Biabduction when reporting the same kind of errors: when Eradicate is on, the Eradicate warnings will have priority over the null deference reported by the biabduction. If this approach proved to be successful in prod, I will refactor the reporting mechanism in the analysis itself to simply not report the null dereference in this case at all. For the codebases that aren't yet fully consistently using `Nullable`, this combined approach looks like a good way to deploy Infer toward full null safety. Reviewed By: mbouaziz Differential Revision: D7102119 fbshipit-source-id: 35d3addmaster
parent
c1d0709fe9
commit
79276d26bf
@ -1,8 +1,11 @@
|
|||||||
infer/tests/build_systems/genrule/module1/Class1.java, void Class1.localNPE1(), 2, NULL_DEREFERENCE, [start of procedure localNPE1()]
|
infer/tests/build_systems/genrule/module1/Class1.java, Object Class1.unannotatedReturnNull(), 0, ERADICATE_RETURN_NOT_NULLABLE, [origin,Method `unannotatedReturnNull()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 35)]
|
||||||
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.dereferenceInterTargetFieldBad(Class1), 1, NULL_DEREFERENCE, [start of procedure dereferenceInterTargetFieldBad(...)]
|
infer/tests/build_systems/genrule/module1/Class1.java, void Class1.localNPE1(), 2, ERADICATE_NULL_METHOD_CALL, [origin,The value of `obj` in the call to `toString()` could be null. (Origin: null constant at line 26)]
|
||||||
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.dereferenceLocalNullableFieldBad(), 1, NULL_DEREFERENCE, [start of procedure dereferenceLocalNullableFieldBad()]
|
infer/tests/build_systems/genrule/module2/Class2.java, int Class2.dereferenceInterTargetField2Bad(Class1), 1, ERADICATE_NULL_FIELD_ACCESS, [origin,Object `class1.field2` could be null when accessing field `Class1.x`. (Origin: field Class1.field2 at line 59)]
|
||||||
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.followMethodDeclarationOnlyBad(SkipImplementationClass1), 2, NULL_DEREFERENCE, [start of procedure followMethodDeclarationOnlyBad(...),Skipping annotatedNullable(): method has no implementation,Definition of annotatedNullable()]
|
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.dereferenceInterTargetField1Bad(Class1), 1, ERADICATE_NULL_METHOD_CALL, [origin,The value of `class1.field1` in the call to `toString()` could be null. (Origin: field Class1.field1 at line 55)]
|
||||||
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.interTargetAbstractNPEBad(Class1), 2, NULL_DEREFERENCE, [start of procedure interTargetAbstractNPEBad(...),Skipping abstractMayReturnNull(): abstract method,Definition of abstractMayReturnNull()]
|
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.dereferenceLocalNullableFieldBad(), 1, ERADICATE_NULL_METHOD_CALL, [origin,The value of `Class2.field` in the call to `toString()` could be null. (Origin: field Class2.field at line 51)]
|
||||||
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.interTargetNPEBad(), 2, NULL_DEREFERENCE, [start of procedure interTargetNPEBad(),start of procedure returnsNull(),return from a call to String Class1.returnsNull()]
|
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.dereferenceUnannotatedMethodReturningNullBad(Class1), 1, NULL_DEREFERENCE, [start of procedure dereferenceUnannotatedMethodReturningNullBad(...),start of procedure unannotatedReturnNull(),return from a call to Object Class1.unannotatedReturnNull()]
|
||||||
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.interTargetNativeNPEBad(Class1), 2, NULL_DEREFERENCE, [start of procedure interTargetNativeNPEBad(...),Skipping nativeMayReturnNull(): method has no implementation,Definition of nativeMayReturnNull()]
|
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.followMethodDeclarationOnlyBad(SkipImplementationClass1), 2, ERADICATE_NULL_METHOD_CALL, [origin,The value of `obj2` in the call to `toString()` could be null. (Origin: call to annotatedNullable() at line 41)]
|
||||||
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.localNPE2Bad(), 2, NULL_DEREFERENCE, [start of procedure localNPE2Bad()]
|
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.interTargetAbstractNPEBad(Class1), 2, ERADICATE_NULL_METHOD_CALL, [origin,The value of `obj` in the call to `toString()` could be null. (Origin: call to abstractMayReturnNull() at line 31)]
|
||||||
|
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.interTargetNPEBad(), 2, ERADICATE_NULL_METHOD_CALL, [origin,The value of `obj` in the call to `toString()` could be null. (Origin: call to returnsNull() at line 26)]
|
||||||
|
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.interTargetNativeNPEBad(Class1), 2, ERADICATE_NULL_METHOD_CALL, [origin,The value of `obj` in the call to `toString()` could be null. (Origin: call to nativeMayReturnNull() at line 36)]
|
||||||
|
infer/tests/build_systems/genrule/module2/Class2.java, void Class2.localNPE2Bad(), 2, ERADICATE_NULL_METHOD_CALL, [origin,The value of `obj` in the call to `toString()` could be null. (Origin: null constant at line 21)]
|
||||||
|
Loading…
Reference in new issue