Should setAccessible be part of Java or not? (was Re: It's not too late for access control)

Alan Bateman Alan.Bateman at oracle.com
Thu Jul 14 12:14:56 UTC 2016



On 14/07/2016 12:51, Andrew Haley wrote:
> :
> Forgive me if I've missed something, but
> #ReflectiveAccessToNonExportedTypes does not deal with the need to
> make fields or methods accessible to the framework.  That's what
> setAccessible is used for.  It would certainly be nice for a
> framework to be able to say "make it accessible, but only to me."
>
It's related. If a package is exported to you then you can break into 
its non-public types and members with setAccessible. So I think it will 
fall out of the wash once there is agreement on 
#ReflectiveAccessToNonExportedTypes.

-Alan


More information about the jigsaw-dev mailing list