Re:Removal of Unsafe in Java 9 – A disaster in the making
by pjmlp on Monday July 13, 2015 @03:29PM
(#9880444)
One of the purposes of Jigsaw is offering a way to define a public API based on multiple jar files, similar to what
OSGi does.
Similar in concept how Assembly Modules work in .NET, with friendly internals, which incidentally not many devs know about.
In Java's case a linker will be part of the SDK, so that only the Java code required for a given application will be deployed.
Since Oracle needed to clean up dependencies to implement Jigsaw, they are taking the opportunity to also remove most internal APIs, Unsafe being one of them.
They are also in the process of replacing JNI with something more programming friendly, P/Invoke style, but it will only come in Java 10.
There is also the reason that in a memory safe language every use of JNI and Unsafe is another security bug waiting to happen. If the compiler/runtime are able to offer safe APIs with similar performance, then those exploits can be avoided.
Similar in concept how Assembly Modules work in .NET, with friendly internals, which incidentally not many devs know about.
In Java's case a linker will be part of the SDK, so that only the Java code required for a given application will be deployed.
Since Oracle needed to clean up dependencies to implement Jigsaw, they are taking the opportunity to also remove most internal APIs, Unsafe being one of them.
They are also in the process of replacing JNI with something more programming friendly, P/Invoke style, but it will only come in Java 10.
There is also the reason that in a memory safe language every use of JNI and Unsafe is another security bug waiting to happen. If the compiler/runtime are able to offer safe APIs with similar performance, then those exploits can be avoided.