Removes pointless reference queue from the Symbol cache.

Closes #3370, no review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@21752 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
extempore 2010-04-29 15:16:33 +00:00
parent 59141409e4
commit 73ccfc028a
1 changed files with 2 additions and 3 deletions

View File

@ -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
}
}