Skip to content

Commit 7e415e7

Browse files
committed
Add JavaDoc for ConcurrentWeakKeysMap#buildWeakReference()
1 parent 8801599 commit 7e415e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/org/truffleruby/collections/ConcurrentWeakKeysMap.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,14 @@ public Value remove(Key key) {
9494
return map.remove(buildWeakReference(key));
9595
}
9696

97+
/** It's important a WeakReference that is built returns true for {@code ref.equals(ref)} even if the reference is
98+
* cleared. */
9799
protected WeakReference<Key> buildWeakReference(Key key) {
98100
return new WeakKeyReference<>(key);
99101
}
100102

103+
/** It's important a WeakReference that is built returns true for {@code ref.equals(ref)} even if the reference is
104+
* cleared. */
101105
protected WeakReference<Key> buildWeakReference(Key key, ReferenceQueue<Key> referenceQueue) {
102106
return new WeakKeyReference<>(key, referenceQueue);
103107
}

0 commit comments

Comments
 (0)