Consider code like:
---
com.sun.source.util.JavacTask task =
(com.sun.source.util.JavacTask) provider.getTask(compilerOut, null, null, options, null, inputFile);
Processor processor =
(Processor) processorClass.getDeclaredConstructor().newInstance();
task.setProcessors(List.of(processor));
task.analyze();
---
This will produce warning like:
---
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.
---
which is incorrect, as the processors where passed in using the API.