Summary: When multiple buck java tests use the same `buck-out` they sometimes fail. This isn't surprising, as they presumably clobber each other's output when running on the same files. Since there is no reason to have this global, shared buck repo, create one for each test, inside the test directory. Also, clean up the Makefiles a bit -- they provide bogus compile targets, for example, and have mostly wrong source dependencies. That done, remove the `testlock` crutch which enforces mutual exclusion between tests, from the buck/java tests. I do not understand why the buck clang tests can share the global repo without failure, but there you go. Reviewed By: jvillard Differential Revision: D15579133 fbshipit-source-id: 7eff79173master
parent
66c45a7f54
commit
768e2b0332
@ -0,0 +1,9 @@
|
||||
[buildfile]
|
||||
includes = //DEFS
|
||||
|
||||
[project]
|
||||
ignore = .git, .ml, .mli
|
||||
|
||||
[java]
|
||||
source_level = 8
|
||||
target_level = 8
|
@ -0,0 +1 @@
|
||||
../../../../.buckversion
|
@ -0,0 +1,7 @@
|
||||
java_library(
|
||||
name='annotations',
|
||||
srcs=['Nullable.java'],
|
||||
visibility=[
|
||||
'PUBLIC'
|
||||
],
|
||||
)
|
@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 2018-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
package genrule.annotations;
|
||||
|
||||
public @interface Nullable {}
|
@ -1,22 +1,22 @@
|
||||
infer/tests/build_systems/genrule/module1/Class1.java, genrule.module1.Class1.localNPE1():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: null constant at line 24)]
|
||||
infer/tests/build_systems/genrule/module1/Class1.java, genrule.module1.Class1.localNPE1():void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure localNPE1()]
|
||||
infer/tests/build_systems/genrule/module1/Class1.java, genrule.module1.Class1.unannotatedReturnNull():java.lang.Object, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `unannotatedReturnNull()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 33)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2$Sub.subtypingInconsistency(java.lang.Object):java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `object` of method `Class2$Sub.subtypingInconsistency(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `Class1$Sub.subtypingInconsistency(...)`.]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2$Sub.subtypingInconsistency(java.lang.Object):java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `Class2$Sub.subtypingInconsistency(...)` is annotated with `@Nullable` but overrides unannotated method `Class1$Sub.subtypingInconsistency(...)`.]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField1Bad(genrule.module1.Class1):void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `class1.field1` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field Class1.field1 at line 53)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField1Bad(genrule.module1.Class1):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure dereferenceInterTargetField1Bad(...)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField2Bad(genrule.module1.Class1):int, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `class1.field2` is nullable and is not locally checked for null when accessing field `Class1.x`. (Origin: field Class1.field2 at line 57)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField2Bad(genrule.module1.Class1):int, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure dereferenceInterTargetField2Bad(...)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceLocalNullableFieldBad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `Class2.field` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field Class2.field at line 49)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceLocalNullableFieldBad():void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure dereferenceLocalNullableFieldBad()]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceUnannotatedMethodReturningNullBad(genrule.module1.Class1):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure dereferenceUnannotatedMethodReturningNullBad(...),start of procedure unannotatedReturnNull(),return from a call to Object Class1.unannotatedReturnNull()]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.followMethodDeclarationOnlyBad(genrule.module1.SkipImplementationClass1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj2` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to annotatedNullable() at line 39)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.followMethodDeclarationOnlyBad(genrule.module1.SkipImplementationClass1):void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure followMethodDeclarationOnlyBad(...),Skipping annotatedNullable(): unknown method]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.interTargetAbstractNPEBad(genrule.module1.Class1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to abstractMayReturnNull() at line 29)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.interTargetAbstractNPEBad(genrule.module1.Class1):void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure interTargetAbstractNPEBad(...),Skipping abstractMayReturnNull(): unknown method]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.interTargetNPEBad():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to returnsNull() at line 24)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.interTargetNPEBad():void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure interTargetNPEBad(),start of procedure returnsNull(),return from a call to String Class1.returnsNull()]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.interTargetNativeNPEBad(genrule.module1.Class1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to nativeMayReturnNull() at line 34)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.interTargetNativeNPEBad(genrule.module1.Class1):void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure interTargetNativeNPEBad(...),Skipping nativeMayReturnNull(): unknown method]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.localNPE2Bad():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: null constant at line 19)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.localNPE2Bad():void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure localNPE2Bad()]
|
||||
module1/Class1.java, genrule.module1.Class1.localNPE1():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: null constant at line 24)]
|
||||
module1/Class1.java, genrule.module1.Class1.localNPE1():void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure localNPE1()]
|
||||
module1/Class1.java, genrule.module1.Class1.unannotatedReturnNull():java.lang.Object, 0, ERADICATE_RETURN_NOT_NULLABLE, no_bucket, WARNING, [Method `unannotatedReturnNull()` may return null but it is not annotated with `@Nullable`. (Origin: null constant at line 33)]
|
||||
module2/Class2.java, genrule.module2.Class2$Sub.subtypingInconsistency(java.lang.Object):java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `object` of method `Class2$Sub.subtypingInconsistency(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `Class1$Sub.subtypingInconsistency(...)`.]
|
||||
module2/Class2.java, genrule.module2.Class2$Sub.subtypingInconsistency(java.lang.Object):java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `Class2$Sub.subtypingInconsistency(...)` is annotated with `@Nullable` but overrides unannotated method `Class1$Sub.subtypingInconsistency(...)`.]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField1Bad(genrule.module1.Class1):void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `class1.field1` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field Class1.field1 at line 53)]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField1Bad(genrule.module1.Class1):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure dereferenceInterTargetField1Bad(...)]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField2Bad(genrule.module1.Class1):int, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `class1.field2` is nullable and is not locally checked for null when accessing field `Class1.x`. (Origin: field Class1.field2 at line 57)]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField2Bad(genrule.module1.Class1):int, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure dereferenceInterTargetField2Bad(...)]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceLocalNullableFieldBad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `Class2.field` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field Class2.field at line 49)]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceLocalNullableFieldBad():void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure dereferenceLocalNullableFieldBad()]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceUnannotatedMethodReturningNullBad(genrule.module1.Class1):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure dereferenceUnannotatedMethodReturningNullBad(...),start of procedure unannotatedReturnNull(),return from a call to Object Class1.unannotatedReturnNull()]
|
||||
module2/Class2.java, genrule.module2.Class2.followMethodDeclarationOnlyBad(genrule.module1.SkipImplementationClass1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj2` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to annotatedNullable() at line 39)]
|
||||
module2/Class2.java, genrule.module2.Class2.followMethodDeclarationOnlyBad(genrule.module1.SkipImplementationClass1):void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure followMethodDeclarationOnlyBad(...),Skipping annotatedNullable(): unknown method]
|
||||
module2/Class2.java, genrule.module2.Class2.interTargetAbstractNPEBad(genrule.module1.Class1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to abstractMayReturnNull() at line 29)]
|
||||
module2/Class2.java, genrule.module2.Class2.interTargetAbstractNPEBad(genrule.module1.Class1):void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure interTargetAbstractNPEBad(...),Skipping abstractMayReturnNull(): unknown method]
|
||||
module2/Class2.java, genrule.module2.Class2.interTargetNPEBad():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to returnsNull() at line 24)]
|
||||
module2/Class2.java, genrule.module2.Class2.interTargetNPEBad():void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure interTargetNPEBad(),start of procedure returnsNull(),return from a call to String Class1.returnsNull()]
|
||||
module2/Class2.java, genrule.module2.Class2.interTargetNativeNPEBad(genrule.module1.Class1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to nativeMayReturnNull() at line 34)]
|
||||
module2/Class2.java, genrule.module2.Class2.interTargetNativeNPEBad(genrule.module1.Class1):void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure interTargetNativeNPEBad(...),Skipping nativeMayReturnNull(): unknown method]
|
||||
module2/Class2.java, genrule.module2.Class2.localNPE2Bad():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: null constant at line 19)]
|
||||
module2/Class2.java, genrule.module2.Class2.localNPE2Bad():void, 2, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure localNPE2Bad()]
|
||||
|
@ -0,0 +1,10 @@
|
||||
java_library(
|
||||
name='module1',
|
||||
srcs=glob(["*.java"]),
|
||||
deps=[
|
||||
'//annotations:annotations',
|
||||
],
|
||||
visibility=[
|
||||
'PUBLIC'
|
||||
],
|
||||
)
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package genrule.module1;
|
||||
|
||||
import genrule.annotations.Nullable;
|
||||
|
||||
public abstract class Class1 {
|
||||
|
||||
public @Nullable Object field1;
|
||||
|
||||
public int x;
|
||||
public @Nullable Class1 field2;
|
||||
|
||||
public static @Nullable String returnsNull() {
|
||||
return null;
|
||||
}
|
||||
|
||||
void localNPE1() {
|
||||
Object obj = null;
|
||||
obj.toString();
|
||||
}
|
||||
|
||||
public abstract @Nullable Object abstractMayReturnNull();
|
||||
|
||||
public native @Nullable Object nativeMayReturnNull();
|
||||
|
||||
public Object unannotatedReturnNull() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static class Sub {
|
||||
public Object subtypingInconsistency(@Nullable Object object) {
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
// _SHOULD_SKIP_IMPLEMENTATION_
|
||||
|
||||
package genrule.module1;
|
||||
|
||||
import genrule.annotations.Nullable;
|
||||
|
||||
public class SkipImplementationClass1 {
|
||||
|
||||
public @Nullable Object annotatedNullable() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
public Object notAnnotatedNullable() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
java_library(
|
||||
name='module2',
|
||||
srcs=glob(["*.java"]),
|
||||
deps=[
|
||||
'//module1:module1',
|
||||
'//annotations:annotations',
|
||||
]
|
||||
)
|
@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Copyright (c) 2017-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package genrule.module2;
|
||||
|
||||
import genrule.annotations.Nullable;
|
||||
import genrule.module1.Class1;
|
||||
import genrule.module1.SkipImplementationClass1;
|
||||
|
||||
public class Class2 {
|
||||
|
||||
@Nullable Object field;
|
||||
|
||||
void localNPE2Bad() {
|
||||
Object obj = null;
|
||||
obj.toString();
|
||||
}
|
||||
|
||||
void interTargetNPEBad() {
|
||||
Object obj = Class1.returnsNull();
|
||||
obj.toString();
|
||||
}
|
||||
|
||||
void interTargetAbstractNPEBad(Class1 class1) {
|
||||
Object obj = class1.abstractMayReturnNull();
|
||||
obj.toString();
|
||||
}
|
||||
|
||||
void interTargetNativeNPEBad(Class1 class1) {
|
||||
Object obj = class1.nativeMayReturnNull();
|
||||
obj.toString();
|
||||
}
|
||||
|
||||
void followMethodDeclarationOnlyBad(SkipImplementationClass1 obj1) {
|
||||
Object obj2 = obj1.annotatedNullable();
|
||||
obj2.toString();
|
||||
}
|
||||
|
||||
void followMethodDeclarationOnlyOk(SkipImplementationClass1 obj1) {
|
||||
Object obj2 = obj1.notAnnotatedNullable();
|
||||
obj2.toString();
|
||||
}
|
||||
|
||||
void dereferenceLocalNullableFieldBad() {
|
||||
field.toString();
|
||||
}
|
||||
|
||||
void dereferenceInterTargetField1Bad(Class1 class1) {
|
||||
class1.field1.toString();
|
||||
}
|
||||
|
||||
int dereferenceInterTargetField2Bad(Class1 class1) {
|
||||
return class1.field2.x;
|
||||
}
|
||||
|
||||
void dereferenceUnannotatedMethodReturningNullBad(Class1 class1) {
|
||||
class1.unannotatedReturnNull().toString();
|
||||
}
|
||||
|
||||
static class Sub extends Class1.Sub {
|
||||
@Override
|
||||
public @Nullable Object subtypingInconsistency(Object object) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
[buildfile]
|
||||
includes = //DEFS
|
||||
|
||||
[project]
|
||||
ignore = .git, .ml, .mli
|
||||
|
||||
[java]
|
||||
source_level = 8
|
||||
target_level = 8
|
@ -0,0 +1 @@
|
||||
../../../../.buckversion
|
@ -0,0 +1,52 @@
|
||||
import os
|
||||
|
||||
original_java_library = java_library
|
||||
def java_library(
|
||||
name,
|
||||
srcs=[],
|
||||
**kwargs
|
||||
):
|
||||
|
||||
original_java_library(
|
||||
name=name,
|
||||
srcs=srcs,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
create_infer_genrule(name, srcs)
|
||||
|
||||
original_android_library = android_library
|
||||
def android_library(
|
||||
name,
|
||||
srcs=[],
|
||||
**kwargs
|
||||
):
|
||||
|
||||
original_android_library(
|
||||
name=name,
|
||||
srcs=srcs,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
create_infer_genrule(name, srcs)
|
||||
|
||||
def create_infer_genrule(
|
||||
name,
|
||||
srcs
|
||||
):
|
||||
genrule_name = name + '_infer'
|
||||
genrule(
|
||||
name = genrule_name,
|
||||
srcs=srcs,
|
||||
cmd = ' '.join([
|
||||
os.getenv('INFER_BIN', 'infer'),
|
||||
'--genrule-mode',
|
||||
'--project-root', os.getenv('PROJECT_ROOT', os.environ['PWD']),
|
||||
'--eradicate-only',
|
||||
'--results-dir', '$OUT',
|
||||
'--classpath', '$(classpath :{})'.format(name),
|
||||
'--sourcepath', '$SRCDIR',
|
||||
'--generated-classes', '$(location :{})'.format(name),
|
||||
]),
|
||||
out = 'infer_out',
|
||||
)
|
@ -0,0 +1,7 @@
|
||||
java_library(
|
||||
name='annotations',
|
||||
srcs=['Nullable.java'],
|
||||
visibility=[
|
||||
'PUBLIC'
|
||||
],
|
||||
)
|
@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 2018-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
package genrule.annotations;
|
||||
|
||||
public @interface Nullable {}
|
@ -1,2 +1,2 @@
|
||||
infer/tests/build_systems/buck_cross_module/module2/Class2.java, void Class2.crossModuleNPE1(), 1, NULL_DEREFERENCE, [start of procedure crossModuleNPE1(),start of procedure returnsNull(),return from a call to String Class1.returnsNull()]
|
||||
infer/tests/build_systems/buck_cross_module/module2/Class2.java, void Class2.crossModuleNPE2(Class1), 1, NULL_DEREFERENCE, [start of procedure crossModuleNPE2(...)]
|
||||
module2/Class2.java, crossmodule.module2.Class2.crossModuleNPE1():void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure crossModuleNPE1(),start of procedure returnsNull(),return from a call to String Class1.returnsNull()]
|
||||
module2/Class2.java, crossmodule.module2.Class2.crossModuleNPE2(crossmodule.module1.Class1):void, 1, NULL_DEREFERENCE, no_bucket, ERROR, [start of procedure crossModuleNPE2(...)]
|
||||
|
@ -0,0 +1,9 @@
|
||||
[buildfile]
|
||||
includes = //DEFS
|
||||
|
||||
[project]
|
||||
ignore = .git, .ml, .mli
|
||||
|
||||
[java]
|
||||
source_level = 8
|
||||
target_level = 8
|
@ -0,0 +1 @@
|
||||
../../../../.buckversion
|
@ -0,0 +1,52 @@
|
||||
import os
|
||||
|
||||
original_java_library = java_library
|
||||
def java_library(
|
||||
name,
|
||||
srcs=[],
|
||||
**kwargs
|
||||
):
|
||||
|
||||
original_java_library(
|
||||
name=name,
|
||||
srcs=srcs,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
create_infer_genrule(name, srcs)
|
||||
|
||||
original_android_library = android_library
|
||||
def android_library(
|
||||
name,
|
||||
srcs=[],
|
||||
**kwargs
|
||||
):
|
||||
|
||||
original_android_library(
|
||||
name=name,
|
||||
srcs=srcs,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
create_infer_genrule(name, srcs)
|
||||
|
||||
def create_infer_genrule(
|
||||
name,
|
||||
srcs
|
||||
):
|
||||
genrule_name = name + '_infer'
|
||||
genrule(
|
||||
name = genrule_name,
|
||||
srcs=srcs,
|
||||
cmd = ' '.join([
|
||||
os.getenv('INFER_BIN', 'infer'),
|
||||
'--genrule-mode',
|
||||
'--project-root', os.getenv('PROJECT_ROOT', os.environ['PWD']),
|
||||
'--eradicate-only',
|
||||
'--results-dir', '$OUT',
|
||||
'--classpath', '$(classpath :{})'.format(name),
|
||||
'--sourcepath', '$SRCDIR',
|
||||
'--generated-classes', '$(location :{})'.format(name),
|
||||
]),
|
||||
out = 'infer_out',
|
||||
)
|
@ -1,10 +1,10 @@
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2$Sub.subtypingInconsistency(java.lang.Object):java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `object` of method `Class2$Sub.subtypingInconsistency(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `Class1$Sub.subtypingInconsistency(...)`.]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2$Sub.subtypingInconsistency(java.lang.Object):java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `Class2$Sub.subtypingInconsistency(...)` is annotated with `@Nullable` but overrides unannotated method `Class1$Sub.subtypingInconsistency(...)`.]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField1Bad(genrule.module1.Class1):void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `class1.field1` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field Class1.field1 at line 53)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField2Bad(genrule.module1.Class1):int, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `class1.field2` is nullable and is not locally checked for null when accessing field `Class1.x`. (Origin: field Class1.field2 at line 57)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.dereferenceLocalNullableFieldBad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `Class2.field` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field Class2.field at line 49)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.followMethodDeclarationOnlyBad(genrule.module1.SkipImplementationClass1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj2` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to annotatedNullable() at line 39)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.interTargetAbstractNPEBad(genrule.module1.Class1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to abstractMayReturnNull() at line 29)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.interTargetNPEBad():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to returnsNull() at line 24)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.interTargetNativeNPEBad(genrule.module1.Class1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to nativeMayReturnNull() at line 34)]
|
||||
infer/tests/build_systems/genrule/module2/Class2.java, genrule.module2.Class2.localNPE2Bad():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: null constant at line 19)]
|
||||
module2/Class2.java, genrule.module2.Class2$Sub.subtypingInconsistency(java.lang.Object):java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, no_bucket, WARNING, [First parameter `object` of method `Class2$Sub.subtypingInconsistency(...)` is not `@Nullable` but is declared `@Nullable`in the parent class method `Class1$Sub.subtypingInconsistency(...)`.]
|
||||
module2/Class2.java, genrule.module2.Class2$Sub.subtypingInconsistency(java.lang.Object):java.lang.Object, 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, no_bucket, WARNING, [Method `Class2$Sub.subtypingInconsistency(...)` is annotated with `@Nullable` but overrides unannotated method `Class1$Sub.subtypingInconsistency(...)`.]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField1Bad(genrule.module1.Class1):void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `class1.field1` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field Class1.field1 at line 53)]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceInterTargetField2Bad(genrule.module1.Class1):int, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [Object `class1.field2` is nullable and is not locally checked for null when accessing field `Class1.x`. (Origin: field Class1.field2 at line 57)]
|
||||
module2/Class2.java, genrule.module2.Class2.dereferenceLocalNullableFieldBad():void, 1, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `Class2.field` in the call to `toString()` is nullable and is not locally checked for null. (Origin: field Class2.field at line 49)]
|
||||
module2/Class2.java, genrule.module2.Class2.followMethodDeclarationOnlyBad(genrule.module1.SkipImplementationClass1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj2` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to annotatedNullable() at line 39)]
|
||||
module2/Class2.java, genrule.module2.Class2.interTargetAbstractNPEBad(genrule.module1.Class1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to abstractMayReturnNull() at line 29)]
|
||||
module2/Class2.java, genrule.module2.Class2.interTargetNPEBad():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to returnsNull() at line 24)]
|
||||
module2/Class2.java, genrule.module2.Class2.interTargetNativeNPEBad(genrule.module1.Class1):void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: call to nativeMayReturnNull() at line 34)]
|
||||
module2/Class2.java, genrule.module2.Class2.localNPE2Bad():void, 2, ERADICATE_NULLABLE_DEREFERENCE, no_bucket, WARNING, [The value of `obj` in the call to `toString()` is nullable and is not locally checked for null. (Origin: null constant at line 19)]
|
||||
|
Loading…
Reference in new issue