RFR: 8165276: Spec states to invoke the premain method in an agent class if it's public but implementation differs [v8]

Serguei Spitsyn sspitsyn at openjdk.java.net
Fri Dec 18 17:57:56 UTC 2020


On Thu, 17 Dec 2020 20:19:56 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   added to NegativeAgentRunner exit value check to be non-zero
>
> @sspitsyn  Thanks for the update.   I think it's good to add the unnamed module check before calling `setAccessible` that becomes clear that this check only intends for unnamed module.   Maybe make it clear in the comment something like this: 
> 
>     // if the java agent class is in an unnamed module, the java agent class can be non-public.
>     // suppress access check upon the invocation of the premain/agentmain method
> 
> Since the agent class can be non-public, it means that it's not necessary to modify the test agent class to public as you did in this patch.
> 
> I don't think `@library /test` is needed, isn't it?  The test library classes are under test/lib.

@mlchung Thank you for the suggestions. I've addressed them in the latest update.
The `@library /test` is needed only in the tests that use NegativeAgentRunner as this class is located in folder one level up.
I've removed the this line from the other tests.

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

PR: https://git.openjdk.java.net/jdk/pull/1694


More information about the serviceability-dev mailing list