When I was disabling previews for JDK-8334733, I noted in `test/langtools/tools/javac/annotations/parameter/ParameterAnnotations.java`, if the `TestAP` processor is passed as a command line argument like
```
"-processor", TestAP.class.getName(),
```
in options, it succeeds with previews enabled, and fails with previews disabled like:
```
test: testInnerClass
[DIRECT]:
- compiler.err.proc.processor.not.found: ParameterAnnotations$TestAP
- compiler.err.proc.no.explicit.annotation.processing.requested: T$I
2 errors
Exception running test testInnerClass: toolbox.Task$TaskError: Task javac failed: rc=1
toolbox.Task$TaskError: Task javac failed: rc=1
at toolbox.AbstractTask.checkExit(AbstractTask.java:154)
at toolbox.JavacTask.run(JavacTask.java:381)
at toolbox.AbstractTask.run(AbstractTask.java:102)
at toolbox.JavacTask.run(JavacTask.java:52)
at toolbox.JavacTask.run(JavacTask.java:321)
at ParameterAnnotations.doTest(ParameterAnnotations.java:650)
at ParameterAnnotations.testInnerClass(ParameterAnnotations.java:151)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at toolbox.TestRunner.runTests(TestRunner.java:91)
at ParameterAnnotations.runTests(ParameterAnnotations.java:82)
at ParameterAnnotations.main(ParameterAnnotations.java:73)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
at java.base/java.lang.Thread.run(Thread.java:1447)
```
This might be related to our recent tightening of annotation processor policies, but it should not be less strict when preview is on.
```
"-processor", TestAP.class.getName(),
```
in options, it succeeds with previews enabled, and fails with previews disabled like:
```
test: testInnerClass
[DIRECT]:
- compiler.err.proc.processor.not.found: ParameterAnnotations$TestAP
- compiler.err.proc.no.explicit.annotation.processing.requested: T$I
2 errors
Exception running test testInnerClass: toolbox.Task$TaskError: Task javac failed: rc=1
toolbox.Task$TaskError: Task javac failed: rc=1
at toolbox.AbstractTask.checkExit(AbstractTask.java:154)
at toolbox.JavacTask.run(JavacTask.java:381)
at toolbox.AbstractTask.run(AbstractTask.java:102)
at toolbox.JavacTask.run(JavacTask.java:52)
at toolbox.JavacTask.run(JavacTask.java:321)
at ParameterAnnotations.doTest(ParameterAnnotations.java:650)
at ParameterAnnotations.testInnerClass(ParameterAnnotations.java:151)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at toolbox.TestRunner.runTests(TestRunner.java:91)
at ParameterAnnotations.runTests(ParameterAnnotations.java:82)
at ParameterAnnotations.main(ParameterAnnotations.java:73)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
at java.base/java.lang.Thread.run(Thread.java:1447)
```
This might be related to our recent tightening of annotation processor policies, but it should not be less strict when preview is on.
- relates to
-
JDK-8334733 Remove obsolete @enablePreview from tests after JDK-8334714
- Resolved
- links to
-
Commit(master) openjdk/jdk/1bdb7b42
-
Review(master) openjdk/jdk/22676