On 24/06/2020 7:43 pm, Alan Bateman wrote:
On 24/06/2020 10:26, David Holmes wrote:
If we call setAccessible(true) then canAccess will return true.
Sure but the bug fix will remove the setAccessible(true) so canAccess
will do what he wants without needing to catch the exception. This is of
course all a side show to the important issue of aligning the spec and
implementation.
But you are ignoring my next statement. If we remove the
setAccessible(true) then the premain method will not be accessible as
Serguei reported.
Exception in thread "main" java.lang.IllegalAccessException: class
sun.instrument.InstrumentationImpl
(in module java.instrument) cannot access a member of class
SimpleAgent with modifiers "public static"
I feel we are talking past each other on this issue with regards to the
IllegalAcessError that comes from the module system.
David
-----
-Alan