Discussion:
Accessing internals in Java 11
Nicolai Parlog
2018-03-25 07:32:33 UTC
Permalink
Hi!

On Java 9 and 10, the JPMS is forgiving when it comes to illegal
access of JDK internals and jdk.unsupported offers classes like Unsafe
or Signal. The same is true for 11-b5.

Are there any plans to change this, i.e. will Java 11 become stricter
before the release? Would --illegal-access get a different default
value or might jdk.unsupported get smaller?

so long ... Nicolai
--
PGP Key:
http://keys.gnupg.net/pks/lookup?op=vindex&search=0xCA3BAD2E9CCCD509

Web:
http://codefx.org
a blog about software development
https://www.sitepoint.com/java
high-quality Java/JVM content
http://do-foss.de
Free and Open Source Software for the City of Dortmund

Twitter:
https://twitter.com/nipafx
Alan Bateman
2018-03-25 13:57:38 UTC
Permalink
Post by Nicolai Parlog
Hi!
On Java 9 and 10, the JPMS is forgiving when it comes to illegal
access of JDK internals and jdk.unsupported offers classes like Unsafe
or Signal. The same is true for 11-b5.
Are there any plans to change this, i.e. will Java 11 become stricter
before the release? Would --illegal-access get a different default
value or might jdk.unsupported get smaller?
TBD on dialing up the encapsulation of JDK internals, JDK 11 might be
too soon. I'm sure there will be lots of discussion on this once the
time comes.

The only changes to class in the jdk.unsupported module so far have been
the removal of Reflection.getClassClass and Unsafe.defineClass. There
were terminally deprecated (@Deprecated forRemoval=true) so shouldn't be
a surprise to anyone.

-Alan
Russell Gold
2018-03-27 12:11:19 UTC
Permalink
That would be true if it was easy to find the Javadoc for the class.

I think the problem may be that tooling for MR jars is still all-but-nonexistent, and that classes like Unsafe aren’t accessible when using the latest JDK with the —release switch. That, plus the much faster release schedule, means that we need to support a wider range of Java versions than ever before, but don’t have the tools to facilitate doing so.

- Russ
Post by Nicolai Parlog
Hi!
On Java 9 and 10, the JPMS is forgiving when it comes to illegal
access of JDK internals and jdk.unsupported offers classes like Unsafe
or Signal. The same is true for 11-b5.
Are there any plans to change this, i.e. will Java 11 become stricter
before the release? Would --illegal-access get a different default
value or might jdk.unsupported get smaller?
TBD on dialing up the encapsulation of JDK internals, JDK 11 might be too soon. I'm sure there will be lots of discussion on this once the time comes.
-Alan
Loading...