From 9006002011e5d6659f7f3efcb504676998fbb966 Mon Sep 17 00:00:00 2001 From: Weitian Xing Date: Thu, 27 Aug 2020 20:09:10 -0400 Subject: [PATCH 1/3] Fix NPE error in class declaration. --- src/checkers/inference/InferenceAnnotatedTypeFactory.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/checkers/inference/InferenceAnnotatedTypeFactory.java b/src/checkers/inference/InferenceAnnotatedTypeFactory.java index bbbefa4d2..56a64bd78 100644 --- a/src/checkers/inference/InferenceAnnotatedTypeFactory.java +++ b/src/checkers/inference/InferenceAnnotatedTypeFactory.java @@ -568,13 +568,8 @@ protected InferenceViewpointAdapter createViewpointAdapter() { return withCombineConstraints ? new InferenceViewpointAdapter(this) : null; } - /** - * Get the real top annotation from {@link #realTypeFactory}. - * @return the real top annotation. - */ @Override protected Set getDefaultTypeDeclarationBounds() { - return realTypeFactory.getQualifierHierarchy().getTopAnnotations(); + return this.getQualifierHierarchy().getTopAnnotations(); } } - From eebcd94a975fe0ceb7a5111374ba9eded02623ee Mon Sep 17 00:00:00 2001 From: Weitian Xing Date: Thu, 27 Aug 2020 20:34:31 -0400 Subject: [PATCH 2/3] Remove hack mode. --- build.gradle | 20 ++----------------- .../inference/DataflowInferenceTest.java | 5 ----- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/build.gradle b/build.gradle index e1dc1a368..f47f83ba2 100644 --- a/build.gradle +++ b/build.gradle @@ -111,9 +111,8 @@ test { dependsOn('dist') systemProperties 'path.afu.scripts': "${afu}/scripts", - 'use.hacks': true - - systemProperties += [JDK_JAR: "${checkerFrameworkPath}/checker/dist/jdk8.jar"] + 'path.inference.script': "${projectDir}/scripts/inference", + JDK_JAR: "${checkerFrameworkPath}/checker/dist/jdk8.jar" if (project.hasProperty('emit.test.debug')) { systemProperties += ["emit.test.debug": 'true'] @@ -266,7 +265,6 @@ task testCheckerInferenceDevScript(type: Exec, dependsOn: [dist, dependenciesJar args = ['--mode', 'INFER', '--checker', 'interning.InterningChecker', '--solver', 'checkers.inference.solver.MaxSat2TypeSolver', - '--hacks=true', 'testdata/interning/MapAssignment.java'] } @@ -291,20 +289,6 @@ afterEvaluate { // Configure Tests tasks.withType(Test) { - dependsOn(shadowJar) - - systemProperties 'path.afu.scripts': "${afu}/scripts", - 'path.inference.script': "${projectDir}/scripts/inference", - 'use.hacks': true, - JDK_JAR: "${checkerFrameworkPath}/checker/dist/jdk8.jar" - - if (project.hasProperty('emit.test.debug')) { - systemProperties += ["emit.test.debug": 'true'] - } - - if (isJava8) { - jvmArgs += ["-Xbootclasspath/p:${configurations.javacJar.asPath}"] - } testLogging { // Always run the tests diff --git a/tests/checkers/inference/DataflowInferenceTest.java b/tests/checkers/inference/DataflowInferenceTest.java index bb530736f..d016b6e56 100644 --- a/tests/checkers/inference/DataflowInferenceTest.java +++ b/tests/checkers/inference/DataflowInferenceTest.java @@ -24,11 +24,6 @@ public Pair> getSolverNameAndOptions() { new ArrayList()); } - @Override - public boolean useHacks() { - return true; - } - @Parameters public static List getTestFiles(){ List testfiles = new ArrayList<>();//InferenceTestUtilities.findAllSystemTests(); From 288723840ddfe15ccfa1f341f4c77b6b52598db2 Mon Sep 17 00:00:00 2001 From: Weitian Xing Date: Thu, 27 Aug 2020 20:47:33 -0400 Subject: [PATCH 3/3] We can remove the overridden method. --- src/checkers/inference/InferenceAnnotatedTypeFactory.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/checkers/inference/InferenceAnnotatedTypeFactory.java b/src/checkers/inference/InferenceAnnotatedTypeFactory.java index 56a64bd78..98dbb0a2f 100644 --- a/src/checkers/inference/InferenceAnnotatedTypeFactory.java +++ b/src/checkers/inference/InferenceAnnotatedTypeFactory.java @@ -567,9 +567,4 @@ public void setRoot(final CompilationUnitTree root) { protected InferenceViewpointAdapter createViewpointAdapter() { return withCombineConstraints ? new InferenceViewpointAdapter(this) : null; } - - @Override - protected Set getDefaultTypeDeclarationBounds() { - return this.getQualifierHierarchy().getTopAnnotations(); - } }