On 24/06/2020 06:50, David Holmes wrote:

It sounds like the use of setAccessible was hiding the need to disable some module related access checks.

This will have a much bigger compatibility problem if agents with a public premain suddenly stop working.
I'm trying to understand what you mean in the final sentence as there is currently no support for compiling or deploying agents as named modules. It was prototyped during JDK 9 but hasn't been a priority to come back. If support were to be added then it might require the agent (in its module declare) to export the package with the entry point to java.instrument but this has no impact on the modifiers of the agent class or premain method, they would both required to include "public".

-Alan.

Reply via email to