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

Joe Darcy darcy at openjdk.org
Wed Dec 11 17:47:11 UTC 2024


On Wed, 11 Dec 2024 08:48:21 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> 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.

Marked as reviewed by darcy (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/22676#pullrequestreview-2496413809


More information about the compiler-dev mailing list