RFR: 8165276: Spec states to invoke the premain method in an agent class if it's public but implementation differs [v4]
Mandy Chung
mchung at openjdk.java.net
Wed Dec 16 19:46:58 UTC 2020
On Wed, 16 Dec 2020 08:18:49 GMT, Alan Bateman <alanb at openjdk.org> wrote:
> So PR1694 is really just about aligning the spec so that the premain method is public. However, it does not fix the overall accessibility issue.
OK I see that JDK-5070281 changes to allow the agent class to be non-public as the main class that declares `public static void main`. So `setAccessible` should only be called if the agent class is in an unnamed module.
If the agent class is in a named module and not accessible to java.instrument module (if the java agent is packaged in a modular JAR file), it should fail with IAE - can you confirm? I wanted to understand the current behavior.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1694
More information about the serviceability-dev
mailing list