Skip to content

Commit

Permalink
Disable implicit annotation processing in some tests
Browse files Browse the repository at this point in the history
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: 655236694
  • Loading branch information
cushon authored and Error Prone Team committed Jul 23, 2024
1 parent f97736d commit 9f4b7d0
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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.<String>emptyList(),
null,
Arrays.asList(fileObject));
/* fileManager= */ FileManagers.testFileManager(),
/* diagnosticListener= */ null,
/* options= */ ImmutableList.of("-proc:none"),
/* classes= */ null,
/* compilationUnits= */ Arrays.asList(fileObject));
Iterable<? extends CompilationUnitTree> compilationUnits = task.parse();
task.analyze();
for (CompilationUnitTree compilationUnit : compilationUnits) {
Expand Down

0 comments on commit 9f4b7d0

Please sign in to comment.