@Override public boolean equals(Object obj) { if (!(obj instanceof HashableWeakReference)) return false; U referent = super.get(); @SuppressWarnings("unchecked") Object other = ((HashableWeakReference<?>) obj).get(); if (referent == null) return other == null; return referent.equals(other); }
public HashableSoftReference(U referent, ReferenceQueue<? super U> queue) { super(referent, queue); this.hashCode = referent.hashCode(); }
@Override public boolean equals(Object obj) { return referent.equals(obj); }
@Override public int hashCode() { return referent.hashCode(); }