Skip to content

Commit 76fa46c

Browse files
committed
HashMap nodes support toString
1 parent e8534ef commit 76fa46c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/src/scala/collection/immutable/HashMap.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,8 @@ private final class BitmapIndexedMapNode[K, +V](
13451345
override def hashCode(): Int =
13461346
throw new UnsupportedOperationException("Trie nodes do not support hashing.")
13471347

1348+
override def toString = s"${getClass.getName}@${Integer.toHexString(System.identityHashCode(this))}"
1349+
13481350
override def concat[V1 >: V](that: MapNode[K, V1], shift: Int): BitmapIndexedMapNode[K, V1] = that match {
13491351
case bm: BitmapIndexedMapNode[K, V] @unchecked =>
13501352
if (size == 0) return bm
@@ -2090,6 +2092,8 @@ private final class HashCollisionMapNode[K, +V ](
20902092
override def hashCode(): Int =
20912093
throw new UnsupportedOperationException("Trie nodes do not support hashing.")
20922094

2095+
override def toString = s"${getClass.getName}@${Integer.toHexString(System.identityHashCode(this))}"
2096+
20932097
override def cachedJavaKeySetHashCode: Int = size * hash
20942098

20952099
}

0 commit comments

Comments
 (0)