summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-04-29 15:16:33 +0000
committerPaul Phillips <paulp@improving.org>2010-04-29 15:16:33 +0000
commit37893fe867658b241fd5c48ae3bb97301986862c (patch)
tree071f248214fa89cb491fb0d4a85fb015d21ab58b
parent4bd4c7f4d47d85d5c3daaa5f3850466197b08f1c (diff)
downloadscala-37893fe867658b241fd5c48ae3bb97301986862c.tar.gz
scala-37893fe867658b241fd5c48ae3bb97301986862c.tar.bz2
scala-37893fe867658b241fd5c48ae3bb97301986862c.zip
Removes pointless reference queue from the Symb...
Removes pointless reference queue from the Symbol cache. Closes #3370, no review.
-rw-r--r--src/library/scala/Symbol.scala5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/library/scala/Symbol.scala b/src/library/scala/Symbol.scala
index a6d6f1e21f..0c347b07b9 100644
--- a/src/library/scala/Symbol.scala
+++ b/src/library/scala/Symbol.scala
@@ -48,11 +48,10 @@ object Symbol extends UniquenessCache[String, Symbol]
* abstracted to offer some hope of reusability. */
private[scala] abstract class UniquenessCache[K, V >: Null]
{
- import java.lang.ref.{ ReferenceQueue, WeakReference }
+ import java.lang.ref.WeakReference
import java.util.WeakHashMap
import java.util.concurrent.locks.ReentrantReadWriteLock
- private val queue = new ReferenceQueue[V]
private val rwl = new ReentrantReadWriteLock()
private val rlock = rwl.readLock
private val wlock = rwl.writeLock
@@ -78,7 +77,7 @@ private[scala] abstract class UniquenessCache[K, V >: Null]
if (res != null) res
else {
val sym = valueFromKey(name)
- map.put(name, new WeakReference(sym, queue))
+ map.put(name, new WeakReference(sym))
sym
}
}