@Override public boolean equals(Object other) { if (other == null) { return false; } @SuppressWarnings("rawtypes") WeakRef o = (WeakRef) other; return o.get() == get(); }
public V get(K key) { WeakRef<K, V> lookupRef = new WeakRef<K, V>(key, refQueue, null); WeakRef<K, V> ref = map.get(lookupRef); if (ref == null) { // Reference lost // System.out.println("** Lost reference to statement=" + dumpObj(key)); return null; } else { return ref.getHardRef(); } }