Do not discover annotation processors from the classpath in tests
Previously, if an annotation processors was present in the classpath it was executed as part of tests using `TestCompiler`. This commit updates `TestCompiler` to always set the annotation processors to use. By default, this sets an empty list which does not use annotation processing. Closes gh-31791
This commit is contained in:
parent
0717ea5ca5
commit
33e4129155
|
@ -311,9 +311,7 @@ public final class TestCompiler {
|
||||||
Errors errors = new Errors();
|
Errors errors = new Errors();
|
||||||
CompilationTask task = this.compiler.getTask(null, fileManager, errors,
|
CompilationTask task = this.compiler.getTask(null, fileManager, errors,
|
||||||
this.compilerOptions, null, compilationUnits);
|
this.compilerOptions, null, compilationUnits);
|
||||||
if (!this.processors.isEmpty()) {
|
task.setProcessors(this.processors);
|
||||||
task.setProcessors(this.processors);
|
|
||||||
}
|
|
||||||
boolean result = task.call();
|
boolean result = task.call();
|
||||||
if (!result || errors.hasReportedErrors()) {
|
if (!result || errors.hasReportedErrors()) {
|
||||||
throw new CompilationException(errors.toString(), this.sourceFiles, this.resourceFiles);
|
throw new CompilationException(errors.toString(), this.sourceFiles, this.resourceFiles);
|
||||||
|
|
Loading…
Reference in New Issue