15 RFR(XS): 8165276: Spec states that invoke the premain method in an agent class if it's public but implementation differs

Alan Bateman Alan.Bateman at oracle.com
Wed Jun 24 06:22:21 UTC 2020



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.


More information about the serviceability-dev mailing list