Accessing internals in Java 11

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing internals in Java 11

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?

 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
Reply | Threaded
Open this post in threaded view
|

Re: Accessing internals in Java 11

Alan Bateman
On 25/03/2018 08:32, Nicolai Parlog wrote:

>   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
Reply | Threaded
Open this post in threaded view
|

Re: Accessing internals in Java 11

Russell Gold
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

> On Mar 25, 2018, at 9:57 AM, Alan Bateman <[hidden email]> wrote:
>
> On 25/03/2018 08:32, Nicolai Parlog wrote:
>>  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