Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8345622

test/langtools/tools/javac/annotations/parameter/ParameterAnnotations.java should set processorpath to work correctly in the agentvm mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 24, 25
    • tools
    • None
    • b03

      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.

            jlahoda Jan Lahoda
            liach Chen Liang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: