--- old/src/java.base/share/classes/java/lang/ref/Reference.java 2015-05-12 23:11:44.878652809 +0200 +++ new/src/java.base/share/classes/java/lang/ref/Reference.java 2015-05-12 23:11:44.767654767 +0200 @@ -94,10 +94,16 @@ volatile ReferenceQueue queue; + /* When a Reference is de-queued from ReferenceQueue, Reference.next + * points to this object. + */ + private static class Dequeued extends Reference { Dequeued() { super(null); } } + static final Reference DEQUEUED = new Dequeued(); + /* When active: NULL * pending: this * Enqueued: next reference in queue (or this if last) - * Inactive: this + * Inactive: DEQUEUED */ @SuppressWarnings("rawtypes") Reference next;