JDK 9 proposal: remove sun.misc.Ref

Alan Bateman Alan.Bateman at oracle.com
Wed Jan 8 09:06:14 UTC 2014


On 07/01/2014 22:26, Joe Darcy wrote:
>
> So the type has been deprecated for at least 10 years. Rather than 
> fixing the warning in the class, I think the best course of action is 
> to remove the file in JDK 9. A build of OpenJDK without this file 
> builds fine; if a build of the closed sources goes fine to, I think 
> that should be sufficient justification for this type to be removed.
>
> Using code search engines, there are just a handful of references to 
> sun.misc.Ref in the wihld, but any such uses will have several years 
> to migrate to the standard java.util.SoftReference before JDK 9 ships.
>
> Comments?
See also JDK-6852936 [1] for other candidates to remove. We've always 
been a bit hesitant to remove sun.misc classes out of concern as to 
what/who it might break.

As regards sun.misc.Ref then it would be good to remove it but I think 
the appletviewer code needs to be checked first as it does appear to be 
using it.

Another point to mention is that if do modules right in JDK 9 then the 
access control rules will be extended to support encapsulation and 
therefore it wouldn't be possible to link directly to JDK-internal 
classes. This should allow us to be a bit more aggressive about removing 
unused sun.misc classes.

-Alan

[1] https://bugs.openjdk.java.net/browse/JDK-6852936



More information about the core-libs-dev mailing list