Proposal: Allow illegal reflective access by default in JDK 9

Peter Levart peter.levart at
Fri May 19 10:11:26 UTC 2017

On 05/19/2017 01:17 AM, Nicolai Parlog wrote:
> With illegal access being permitted by default much fewer developers
> will be aware of the problem and much less pressure will be put on
> library and framework maintainers as well as on project management to
> invest into paying back this particular form of technical debt. So we
> get much less momentum to make the necessary changes in exchange for...
> not having to add a flag? That's ridiculous, an Armutszeugnis[2] for the
> Java community!


I think that --illegal-access=permit-silently or equivalent is a 
reasonable request (in addition to other modes), but please make the 
--illegal-access=deny the default!

There was a lot of work put into moving various internal classes into 
jdk.internal.* packages (except for some widely used ones), so enabling 
illegal access from classpath by default allows careless developers to 
start using those new internal APIs (such as jdk.internal.misc.Unsafe) 
because they can!!! And we are back to square one when JDK 9 -> JDK 10 
transition is to be made. Not only will we be forced to search for 
public alternatives to existing private (JDK 8-) APIs, but in addition 
to all jdk.internal.* APIs that were newly introduced in JDK 9 too...

Regards, Peter

More information about the jigsaw-dev mailing list