On Wed, 16 Dec 2020 08:18:49 GMT, Alan Bateman <al...@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

Reply via email to