Summary:
Get rid of helper class `C`, normal Object serves the same goal well
Don't return values from a function, focus only on nullable
dereferences.
Reviewed By: jberdine
Differential Revision: D17314569
fbshipit-source-id: d70e66b5f
master
Mitya Lyubarskiy5 years agocommitted byFacebook Github Bot
codetoanalyze/java/nullsafe-default/NestedFieldAccess.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestNullableChains.param_AccessWithoutNullCheckIsBad(codetoanalyze.java.nullsafe_default.NestedFieldAccess$C):void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `c.s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NestedFieldAccess$C.s at line 65)]
codetoanalyze/java/nullsafe-default/NestedFieldAccess.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestNullableChains.param_AccessWithoutNullCheckIsBad(codetoanalyze.java.nullsafe_default.NestedFieldAccess$C):void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `c.s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NestedFieldAccess$C.s at line 65)]
codetoanalyze/java/nullsafe-default/NestedFieldAccess.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestNullableChains.veryDeep_AccessWithoutNullCheckIsBad(codetoanalyze.java.nullsafe_default.NestedFieldAccess$CCC):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ccc.cc.c.s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NestedFieldAccess$C.s at line 100)]
codetoanalyze/java/nullsafe-default/NestedFieldAccess.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestNullableChains.veryDeep_AccessWithoutNullCheckIsBad(codetoanalyze.java.nullsafe_default.NestedFieldAccess$CCC):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ccc.cc.c.s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NestedFieldAccess$C.s at line 100)]
codetoanalyze/java/nullsafe-default/NestedFieldAccess.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestNullableChains.veryDeep_IncompleteAccessViaOrEarlyReturnIsBad(codetoanalyze.java.nullsafe_default.NestedFieldAccess$CCC):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ccc.cc.c.s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NestedFieldAccess$C.s at line 114)]
codetoanalyze/java/nullsafe-default/NestedFieldAccess.java, codetoanalyze.java.nullsafe_default.NestedFieldAccess$TestNullableChains.veryDeep_IncompleteAccessViaOrEarlyReturnIsBad(codetoanalyze.java.nullsafe_default.NestedFieldAccess$CCC):void, 3, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `ccc.cc.c.s` in the call to `length()` is nullable and is not locally checked for null. (Origin: field NestedFieldAccess$C.s at line 114)]
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.testArray():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `NullFieldAccess.nullableArray` is nullable and is not locally checked for null when accessing field `length`. (Origin: field NullFieldAccess.nullableArray at line 60)]
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.testArray():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `NullFieldAccess.nullableArray` is nullable and is not locally checked for null when accessing element at index `0`. (Origin: field NullFieldAccess.nullableArray at line 60)]
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.testInterface():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `bad` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field NullFieldAccess$I.nullable at line 52)]
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.testNonStaticFields():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `bad` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field NullFieldAccess.nullable at line 36)]
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/NullFieldAccess.java, codetoanalyze.java.nullsafe_default.NullFieldAccess.testStatic():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `bad` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field NullFieldAccess.nullableStatic at line 44)]
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.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$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_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)]