From e7d6bfb2ae497f2e9d124c5bfaca7b975420566c Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 19 May 2009 09:21:55 +0000 Subject: some temporary code to find the bug (NoSuchElem... some temporary code to find the bug (NoSuchElementException) in LinkedHashMap --- .../scala/tools/nsc/symtab/classfile/Pickler.scala | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index c26ea38b55..833df01d83 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -108,7 +108,15 @@ abstract class Pickler extends SubComponent { entries = entries1 } entries(ep) = entry + // debug NoSuchElementException + index.saveTableStringIfResize(entry.hashCode()) + index(entry) = ep + // debug NoSuchElementException + if (index.get(entry) == None) { + println("could not add entry: "+ entry +"; "+ entry.hashCode()) + index.printHashTable(entry.hashCode()) + } ep = ep + 1 true } @@ -459,7 +467,16 @@ abstract class Pickler extends SubComponent { * * @param ref ... */ - private def writeRef(ref: AnyRef) { writeNat(index(ref)) } + private def writeRef(ref: AnyRef) { + try { + writeNat(index(ref)) + } catch { + case e: java.util.NoSuchElementException => + println("entry not found: "+ ref +"; "+ ref.hashCode()) + index.printHashTable(ref.hashCode()) + throw e + } + } private def writeRefs(refs: List[AnyRef]) { refs foreach writeRef } /** Write name, owner, flags, and info of a symbol. -- cgit v1.2.3