JDK 9 proposal: remove sun.misc.Ref

Remi Forax forax at univ-mlv.fr
Wed Jan 8 08:02:49 UTC 2014


On 01/08/2014 03:26 AM, Stuart Marks wrote:
> On 1/7/14 2:26 PM, Joe Darcy wrote:
>>> public abstract class Ref {
>>
>> 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.
>
> When in doubt, take it out.
>
> I had a small concern about whether sun.misc.Ref still might have had 
> some dependencies from the JVM (i.e. special support like the 
> java.lang.ref classes), but it looks like sun.misc.Ref itself is 
> entirely implemented in terms of java.lang.ref.SoftReference. I did a 
> quick search of hotspot and I couldn't find any mentions of 
> sun.misc.Ref, so I think we're clear.
>
> s'marks

yes, delete it.

Rémi




More information about the core-libs-dev mailing list