Skip to content

Commit 4c24b94

Browse files
committed
Add @transient to make the serialization check happy.
1 parent 972ccdd commit 4c24b94

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

src/library/scala/collection/concurrent/TrieMap.scala

+2
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ final class TrieMap[K, V] private (r: AnyRef, rtupd: AtomicReferenceFieldUpdater
687687

688688
private[this] var hashingobj = if (hashf.isInstanceOf[Hashing.Default[_]]) new TrieMap.MangledHashing[K] else hashf
689689
private[this] var equalityobj = ef
690+
@transient
690691
private[this] var rootupdater = rtupd
691692
def hashing = hashingobj
692693
def equality = equalityobj
@@ -1026,6 +1027,7 @@ object TrieMap extends MapFactory[TrieMap] {
10261027

10271028
def newBuilder[K, V] = new GrowableBuilder(empty[K, V])
10281029

1030+
@transient
10291031
val inodeupdater = AtomicReferenceFieldUpdater.newUpdater(classOf[INodeBase[_, _]], classOf[MainNode[_, _]], "mainnode")
10301032

10311033
class MangledHashing[K] extends Hashing[K] {

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ private final class BitmapIndexedMapNode[K, +V](
571571
}
572572
}
573573
}
574-
574+
575575
def sizePredicate: Int =
576576
if (nodeArity == 0) payloadArity match {
577577
case 0 => SizeEmpty
@@ -1521,6 +1521,7 @@ object HashMap extends MapFactory[HashMap] {
15211521
private[HashMap] def apply[K, V](rootNode: MapNode[K, V]) =
15221522
new HashMap[K, V](rootNode)
15231523

1524+
@transient
15241525
private final val EmptyMap = new HashMap(MapNode.empty)
15251526

15261527
def empty[K, V]: HashMap[K, V] =
@@ -1746,4 +1747,4 @@ private[immutable] final class HashMapBuilder[K, V] extends Builder[(K, V), Hash
17461747
}
17471748

17481749
private[collection] def size: Int = rootNode.size
1749-
}
1750+
}

src/library/scala/collection/immutable/HashSet.scala

+1
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ object HashSet extends IterableFactory[HashSet] {
11761176
private[HashSet] def apply[A](rootNode: SetNode[A], cachedJavaHashCode: Int) =
11771177
new HashSet[A](rootNode)
11781178

1179+
@transient
11791180
private final val EmptySet = new HashSet(SetNode.empty)
11801181

11811182
def empty[A]: HashSet[A] =

src/library/scala/collection/immutable/List.scala

+1
Original file line numberDiff line numberDiff line change
@@ -611,5 +611,6 @@ object List extends StrictOptimizedSeqFactory[List] {
611611

612612
def empty[A]: List[A] = Nil
613613

614+
@transient
614615
private[collection] val partialNotApplied = new Function1[Any, Any] { def apply(x: Any): Any = this }
615616
}

src/library/scala/collection/immutable/Vector.scala

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ object Vector extends StrictOptimizedSeqFactory[Vector] {
3939

4040
def newBuilder[A]: Builder[A, Vector[A]] = new VectorBuilder[A]
4141

42+
@transient
4243
private[immutable] val NIL = new Vector[Nothing](0, 0, 0)
4344

4445
private val defaultApplyPreferredMaxLength: Int =

0 commit comments

Comments
 (0)