From 2cb595b8c9be8f74541bbf9fbfc9827f687eb078 Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Fri, 26 Aug 2016 11:19:03 -0700 Subject: [PATCH] Convert Eradicate and Checkers tests to direct format. Summary: This diff converts the Eradicate and Checkers tests to the new direct test format, which does not rely on buck or junit. A self-contained Makefile is used to compile and analyze the test files, including all the dependencies, and a special option in InferPrint is used to produce a file of expected results `issues.exp`, which is checked into the repository. Having an explicit Makefile makes it easy to edit and compile one set of test files in isolation, to investigate test failures, do debugging, etc. A bunch of boilerplate code is removed. For example, the single file of expected results `issues.exp` replaces the 1.5K LOC in `endtoend/java/eradicate`. Reviewed By: jvillard Differential Revision: D3764632 fbshipit-source-id: 6c68ab8 --- Makefile | 10 ++ infer/tests/codetoanalyze/java/Makefile | 32 ++++++ .../codetoanalyze/java/checkers/.inferconfig | 14 +++ infer/tests/codetoanalyze/java/checkers/BUCK | 46 --------- .../codetoanalyze/java/checkers/Makefile | 28 ++++++ .../codetoanalyze/java/checkers/issues.exp | 36 +++++++ infer/tests/codetoanalyze/java/eradicate/BUCK | 48 --------- .../codetoanalyze/java/eradicate/Makefile | 30 ++++++ .../codetoanalyze/java/eradicate/issues.exp | 51 ++++++++++ infer/tests/endtoend/BUCK | 4 - infer/tests/endtoend/java/checkers/BUCK | 16 --- .../java/checkers/ExpensiveCallTest.java | 72 -------------- .../checkers/ExpensiveInheritanceTest.java | 54 ---------- .../java/checkers/ExpensiveSubtypingTest.java | 54 ---------- .../FragmentDoesNotRetainViewTest.java | 53 ---------- .../checkers/FragmentRetainsViewTest.java | 54 ---------- .../java/checkers/ImmutableCastTest.java | 55 ----------- .../java/checkers/NoAllocationTest.java | 52 ---------- .../java/checkers/PrintfArgsCheckerTest.java | 57 ----------- .../java/checkers/TwoCheckersTest.java | 62 ------------ .../ActivityFieldNotInitializedTest.java | 55 ----------- infer/tests/endtoend/java/eradicate/BUCK | 16 --- .../eradicate/FieldNotInitializedTest.java | 66 ------------- .../java/eradicate/FieldNotNullableTest.java | 62 ------------ .../InconsistentSubclassAnnotationTest.java | 74 -------------- .../java/eradicate/LibraryCallsTest.java | 59 ----------- .../NoReuseUndefFunctionValuesTest.java | 50 ---------- .../java/eradicate/NullFieldAccessTest.java | 59 ----------- .../java/eradicate/NullMethodCallTest.java | 62 ------------ .../eradicate/ParameterNotNullableTest.java | 57 ----------- .../java/eradicate/ReturnNotNullableTest.java | 98 ------------------- .../java/eradicate/SuppressWarningsTest.java | 56 ----------- .../SuppressedFieldNotInitializedTest.java | 55 ----------- infer/tests/utils/InferResults.java | 19 +--- 34 files changed, 202 insertions(+), 1414 deletions(-) create mode 100644 infer/tests/codetoanalyze/java/Makefile create mode 100644 infer/tests/codetoanalyze/java/checkers/.inferconfig delete mode 100644 infer/tests/codetoanalyze/java/checkers/BUCK create mode 100644 infer/tests/codetoanalyze/java/checkers/Makefile create mode 100644 infer/tests/codetoanalyze/java/checkers/issues.exp delete mode 100644 infer/tests/codetoanalyze/java/eradicate/BUCK create mode 100644 infer/tests/codetoanalyze/java/eradicate/Makefile create mode 100644 infer/tests/codetoanalyze/java/eradicate/issues.exp delete mode 100644 infer/tests/endtoend/java/checkers/BUCK delete mode 100644 infer/tests/endtoend/java/checkers/ExpensiveCallTest.java delete mode 100644 infer/tests/endtoend/java/checkers/ExpensiveInheritanceTest.java delete mode 100644 infer/tests/endtoend/java/checkers/ExpensiveSubtypingTest.java delete mode 100644 infer/tests/endtoend/java/checkers/FragmentDoesNotRetainViewTest.java delete mode 100644 infer/tests/endtoend/java/checkers/FragmentRetainsViewTest.java delete mode 100644 infer/tests/endtoend/java/checkers/ImmutableCastTest.java delete mode 100644 infer/tests/endtoend/java/checkers/NoAllocationTest.java delete mode 100644 infer/tests/endtoend/java/checkers/PrintfArgsCheckerTest.java delete mode 100644 infer/tests/endtoend/java/checkers/TwoCheckersTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/ActivityFieldNotInitializedTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/BUCK delete mode 100644 infer/tests/endtoend/java/eradicate/FieldNotInitializedTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/FieldNotNullableTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/InconsistentSubclassAnnotationTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/LibraryCallsTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/NoReuseUndefFunctionValuesTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/NullFieldAccessTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/NullMethodCallTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/ParameterNotNullableTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/ReturnNotNullableTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/SuppressWarningsTest.java delete mode 100644 infer/tests/endtoend/java/eradicate/SuppressedFieldNotInitializedTest.java diff --git a/Makefile b/Makefile index 279cf58cf..fd3faa2f8 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,14 @@ ROOT_DIR = . include $(ROOT_DIR)/Makefile.config +DIRECT_TESTS= TARGETS_TO_TEST= ifeq ($(BUILD_C_ANALYZERS),yes) TARGETS_TO_TEST += c cpp endif ifeq ($(BUILD_JAVA_ANALYZERS),yes) TARGETS_TO_TEST += java +DIRECT_TESTS += checkers_test eradicate_test endif ifneq ($(XCODE_SELECT),no) TARGETS_TO_TEST += objc objcpp @@ -95,12 +97,20 @@ endif ocaml_unit_test: test_this_build $(TEST_BUILD_DIR)/unit/inferunit.byte +checkers_test: + make -C ./infer/tests/codetoanalyze/java/checkers test + +eradicate_test: + make -C ./infer/tests/codetoanalyze/java/eradicate test + buck_test: infer + make $(DIRECT_TESTS) NO_BUCKD=1 buck clean MAKEFLAGS= NO_BUCKD=1 buck test -j $(NCPU) -L $(NCPU) $(TARGETS_TO_TEST) NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py buck_test_xml: infer + make $(DIRECT_TESTS) NO_BUCKD=1 buck clean NO_BUCKD=1 buck test -j $(NCPU) -L $(NCPU) --xml test.xml $(TARGETS_TO_TEST) NO_BUCKD=1 ./infer/tests/build_systems/build_integration_tests.py diff --git a/infer/tests/codetoanalyze/java/Makefile b/infer/tests/codetoanalyze/java/Makefile new file mode 100644 index 000000000..899ef5bf9 --- /dev/null +++ b/infer/tests/codetoanalyze/java/Makefile @@ -0,0 +1,32 @@ +# Copyright (c) 2016 - present Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +ROOT_DIR = ../../../../.. +include $(ROOT_DIR)/Makefile.config + +ANDROID19 = $(JAVA_LIB_DIR)/android/android-19.jar +ANDROIDSUPPORT = $(DEPENDENCIES_DIR)/java/android/support/v4/android-support-v4.jar +ANNOTATIONS = $(ANNOTATIONS_DIR)/annotations.jar +BUTTERKNIFE = $(DEPENDENCIES_DIR)/java/butterknife/butterknife-7.0.1.jar +JSR305 = $(DEPENDENCIES_DIR)/java/jsr-305/jsr305.jar +INJECT = $(DEPENDENCIES_DIR)/java/jsr-330/javax.inject.jar + +CLASSPATH=$(ANDROID19):$(ANDROIDSUPPORT):$(ANNOTATIONS):$(BUTTERKNIFE):$(JSR305):$(INJECT):. + +default: compile + +print: analyze + $(INFERPRINT_BIN) -q --issues-tests issues.exp.test + LC_ALL=C sort -o issues.exp.test issues.exp.test + +test: analyze print + make clean + diff -u issues.exp issues.exp.test + rm issues.exp.test + +clean: + rm -rf codetoanalyze infer-out *.class diff --git a/infer/tests/codetoanalyze/java/checkers/.inferconfig b/infer/tests/codetoanalyze/java/checkers/.inferconfig new file mode 100644 index 000000000..a92a25acc --- /dev/null +++ b/infer/tests/codetoanalyze/java/checkers/.inferconfig @@ -0,0 +1,14 @@ +{ + "modeled_expensive": [ + { + "language": "Java", + "class": "android.app.Activity", + "method": "findViewById" + }, + { + "language": "Java", + "class": "android.view.View", + "method": "findViewById" + } + ] +} diff --git a/infer/tests/codetoanalyze/java/checkers/BUCK b/infer/tests/codetoanalyze/java/checkers/BUCK deleted file mode 100644 index b95f781e9..000000000 --- a/infer/tests/codetoanalyze/java/checkers/BUCK +++ /dev/null @@ -1,46 +0,0 @@ -sources = glob(['**/*.java']) - -dependencies = [ - '//dependencies/java/android/support/v4:android-support-v4', - '//infer/annotations:annotations', - '//infer/lib/java/android:android', -] - -java_library( - name = 'checkers', - srcs = sources, - deps = dependencies, - visibility = [ - 'PUBLIC' - ] -) - -out = 'out' -inferconfig_file = '$(location //infer/tests/codetoanalyze/java:inferconfig)' -copy_inferconfig = ' '.join(['cp', inferconfig_file, '$SRCDIR']) -clean_cmd = ' '.join(['rm', '-rf', out]) -classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies]) -infer_cmd = ' '.join([ - 'infer', - '--no-progress-bar', - '--absolute-paths', - '-o', out, - '-a', 'checkers', - '--', - 'javac', - '-cp', classpath, - '$SRCS', -]) -copy_cmd = ' '.join(['cp', out + '/report.csv', '$OUT']) -command = ' && '.join([clean_cmd, copy_inferconfig, infer_cmd, copy_cmd]) - -genrule( - name = 'analyze', - srcs = sources, - out = 'report.csv', - cmd = command, - deps = dependencies + [':checkers'], - visibility = [ - 'PUBLIC', - ] -) diff --git a/infer/tests/codetoanalyze/java/checkers/Makefile b/infer/tests/codetoanalyze/java/checkers/Makefile new file mode 100644 index 000000000..8a074088d --- /dev/null +++ b/infer/tests/codetoanalyze/java/checkers/Makefile @@ -0,0 +1,28 @@ +# Copyright (c) 2016 - present Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +include ../Makefile + +FILES = \ + Branch.java \ + FragmentRetainsViewExample.java \ + ExpensiveCallExample.java \ + ImmutableCast.java \ + ExpensiveInheritanceExample.java \ + NoAllocationExample.java \ + ExpensiveInterfaceExample.java \ + PrintfArgsChecker.java \ + ExpensiveSubtypingExample.java \ + TraceCallSequence.java \ + FragmentDoesNotRetainViewExample.java \ + TwoCheckersExample.java + +compile: + javac -cp $(CLASSPATH) $(FILES) + +analyze: + $(INFER_BIN) -a checkers -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null diff --git a/infer/tests/codetoanalyze/java/checkers/issues.exp b/infer/tests/codetoanalyze/java/checkers/issues.exp new file mode 100644 index 000000000..aa3027d6d --- /dev/null +++ b/infer/tests/codetoanalyze/java/checkers/issues.exp @@ -0,0 +1,36 @@ +ExpensiveCallExample.java, View ExpensiveCallExample.callsFindViewByIdFromActivity(FragmentActivity,int), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, View ExpensiveCallExample.callsFindViewByIdFromView(ImageView,int), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.annotatedPerformanceCriticalInInterface(), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.callMethodOnExpensiveClass(ExpensiveClass), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.callingExpensiveMethodFromInterface(ExpensiveInterfaceExample), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.callsExpensiveInConditionalBranch(), 2, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.callsExpensiveInTheUnlikelyElseBranch(), 4, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.callsExpensiveWithDisjunctionAfterUnlikely(), 2, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.callsExpensiveWithOverriddenUnlikelyCondition(), 4, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.directlyCallingExpensiveMethod(), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.indirectlyCallingExpensiveMethod(), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.longerCallStackToExpensive(), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void ExpensiveCallExample.onlyOneExpensiveCallUsingUnlikely(), 4, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void PerformanceCriticalClass.performanceCriticalMethod1(ExpensiveClass), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void PerformanceCriticalClass.performanceCriticalMethod2(Other), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void PerformanceCriticalClass.performanceCriticalMethod3(Other), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void PerformanceCriticalSubclass.subclassPerformanceCriticalMethod1(ExpensiveClass), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void PerformanceCriticalSubclass.subclassPerformanceCriticalMethod2(ExpensiveSubclass), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveCallExample.java, void PerformanceCriticalSubclass.subclassPerformanceCriticalMethod3(Other), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveInheritanceExample.java, void ExpensiveInheritanceExample.doesReportBecauseTypeFlowInsensitive(A), 2, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveInheritanceExample.java, void ExpensiveInheritanceExample.reportsAssumingObjectOfTypeA(), 2, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveInheritanceExample.java, void ExpensiveInheritanceExample.reportsBecauseFooIsExpensiveInA(A), 1, CHECKERS_CALLS_EXPENSIVE_METHOD +ExpensiveSubtypingExample.java, void ExpensiveSubtypingExample.m3(), 0, CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED +FragmentRetainsViewExample.java, void FragmentRetainsViewExample.onDestroyView(), 0, CHECKERS_FRAGMENT_RETAINS_VIEW +FragmentRetainsViewExample.java, void FragmentRetainsViewExample.onDestroyView(), 0, CHECKERS_FRAGMENT_RETAINS_VIEW +FragmentRetainsViewExample.java, void FragmentRetainsViewExample.onDestroyView(), 0, CHECKERS_FRAGMENT_RETAINS_VIEW +ImmutableCast.java, List ImmutableCast.badCast(ImmutableList), 0, CHECKERS_IMMUTABLE_CAST +ImmutableCast.java, List ImmutableCast.badCastFromField(), 0, CHECKERS_IMMUTABLE_CAST +NoAllocationExample.java, void NoAllocationExample.directlyAllocatingMethod(), 1, CHECKERS_ALLOCATES_MEMORY +NoAllocationExample.java, void NoAllocationExample.indirectlyAllocatingMethod(), 1, CHECKERS_ALLOCATES_MEMORY +PrintfArgsChecker.java, void PrintfArgsChecker.formatStringIsNotLiteral(PrintStream), 2, CHECKERS_PRINTF_ARGS +PrintfArgsChecker.java, void PrintfArgsChecker.notSuppressed(PrintStream), 1, CHECKERS_PRINTF_ARGS +PrintfArgsChecker.java, void PrintfArgsChecker.stringInsteadOfInteger(PrintStream), 1, CHECKERS_PRINTF_ARGS +PrintfArgsChecker.java, void PrintfArgsChecker.wrongNumberOfArguments(PrintStream), 1, CHECKERS_PRINTF_ARGS +TwoCheckersExample.java, List TwoCheckersExample.shouldRaiseImmutableCastError(), 0, CHECKERS_IMMUTABLE_CAST +TwoCheckersExample.java, List TwoCheckersExample.shouldRaisePerformanceCriticalError(), 1, CHECKERS_CALLS_EXPENSIVE_METHOD diff --git a/infer/tests/codetoanalyze/java/eradicate/BUCK b/infer/tests/codetoanalyze/java/eradicate/BUCK deleted file mode 100644 index 463cd31e2..000000000 --- a/infer/tests/codetoanalyze/java/eradicate/BUCK +++ /dev/null @@ -1,48 +0,0 @@ -sources = glob(['**/*.java']) - -dependencies = [ - '//infer/annotations:annotations', - '//infer/lib/java/android:android', - '//dependencies/java/jsr-305:jsr-305', - '//dependencies/java/jsr-330:jsr-330', - '//dependencies/java/android/support/v4:android-support-v4', - '//dependencies/java/butterknife:butterknife', -] - -java_library( - name = 'eradicate', - srcs = sources, - deps = dependencies, - visibility = [ - 'PUBLIC' - ] -) - -out = 'out' -clean_cmd = ' '.join(['rm', '-rf', out]) -classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies]) -env_cmd = ' '.join(['export', 'ERADICATE_RETURN_OVER_ANNOTATED=1']) -infer_cmd = ' '.join([ - 'infer', - '--no-progress-bar', - '--absolute-paths', - '-o', out, - '-a', 'eradicate', - '--', - 'javac', - '-cp', classpath, - '$SRCS', -]) -copy_cmd = ' '.join(['cp', out + '/report.csv', '$OUT']) -command = ' && '.join([clean_cmd, env_cmd, infer_cmd, copy_cmd]) - -genrule( - name = 'analyze', - srcs = sources, - out = 'report.csv', - cmd = command, - deps = dependencies + [':eradicate'], - visibility = [ - 'PUBLIC', - ] -) diff --git a/infer/tests/codetoanalyze/java/eradicate/Makefile b/infer/tests/codetoanalyze/java/eradicate/Makefile new file mode 100644 index 000000000..0045fe205 --- /dev/null +++ b/infer/tests/codetoanalyze/java/eradicate/Makefile @@ -0,0 +1,30 @@ +# Copyright (c) 2016 - present Facebook, Inc. +# All rights reserved. +# +# This source code is licensed under the BSD style license found in the +# LICENSE file in the root directory of this source tree. An additional grant +# of patent rights can be found in the PATENTS file in the same directory. + +include ../Makefile + +FILES = \ + ActivityFieldNotInitialized.java \ + FieldNotInitialized.java \ + FieldNotNullable.java \ + InconsistentSubclassAnnotationInterface.java \ + InconsistentSubclassAnnotation.java \ + LibraryCalls.java \ + NoReuseUndefFunctionValues.java \ + NullFieldAccess.java \ + NullMethodCall.java \ + ParameterNotNullable.java \ + ReturnNotNullable.java \ + SuppressWarningsExample.java \ + SuppressedFieldNotInitializedExample.java + +compile: + javac -cp $(CLASSPATH) $(FILES) + +analyze: + ERADICATE_RETURN_OVER_ANNOTATED=1 \ + $(INFER_BIN) -a eradicate -- javac -cp $(CLASSPATH) $(FILES) >/dev/null 2>/dev/null diff --git a/infer/tests/codetoanalyze/java/eradicate/issues.exp b/infer/tests/codetoanalyze/java/eradicate/issues.exp new file mode 100644 index 000000000..935697af1 --- /dev/null +++ b/infer/tests/codetoanalyze/java/eradicate/issues.exp @@ -0,0 +1,51 @@ +ActivityFieldNotInitialized.java, ActivityFieldNotInitialized$BadActivityWithOnCreate.(ActivityFieldNotInitialized), 0, ERADICATE_FIELD_NOT_INITIALIZED +FieldNotInitialized.java, FieldNotInitialized.(), 0, ERADICATE_FIELD_NOT_INITIALIZED +FieldNotNullable.java, FieldNotNullable.(Integer), -25, ERADICATE_FIELD_NOT_NULLABLE +FieldNotNullable.java, FieldNotNullable.(String), -2, ERADICATE_FIELD_NOT_NULLABLE +FieldNotNullable.java, void FieldNotNullable.setYNull(), 1, ERADICATE_FIELD_NOT_NULLABLE +FieldNotNullable.java, void FieldNotNullable.setYNullable(String), 1, ERADICATE_FIELD_NOT_NULLABLE +FieldNotNullable.java, void NestedFieldAccess$TestFunctionsIdempotent.FlatBAD1(NestedFieldAccess$TestFunctionsIdempotent), 2, ERADICATE_FIELD_NOT_NULLABLE +FieldNotNullable.java, void NestedFieldAccess$TestFunctionsIdempotent.FlatBAD2(NestedFieldAccess$TestFunctionsIdempotent), 2, ERADICATE_FIELD_NOT_NULLABLE +FieldNotNullable.java, void NestedFieldAccess$TestFunctionsIdempotent.NestedBAD1(), 2, ERADICATE_FIELD_NOT_NULLABLE +FieldNotNullable.java, void NestedFieldAccess$TestFunctionsIdempotent.NestedBAD2(), 2, ERADICATE_FIELD_NOT_NULLABLE +FieldNotNullable.java, void NestedFieldAccess$TestFunctionsIdempotent.NestedBAD3(), 2, ERADICATE_FIELD_NOT_NULLABLE +FieldNotNullable.java, void NestedFieldAccess$TestPut.putNull(Map,String), 3, ERADICATE_FIELD_NOT_NULLABLE +InconsistentSubclassAnnotation.java, String InconsistentSubclassAnnotation.implementInAnotherFile(String), 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION +InconsistentSubclassAnnotation.java, SubclassExample$T SubclassExample$B.foo(), 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION +InconsistentSubclassAnnotation.java, SubclassExample$T SubclassExample$C.baz(), 0, ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION +InconsistentSubclassAnnotation.java, void SubclassExample$D.deref(SubclassExample$T), 0, ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION +LibraryCalls.java, String LibraryCalls.badAtomicReferenceDereference(AtomicReference), 1, ERADICATE_NULL_METHOD_CALL +LibraryCalls.java, String LibraryCalls.badPhantomReferenceDereference(PhantomReference), 1, ERADICATE_NULL_METHOD_CALL +LibraryCalls.java, String LibraryCalls.badReferenceDereference(Reference), 1, ERADICATE_NULL_METHOD_CALL +LibraryCalls.java, String LibraryCalls.badSoftReferenceDereference(SoftReference), 1, ERADICATE_NULL_METHOD_CALL +LibraryCalls.java, String LibraryCalls.badWeakReferenceDereference(WeakReference), 1, ERADICATE_NULL_METHOD_CALL +NullFieldAccess.java, Object NullFieldAccess.arrayAccess(), 1, ERADICATE_NULL_FIELD_ACCESS +NullFieldAccess.java, int NullFieldAccess.arrayLength(), 1, ERADICATE_NULL_FIELD_ACCESS +NullFieldAccess.java, int NullFieldAccess.useInterface(NullFieldAccess$I), 2, ERADICATE_NULL_FIELD_ACCESS +NullFieldAccess.java, int NullFieldAccess.useX(), 2, ERADICATE_NULL_FIELD_ACCESS +NullFieldAccess.java, int NullFieldAccess.useZ(), 2, ERADICATE_NULL_FIELD_ACCESS +NullMethodCall.java, int NullMethodCall$Inner.outerField(), 2, ERADICATE_NULL_METHOD_CALL +NullMethodCall.java, int NullMethodCall$Inner.outerPrivateField(), 2, ERADICATE_NULL_METHOD_CALL +NullMethodCall.java, void NullMethodCall$TestTextUtilsIsEmpty.myTextUtilsIsEmpty(CharSequence), 2, ERADICATE_NULL_METHOD_CALL +NullMethodCall.java, void NullMethodCall$TestTextUtilsIsEmpty.myTextUtilsNotIsNotEmpty(CharSequence), 2, ERADICATE_NULL_METHOD_CALL +NullMethodCall.java, void NullMethodCall$TestTextUtilsIsEmpty.textUtilsIsEmpty(CharSequence), 2, ERADICATE_NULL_METHOD_CALL +NullMethodCall.java, void NullMethodCall.callOnNull(), 2, ERADICATE_NULL_METHOD_CALL +NullMethodCall.java, void NullMethodCall.testExceptionPerInstruction(int), 6, ERADICATE_NULL_METHOD_CALL +NullMethodCall.java, void NullMethodCall.testFieldAssignmentIfThenElse(String), 2, ERADICATE_NULL_METHOD_CALL +NullMethodCall.java, void NullMethodCall.testSystemGetPropertyReturn(), 2, ERADICATE_NULL_METHOD_CALL +ParameterNotNullable.java, String ParameterNotNullable.testSystemGetPropertyArgument(), 1, ERADICATE_PARAMETER_NOT_NULLABLE +ParameterNotNullable.java, URL ParameterNotNullable.testClassGetResourceArgument(Class), 1, ERADICATE_PARAMETER_NOT_NULLABLE +ParameterNotNullable.java, void ParameterNotNullable.callNull(), 2, ERADICATE_PARAMETER_NOT_NULLABLE +ParameterNotNullable.java, void ParameterNotNullable.callNullable(String), 1, ERADICATE_PARAMETER_NOT_NULLABLE +ReturnNotNullable.java, Object ReturnNotNullable.tryWithResourcesReturnNullable(String), 0, ERADICATE_RETURN_NOT_NULLABLE +ReturnNotNullable.java, String ReturnNotNullable.redundantEq(), 0, ERADICATE_RETURN_OVER_ANNOTATED +ReturnNotNullable.java, String ReturnNotNullable.redundantEq(), 2, ERADICATE_CONDITION_REDUNDANT_NONNULL +ReturnNotNullable.java, String ReturnNotNullable.redundantNeq(), 0, ERADICATE_RETURN_OVER_ANNOTATED +ReturnNotNullable.java, String ReturnNotNullable.redundantNeq(), 2, ERADICATE_CONDITION_REDUNDANT_NONNULL +ReturnNotNullable.java, String ReturnNotNullable.returnNull(), 0, ERADICATE_RETURN_NOT_NULLABLE +ReturnNotNullable.java, String ReturnNotNullable.returnNullable(String), 0, ERADICATE_RETURN_NOT_NULLABLE +ReturnNotNullable.java, String ReturnNotNullable.return_null_in_catch(), 0, ERADICATE_RETURN_NOT_NULLABLE +ReturnNotNullable.java, String ReturnNotNullable.return_null_in_catch_after_throw(), 0, ERADICATE_RETURN_NOT_NULLABLE +ReturnNotNullable.java, URL ReturnNotNullable.getResourceNullable(Class,String), 0, ERADICATE_RETURN_NOT_NULLABLE +SuppressWarningsExample.java, void SuppressWarningsExample.doNotSuppressNoAnnot(Object), 1, ERADICATE_NULL_METHOD_CALL +SuppressWarningsExample.java, void SuppressWarningsExample.doNotSuppressWrongAnnot(Object), 1, ERADICATE_NULL_METHOD_CALL diff --git a/infer/tests/endtoend/BUCK b/infer/tests/endtoend/BUCK index 1d8530a54..d6b31ec3c 100644 --- a/infer/tests/endtoend/BUCK +++ b/infer/tests/endtoend/BUCK @@ -7,9 +7,7 @@ tests_dependencies = [ '//dependencies/java/junit:junit', '//dependencies/java/opencsv:opencsv', '//infer/tests/utils:utils', - '//infer/tests/codetoanalyze/java/checkers:checkers', '//infer/tests/codetoanalyze/java/crashcontext:crashcontext', - '//infer/tests/codetoanalyze/java/eradicate:eradicate', '//infer/tests/codetoanalyze/java/infer:infer', '//infer/tests/codetoanalyze/java/tracing:tracing', ] @@ -66,8 +64,6 @@ java_test( name='java_endtoend_tests', deps=[ '//infer/tests/endtoend/java/infer:infer', - '//infer/tests/endtoend/java/eradicate:eradicate', - '//infer/tests/endtoend/java/checkers:checkers', '//infer/tests/endtoend/java/crashcontext:crashcontext', '//infer/tests/endtoend/java/harness:harness', '//infer/tests/endtoend/java/tracing:tracing', diff --git a/infer/tests/endtoend/java/checkers/BUCK b/infer/tests/endtoend/java/checkers/BUCK deleted file mode 100644 index 5135029aa..000000000 --- a/infer/tests/endtoend/java/checkers/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -java_test( - name='checkers', - srcs=glob(['*.java']), - deps=[ - '//dependencies/java/guava:guava', - '//dependencies/java/junit:hamcrest', - '//dependencies/java/junit:junit', - '//infer/tests/utils:utils', - ], - resources=[ - '//infer/tests/codetoanalyze/java/checkers:analyze', - ], - visibility=[ - 'PUBLIC', - ], -) diff --git a/infer/tests/endtoend/java/checkers/ExpensiveCallTest.java b/infer/tests/endtoend/java/checkers/ExpensiveCallTest.java deleted file mode 100644 index 14bc1cbeb..000000000 --- a/infer/tests/endtoend/java/checkers/ExpensiveCallTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2015 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.checkers; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class ExpensiveCallTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/checkers/ExpensiveCallExample.java"; - - public static final String CALLS_EXPENSIVE_METHOD = - "CHECKERS_CALLS_EXPENSIVE_METHOD"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadCheckersResults(ExpensiveCallTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "directlyCallingExpensiveMethod", - "indirectlyCallingExpensiveMethod", - "callingExpensiveMethodFromInterface", - "longerCallStackToExpensive", - "callsFindViewByIdFromView", - "callsFindViewByIdFromActivity", - "annotatedPerformanceCriticalInInterface", - "performanceCriticalMethod1", - "performanceCriticalMethod2", - "performanceCriticalMethod3", - "subclassPerformanceCriticalMethod1", - "subclassPerformanceCriticalMethod2", - "subclassPerformanceCriticalMethod3", - "callMethodOnExpensiveClass", - "onlyOneExpensiveCallUsingUnlikely", - "callsExpensiveInTheUnlikelyElseBranch", - "callsExpensiveWithDisjunctionAfterUnlikely", - "callsExpensiveWithOverriddenUnlikelyCondition", - "callsExpensiveInConditionalBranch", - }; - assertThat( - "Results should contain " + CALLS_EXPENSIVE_METHOD, - inferResults, - containsExactly( - CALLS_EXPENSIVE_METHOD, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/checkers/ExpensiveInheritanceTest.java b/infer/tests/endtoend/java/checkers/ExpensiveInheritanceTest.java deleted file mode 100644 index 794bb7261..000000000 --- a/infer/tests/endtoend/java/checkers/ExpensiveInheritanceTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2015 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.checkers; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class ExpensiveInheritanceTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/checkers/ExpensiveInheritanceExample.java"; - - public static final String CALLS_EXPENSIVE_METHOD = - "CHECKERS_CALLS_EXPENSIVE_METHOD"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadCheckersResults(ExpensiveInheritanceTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "reportsBecauseFooIsExpensiveInA", - "reportsAssumingObjectOfTypeA", - "doesReportBecauseTypeFlowInsensitive", - }; - assertThat("Results should contain " + CALLS_EXPENSIVE_METHOD, - inferResults, - containsExactly(CALLS_EXPENSIVE_METHOD, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/checkers/ExpensiveSubtypingTest.java b/infer/tests/endtoend/java/checkers/ExpensiveSubtypingTest.java deleted file mode 100644 index a8d73a70e..000000000 --- a/infer/tests/endtoend/java/checkers/ExpensiveSubtypingTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2015 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.checkers; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class ExpensiveSubtypingTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/checkers/ExpensiveSubtypingExample.java"; - - public static final String EXPENSIVE_OVERRIDES_UNANNOTATED = - "CHECKERS_EXPENSIVE_OVERRIDES_UNANNOTATED"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadCheckersResults(ExpensiveSubtypingTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "m3", - }; - assertThat( - "Results should contain " + EXPENSIVE_OVERRIDES_UNANNOTATED, - inferResults, - containsExactly( - EXPENSIVE_OVERRIDES_UNANNOTATED, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/checkers/FragmentDoesNotRetainViewTest.java b/infer/tests/endtoend/java/checkers/FragmentDoesNotRetainViewTest.java deleted file mode 100644 index 3ef650924..000000000 --- a/infer/tests/endtoend/java/checkers/FragmentDoesNotRetainViewTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2015 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.checkers; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsNoErrorInMethod.doesNotContain; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class FragmentDoesNotRetainViewTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/checkers/FragmentDoesNotRetainViewExample.java"; - - public static final String FRAGMENT_RETAINS_VIEW = - "CHECKERS_FRAGMENT_RETAINS_VIEW"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadCheckersResults(FragmentDoesNotRetainViewTest.class, SOURCE_FILE); - } - - @Test - public void matchNumberOfErrors() - throws IOException, InterruptedException, InferException { - assertThat( - "Results should contain 0 retained View errors", - inferResults, - doesNotContain( - FRAGMENT_RETAINS_VIEW, - SOURCE_FILE, - "onDestroyView" - ) - ); - } - -} diff --git a/infer/tests/endtoend/java/checkers/FragmentRetainsViewTest.java b/infer/tests/endtoend/java/checkers/FragmentRetainsViewTest.java deleted file mode 100644 index 943f396bc..000000000 --- a/infer/tests/endtoend/java/checkers/FragmentRetainsViewTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2015 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.checkers; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsNumberOfErrorsInMethod.containsNumberOfErrors; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class FragmentRetainsViewTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/checkers/FragmentRetainsViewExample.java"; - - public static final String FRAGMENT_RETAINS_VIEW = - "CHECKERS_FRAGMENT_RETAINS_VIEW"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadCheckersResults(FragmentRetainsViewTest.class, SOURCE_FILE); - } - - @Test - public void matchNumberOfErrors() - throws IOException, InterruptedException, InferException { - assertThat( - "Results should contain 3 retained View errors", - inferResults, - containsNumberOfErrors( - FRAGMENT_RETAINS_VIEW, - SOURCE_FILE, - "onDestroyView", - 3 - ) - ); - } - -} diff --git a/infer/tests/endtoend/java/checkers/ImmutableCastTest.java b/infer/tests/endtoend/java/checkers/ImmutableCastTest.java deleted file mode 100644 index e10d55bd0..000000000 --- a/infer/tests/endtoend/java/checkers/ImmutableCastTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.checkers; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class ImmutableCastTest { - - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/checkers/ImmutableCast.java"; - - public static final String IMMUTABLE_CAST = "CHECKERS_IMMUTABLE_CAST"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadCheckersResults(ImmutableCastTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "badCast", - "badCastFromField", - }; - assertThat( - "Results should contain " + IMMUTABLE_CAST, - inferResults, - containsExactly( - IMMUTABLE_CAST, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/checkers/NoAllocationTest.java b/infer/tests/endtoend/java/checkers/NoAllocationTest.java deleted file mode 100644 index cdbf3234b..000000000 --- a/infer/tests/endtoend/java/checkers/NoAllocationTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2015 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - - -package endtoend.java.checkers; - -import org.junit.BeforeClass; -import org.junit.Test; -import utils.InferException; -import utils.InferResults; - -import java.io.IOException; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -public class NoAllocationTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/checkers/NoAllocationExample.java"; - - public static final String ALLOCATES_MEMORY = - "CHECKERS_ALLOCATES_MEMORY"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = InferResults.loadCheckersResults(NoAllocationTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "directlyAllocatingMethod", - "indirectlyAllocatingMethod", - }; - assertThat("Results should contain " + ALLOCATES_MEMORY, - inferResults, - containsExactly(ALLOCATES_MEMORY, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/checkers/PrintfArgsCheckerTest.java b/infer/tests/endtoend/java/checkers/PrintfArgsCheckerTest.java deleted file mode 100644 index b32a47095..000000000 --- a/infer/tests/endtoend/java/checkers/PrintfArgsCheckerTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.checkers; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class PrintfArgsCheckerTest { - - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/checkers/PrintfArgsChecker.java"; - - public static final String CHECKERS_PRINTF_ARGS = "CHECKERS_PRINTF_ARGS"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadCheckersResults(PrintfArgsCheckerTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "notSuppressed", - "stringInsteadOfInteger", - "wrongNumberOfArguments", - "formatStringIsNotLiteral", - }; - assertThat( - "Results should contain " + CHECKERS_PRINTF_ARGS, - inferResults, - containsExactly( - CHECKERS_PRINTF_ARGS, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/checkers/TwoCheckersTest.java b/infer/tests/endtoend/java/checkers/TwoCheckersTest.java deleted file mode 100644 index fe76c0df4..000000000 --- a/infer/tests/endtoend/java/checkers/TwoCheckersTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2016 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.checkers; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsErrorInMethod.contains; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class TwoCheckersTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/checkers/TwoCheckersExample.java"; - - public static final String CALLS_EXPENSIVE_METHOD = - "CHECKERS_CALLS_EXPENSIVE_METHOD"; - - public static final String IMMUTABLE_CAST = - "CHECKERS_IMMUTABLE_CAST"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadCheckersResults(TwoCheckersTest.class, SOURCE_FILE); - } - - @Test - public void immutableCastErrorIsFound () - throws IOException, InterruptedException, InferException { - assertThat("Results should contain " + IMMUTABLE_CAST, - inferResults, - contains(IMMUTABLE_CAST, - SOURCE_FILE, - "shouldRaiseImmutableCastError")); - } - - @Test - public void PerformanceCriticalErrorIsFound () - throws IOException, InterruptedException, InferException { - assertThat("Results should contain " + CALLS_EXPENSIVE_METHOD, - inferResults, - contains(CALLS_EXPENSIVE_METHOD, - SOURCE_FILE, - "shouldRaisePerformanceCriticalError")); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/ActivityFieldNotInitializedTest.java b/infer/tests/endtoend/java/eradicate/ActivityFieldNotInitializedTest.java deleted file mode 100644 index adc14c4b5..000000000 --- a/infer/tests/endtoend/java/eradicate/ActivityFieldNotInitializedTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2014 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class ActivityFieldNotInitializedTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/ActivityFieldNotInitialized.java"; - - public static final String FIELD_NOT_INITIALIZED = - "ERADICATE_FIELD_NOT_INITIALIZED"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = InferResults.loadEradicateResults( - ActivityFieldNotInitializedTest.class, - SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "", - }; - assertThat( - "Results should contain " + FIELD_NOT_INITIALIZED, - inferResults, - containsExactly( - FIELD_NOT_INITIALIZED, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/BUCK b/infer/tests/endtoend/java/eradicate/BUCK deleted file mode 100644 index ef98770b0..000000000 --- a/infer/tests/endtoend/java/eradicate/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -java_test( - name='eradicate', - srcs=glob(['*.java']), - deps=[ - '//dependencies/java/guava:guava', - '//dependencies/java/junit:hamcrest', - '//dependencies/java/junit:junit', - '//infer/tests/utils:utils', - ], - resources=[ - '//infer/tests/codetoanalyze/java/eradicate:analyze', - ], - visibility=[ - 'PUBLIC', - ], -) diff --git a/infer/tests/endtoend/java/eradicate/FieldNotInitializedTest.java b/infer/tests/endtoend/java/eradicate/FieldNotInitializedTest.java deleted file mode 100644 index 812324894..000000000 --- a/infer/tests/endtoend/java/eradicate/FieldNotInitializedTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; -import static utils.matchers.ResultContainsNumberOfErrorsInMethod.containsNumberOfErrors; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class FieldNotInitializedTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/FieldNotInitialized.java"; - - public static final String FIELD_NOT_INITIALIZED = - "ERADICATE_FIELD_NOT_INITIALIZED"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadEradicateResults(FieldNotInitializedTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - assertThat( - "Results should contain " + FIELD_NOT_INITIALIZED, - inferResults, - containsNumberOfErrors( - FIELD_NOT_INITIALIZED, - SOURCE_FILE, - "", - 1 - ) - ); - - String[] procedures = {""}; - assertThat( - "Results should contain " + FIELD_NOT_INITIALIZED, - inferResults, - containsExactly( - FIELD_NOT_INITIALIZED, - SOURCE_FILE, - procedures - ) - ); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/FieldNotNullableTest.java b/infer/tests/endtoend/java/eradicate/FieldNotNullableTest.java deleted file mode 100644 index 90ce4ad5b..000000000 --- a/infer/tests/endtoend/java/eradicate/FieldNotNullableTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class FieldNotNullableTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/FieldNotNullable.java"; - - public static final String FIELD_NOT_NULLABLE = - "ERADICATE_FIELD_NOT_NULLABLE"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadEradicateResults(FieldNotNullableTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "setYNull", - "setYNullable", - "", - "FlatBAD1", - "FlatBAD2", - "NestedBAD1", - "NestedBAD2", - "NestedBAD3", - "putNull", - }; - assertThat( - "Results should contain " + FIELD_NOT_NULLABLE, - inferResults, - containsExactly( - FIELD_NOT_NULLABLE, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/InconsistentSubclassAnnotationTest.java b/infer/tests/endtoend/java/eradicate/InconsistentSubclassAnnotationTest.java deleted file mode 100644 index f6cdd9be4..000000000 --- a/infer/tests/endtoend/java/eradicate/InconsistentSubclassAnnotationTest.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ErrorPattern.createPatterns; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; -import java.util.List; - -import utils.InferException; -import utils.InferResults; -import utils.matchers.ErrorPattern; - -public class InconsistentSubclassAnnotationTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/InconsistentSubclassAnnotation.java"; - - public static final String ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION = - "ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION"; - - public static final String ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION = - "ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = InferResults.loadEradicateResults( - InconsistentSubclassAnnotationTest.class, - SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - - - String[] returnMethods = {"foo", "baz"}; - List errorPatterns = createPatterns( - ERADICATE_INCONSISTENT_SUBCLASS_RETURN_ANNOTATION, - SOURCE_FILE, - returnMethods); - - String[] parameterMethods = {"deref", "implementInAnotherFile"}; - errorPatterns.addAll( - createPatterns( - ERADICATE_INCONSISTENT_SUBCLASS_PARAMETER_ANNOTATION, - SOURCE_FILE, - parameterMethods - ) - ); - - assertThat( - "Results should contain ", - inferResults, - containsExactly(errorPatterns) - ); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/LibraryCallsTest.java b/infer/tests/endtoend/java/eradicate/LibraryCallsTest.java deleted file mode 100644 index c3da7ea3e..000000000 --- a/infer/tests/endtoend/java/eradicate/LibraryCallsTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class LibraryCallsTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/LibraryCalls.java"; - - public static final String NULL_METHOD_CALL = - "ERADICATE_NULL_METHOD_CALL"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadEradicateResults(LibraryCallsTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "badReferenceDereference", - "badWeakReferenceDereference", - "badPhantomReferenceDereference", - "badSoftReferenceDereference", - "badAtomicReferenceDereference", - }; - assertThat( - "Results should contain " + NULL_METHOD_CALL, - inferResults, - containsExactly( - NULL_METHOD_CALL, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/NoReuseUndefFunctionValuesTest.java b/infer/tests/endtoend/java/eradicate/NoReuseUndefFunctionValuesTest.java deleted file mode 100644 index 708ba9911..000000000 --- a/infer/tests/endtoend/java/eradicate/NoReuseUndefFunctionValuesTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2015 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsNoErrorInMethod.doesNotContain; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class NoReuseUndefFunctionValuesTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/NoReuseUndefFunctionValues.java"; - - public static final String FIELD_NOT_INITIALIZED = - "ERADICATE_FIELD_NOT_INITIALIZED"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadEradicateResults(NoReuseUndefFunctionValuesTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() throws IOException, InterruptedException, InferException { - assertThat( - "Results should not contain " + FIELD_NOT_INITIALIZED, - inferResults, - doesNotContain( - FIELD_NOT_INITIALIZED, - SOURCE_FILE, - "")); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/NullFieldAccessTest.java b/infer/tests/endtoend/java/eradicate/NullFieldAccessTest.java deleted file mode 100644 index 8fc448aee..000000000 --- a/infer/tests/endtoend/java/eradicate/NullFieldAccessTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class NullFieldAccessTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/NullFieldAccess.java"; - - public static final String NULL_FIELD_ACCESS = - "ERADICATE_NULL_FIELD_ACCESS"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadEradicateResults(NullFieldAccessTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "useX", - "useZ", - "useInterface", - "arrayLength", - "arrayAccess", - }; - assertThat( - "Results should contain " + NULL_FIELD_ACCESS, - inferResults, - containsExactly( - NULL_FIELD_ACCESS, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/NullMethodCallTest.java b/infer/tests/endtoend/java/eradicate/NullMethodCallTest.java deleted file mode 100644 index a8a77f83b..000000000 --- a/infer/tests/endtoend/java/eradicate/NullMethodCallTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class NullMethodCallTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/NullMethodCall.java"; - - public static final String NULL_METHOD_CALL = "ERADICATE_NULL_METHOD_CALL"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadEradicateResults(NullMethodCallTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "callOnNull", - "outerField", - "outerPrivateField", - "testFieldAssignmentIfThenElse", - "testExceptionPerInstruction", - "testSystemGetPropertyReturn", - "textUtilsIsEmpty", - "myTextUtilsIsEmpty", - "myTextUtilsNotIsNotEmpty", - }; - assertThat( - "Results should contain " + NULL_METHOD_CALL, - inferResults, - containsExactly( - NULL_METHOD_CALL, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/ParameterNotNullableTest.java b/infer/tests/endtoend/java/eradicate/ParameterNotNullableTest.java deleted file mode 100644 index a873b4955..000000000 --- a/infer/tests/endtoend/java/eradicate/ParameterNotNullableTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class ParameterNotNullableTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/ParameterNotNullable.java"; - - public static final String PARAMETER_NOT_NULLABLE = - "ERADICATE_PARAMETER_NOT_NULLABLE"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadEradicateResults(ParameterNotNullableTest.class, SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "callNull", - "callNullable", - "testSystemGetPropertyArgument", - "testClassGetResourceArgument", - }; - assertThat( - "Results should contain " + PARAMETER_NOT_NULLABLE, - inferResults, - containsExactly( - PARAMETER_NOT_NULLABLE, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/ReturnNotNullableTest.java b/infer/tests/endtoend/java/eradicate/ReturnNotNullableTest.java deleted file mode 100644 index 1babf4dbb..000000000 --- a/infer/tests/endtoend/java/eradicate/ReturnNotNullableTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ErrorPattern.createPatterns; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; -import java.util.List; - -import utils.InferException; -import utils.InferResults; -import utils.matchers.ErrorPattern; - -public class ReturnNotNullableTest { - - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/ReturnNotNullable.java"; - - public static final String RETURN_NOT_NULLABLE = - "ERADICATE_RETURN_NOT_NULLABLE"; - public static final String CONDITION_REDUNDANT_NONNULL = - "ERADICATE_CONDITION_REDUNDANT_NONNULL"; - public static final String RETURN_OVER_ANNOTATED = - "ERADICATE_RETURN_OVER_ANNOTATED"; - - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = - InferResults.loadEradicateResults(ReturnNotNullableTest.class, SOURCE_FILE); - } - - boolean returnOverAnnotatedEnabled = true; - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - - - String[] nullableMethods = { - "returnNull", - "returnNullable", - "return_null_in_catch", - "return_null_in_catch_after_throw", - "getResourceNullable", - "tryWithResourcesReturnNullable", - }; - List errorPatterns = createPatterns( - RETURN_NOT_NULLABLE, - SOURCE_FILE, - nullableMethods); - - String[] redundantMethods = { - "redundantEq", - "redundantNeq", - }; - errorPatterns.addAll( - createPatterns( - CONDITION_REDUNDANT_NONNULL, - SOURCE_FILE, - redundantMethods - ) - ); - - if (returnOverAnnotatedEnabled) { - errorPatterns.addAll( - createPatterns( - RETURN_OVER_ANNOTATED, - SOURCE_FILE, - redundantMethods - ) - ); - } - - assertThat( - "Results should contain ", - inferResults, - containsExactly(errorPatterns) - ); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/SuppressWarningsTest.java b/infer/tests/endtoend/java/eradicate/SuppressWarningsTest.java deleted file mode 100644 index f47722cd8..000000000 --- a/infer/tests/endtoend/java/eradicate/SuppressWarningsTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2015 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsNoErrorInMethod.doesNotContain; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class SuppressWarningsTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/SuppressWarningsExample.java"; - - public static final String NULL_METHOD_CALL = "ERADICATE_NULL_METHOD_CALL"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = InferResults.loadEradicateResults( - SuppressWarningsTest.class, - SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - "doNotSuppressWrongAnnot", - "doNotSuppressNoAnnot" - }; - assertThat( - "Results should contain " + NULL_METHOD_CALL, - inferResults, - containsExactly( - NULL_METHOD_CALL, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/endtoend/java/eradicate/SuppressedFieldNotInitializedTest.java b/infer/tests/endtoend/java/eradicate/SuppressedFieldNotInitializedTest.java deleted file mode 100644 index 040d934a1..000000000 --- a/infer/tests/endtoend/java/eradicate/SuppressedFieldNotInitializedTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2013 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -package endtoend.java.eradicate; - -import static org.hamcrest.MatcherAssert.assertThat; -import static utils.matchers.ResultContainsNoErrorInMethod.doesNotContain; -import static utils.matchers.ResultContainsExactly.containsExactly; - -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; - -import utils.InferException; -import utils.InferResults; - -public class SuppressedFieldNotInitializedTest { - - public static final String SOURCE_FILE = - "infer/tests/codetoanalyze/java/eradicate/SuppressedFieldNotInitializedExample.java"; - - public static final String FIELD_NOT_INITIALIZED = - "ERADICATE_FIELD_NOT_INITIALIZED"; - - private static InferResults inferResults; - - @BeforeClass - public static void loadResults() throws InterruptedException, IOException { - inferResults = InferResults.loadEradicateResults( - SuppressedFieldNotInitializedTest.class, - SOURCE_FILE); - } - - @Test - public void matchErrors() - throws IOException, InterruptedException, InferException { - String[] methods = { - }; - assertThat( - "Results should contain " + FIELD_NOT_INITIALIZED, - inferResults, - containsExactly( - FIELD_NOT_INITIALIZED, - SOURCE_FILE, - methods)); - } - -} diff --git a/infer/tests/utils/InferResults.java b/infer/tests/utils/InferResults.java index 17a3d1408..d483297ab 100644 --- a/infer/tests/utils/InferResults.java +++ b/infer/tests/utils/InferResults.java @@ -68,8 +68,7 @@ public class InferResults { errorType.equals("DANGLING_POINTER_DEREFERENCE") || errorType.equals("IVAR_NOT_NULL_CHECKED") || errorType.equals("BAD_POINTER_COMPARISON") || - errorType.equals("MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE") || - errorType.startsWith("ERADICATE")) { + errorType.equals("MUTABLE_LOCAL_VARIABLE_IN_COMPONENT_FILE")) { Integer errorLine = Integer.parseInt(items[5].trim()); String procedure = items[6]; Path path = Paths.get(items[8]); @@ -176,22 +175,6 @@ public class InferResults { InferResults.JAVA_METHOD_NAME); } - public static InferResults loadEradicateResults(Class currentClass, String sourceFile) { - return loadResultsFromPath( - currentClass, - sourceFile, - "/infer/tests/codetoanalyze/java/eradicate/report.csv", - InferResults.JAVA_METHOD_NAME); - } - - public static InferResults loadCheckersResults(Class currentClass, String sourceFile) { - return loadResultsFromPath( - currentClass, - sourceFile, - "/infer/tests/codetoanalyze/java/checkers/report.csv", - InferResults.JAVA_METHOD_NAME); - } - public static InferResults loadTracingResults(Class currentClass, String sourceFile) { return loadResultsFromPath( currentClass,