diff --git a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationVisitor.java b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationVisitor.java index e17443a5d59..ea2596de1c1 100644 --- a/checker/src/main/java/org/checkerframework/checker/initialization/InitializationVisitor.java +++ b/checker/src/main/java/org/checkerframework/checker/initialization/InitializationVisitor.java @@ -72,11 +72,11 @@ public InitializationVisitor(BaseTypeChecker checker) { } @Override - public void setRoot(CompilationUnitTree root) { + public void setRoot(CompilationUnitTree newRoot) { // Clean up the cache of initialized fields once per compilation unit. // Alternatively, but harder to determine, this could be done once per top-level class. initializedFields.clear(); - super.setRoot(root); + super.setRoot(newRoot); } @Override diff --git a/checker/src/main/java/org/checkerframework/checker/mustcall/MustCallAnnotatedTypeFactory.java b/checker/src/main/java/org/checkerframework/checker/mustcall/MustCallAnnotatedTypeFactory.java index 26137ddd6b0..b137c9de2c6 100644 --- a/checker/src/main/java/org/checkerframework/checker/mustcall/MustCallAnnotatedTypeFactory.java +++ b/checker/src/main/java/org/checkerframework/checker/mustcall/MustCallAnnotatedTypeFactory.java @@ -149,8 +149,8 @@ public MustCallAnnotatedTypeFactory(BaseTypeChecker checker) { } @Override - public void setRoot(@Nullable CompilationUnitTree root) { - super.setRoot(root); + public void setRoot(@Nullable CompilationUnitTree newRoot) { + super.setRoot(newRoot); // TODO: This should probably be guarded by isSafeToClearSharedCFG from // GenericAnnotatedTypeFactory, but this works here because we know the Must Call Checker is // always the first subchecker that's sharing tempvars. diff --git a/framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java b/framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java index 5c535b4d774..87a6d63544a 100644 --- a/framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java +++ b/framework/src/main/java/org/checkerframework/common/basetype/BaseTypeVisitor.java @@ -383,9 +383,9 @@ public Factory createTypeFactoryPublic() { // ********************************************************************** @Override - public void setRoot(CompilationUnitTree root) { - atypeFactory.setRoot(root); - super.setRoot(root); + public void setRoot(CompilationUnitTree newRoot) { + atypeFactory.setRoot(newRoot); + super.setRoot(newRoot); testJointJavacJavaParserVisitor(); testAnnotationInsertion(); } diff --git a/framework/src/main/java/org/checkerframework/framework/source/SourceVisitor.java b/framework/src/main/java/org/checkerframework/framework/source/SourceVisitor.java index 6d3e1740c3d..4de6349d1fb 100644 --- a/framework/src/main/java/org/checkerframework/framework/source/SourceVisitor.java +++ b/framework/src/main/java/org/checkerframework/framework/source/SourceVisitor.java @@ -66,9 +66,11 @@ protected SourceVisitor(SourceChecker checker) { * Set the CompilationUnitTree to be used during any visits. For any later calls of {@code * com.sun.source.util.TreePathScanner.scan(TreePath, P)}, the CompilationUnitTree of the TreePath * has to be equal to {@code root}. + * + * @param newRoot the new compilation unit */ - public void setRoot(CompilationUnitTree root) { - this.root = root; + public void setRoot(CompilationUnitTree newRoot) { + this.root = newRoot; } /** diff --git a/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java b/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java index 12b302baa59..9f6dc6a2af8 100644 --- a/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java +++ b/framework/src/main/java/org/checkerframework/framework/type/AnnotatedTypeFactory.java @@ -899,11 +899,11 @@ protected void initializeReflectionResolution() { /** * Set the CompilationUnitTree that should be used. * - * @param root the new compilation unit to use + * @param newRoot the new compilation unit to use */ - public void setRoot(@Nullable CompilationUnitTree root) { - if (root != null && wholeProgramInference != null) { - for (Tree typeDecl : root.getTypeDecls()) { + public void setRoot(@Nullable CompilationUnitTree newRoot) { + if (newRoot != null && wholeProgramInference != null) { + for (Tree typeDecl : newRoot.getTypeDecls()) { if (typeDecl.getKind() == Tree.Kind.CLASS) { ClassTree classTree = (ClassTree) typeDecl; wholeProgramInference.preprocessClassTree(classTree); @@ -911,7 +911,7 @@ public void setRoot(@Nullable CompilationUnitTree root) { } } - this.root = root; + this.root = newRoot; // Do not clear here. Only the primary checker should clear this cache. // treePathCache.clear();