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 07:33:27 UTC 2020


On 24/06/2020 07:55, serguei.spitsyn at oracle.com wrote:
>
> Thank you for the example.
> Yes, I'm working on a helpful message and was thinking to use the 
> Reflection method:
>  IllegalAccessException newIllegalAccessException(Class<?> currentClass,
>                                                   Class<?> memberClass,
>                                                   Class<?> targetClass,
>                                                   int modifiers);
m.canAccess(null) will tell you if the premain method is accessible. If 
it returns false then you can thrwo IAE with a useful message.

-Alan.


More information about the serviceability-dev mailing list