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

Jan Lahoda jlahoda at openjdk.org
Wed Dec 11 08:53:09 UTC 2024


There is a small difference in the `run main` action when the tests are run using the jtreg's `othervm` mode and `agentvm` mode: in the `othervm`, the test class(es) are load using the application `ClassLoader`, in the `agentvm` mode, the test class(es) are load using an additional jtreg's `ClassLoader`.

In most cases, this does not make much difference, but there's a difference when javac looks up annotation processors (or `Plugin`s): the `othervm` mode, javac can lookup the APs without any help, but in the `agentvm` mode, the `-processorpath` needs to be specified, so that the AP can be load from the correct place.

This patch undoes this (temporary) change:
https://github.com/openjdk/jdk/commit/496641955041c5e48359e6256a4a61812653d900#diff-4a737e56ccac351e29c3b2c2313d854284ec489aa56c78f09d374d9e20bbb4ecR643

and sets the `-processorpath`, so that the AP can be load. This is consistent with how other similar javac's tests work.

-------------

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

Changes: https://git.openjdk.org/jdk/pull/22676/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22676&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8345622
  Stats: 3 lines in 1 file changed: 2 ins; 1 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/22676.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22676/head:pull/22676

PR: https://git.openjdk.org/jdk/pull/22676


More information about the compiler-dev mailing list