From 73ec1ed91ea50a58f0ecf5a19799b75f77e32e4d Mon Sep 17 00:00:00 2001 From: Liam Miller-Cushon Date: Tue, 23 Jul 2024 09:58:06 -0700 Subject: [PATCH] Disable implicit annotation processing in some tests Fixes ``` Note: Annotation processing is enabled because one or more processors were found on the class path. A future release of javac may disable annotation processing unless at least one processor is specified by name (-processor), or a search path is specified (--processor-path, --processor-module-path), or annotation processing is enabled explicitly (-proc:only, -proc:full). Use -Xlint:-options to suppress this message. Use -proc:none to disable annotation processing. ``` PiperOrigin-RevId: 655203565 --- .../threadsafety/GuardedByBinderTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/GuardedByBinderTest.java b/core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/GuardedByBinderTest.java index 5ad07056f184..73dcb7500617 100644 --- a/core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/GuardedByBinderTest.java +++ b/core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/GuardedByBinderTest.java @@ -21,6 +21,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.fail; +import com.google.common.collect.ImmutableList; import com.google.errorprone.FileManagers; import com.google.errorprone.VisitorState; import com.google.errorprone.util.ASTHelpers; @@ -34,7 +35,6 @@ import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Optional; import javax.tools.JavaCompiler; @@ -497,13 +497,13 @@ private static String bind(String className, String exprString, JavaFileObject f JavacTaskImpl task = (JavacTaskImpl) javaCompiler.getTask( - new PrintWriter( + /* out= */ new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.err, UTF_8)), true), - FileManagers.testFileManager(), - null, - Collections.emptyList(), - null, - Arrays.asList(fileObject)); + /* fileManager= */ FileManagers.testFileManager(), + /* diagnosticListener= */ null, + /* options= */ ImmutableList.of("-proc:none"), + /* classes= */ null, + /* compilationUnits= */ Arrays.asList(fileObject)); Iterable compilationUnits = task.parse(); task.analyze(); for (CompilationUnitTree compilationUnit : compilationUnits) {