summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/convert
diff options
context:
space:
mode:
authorRex Kerr <ichoran@gmail.com>2014-11-26 16:52:35 -0800
committerRex Kerr <ichoran@gmail.com>2015-07-19 13:48:08 -0700
commit4ca63897c92b1456ee37d6a525f67d5939954b84 (patch)
tree4c145aa86e83fbbcbb951058cff183dc13a76b02 /src/library/scala/collection/convert
parent8f0c4b42617903ef974e25ff45250a34e93f40e7 (diff)
downloadscala-4ca63897c92b1456ee37d6a525f67d5939954b84.tar.gz
scala-4ca63897c92b1456ee37d6a525f67d5939954b84.tar.bz2
scala-4ca63897c92b1456ee37d6a525f67d5939954b84.zip
SI-8911 scala.collection.convert.Wrappers$MapWrapper not serializable
Added `with Serializable` to `MapWrapper` and `SetWrapper`. Test verifies that serialization works in the simplest case. Also updated tests in t8549 to check that serialization works and doesn't change.
Diffstat (limited to 'src/library/scala/collection/convert')
-rw-r--r--src/library/scala/collection/convert/Wrappers.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/library/scala/collection/convert/Wrappers.scala b/src/library/scala/collection/convert/Wrappers.scala
index 9f9732c62f..c2da66a9bf 100644
--- a/src/library/scala/collection/convert/Wrappers.scala
+++ b/src/library/scala/collection/convert/Wrappers.scala
@@ -102,9 +102,9 @@ private[collection] trait Wrappers {
override def clone(): JListWrapper[A] = JListWrapper(new ju.ArrayList[A](underlying))
}
- // Note various overrides to avoid performance gotchas.
- class SetWrapper[A](underlying: Set[A]) extends ju.AbstractSet[A] {
- self =>
+ @SerialVersionUID(1L)
+ class SetWrapper[A](underlying: Set[A]) extends ju.AbstractSet[A] with Serializable { self =>
+ // Note various overrides to avoid performance gotchas.
override def contains(o: Object): Boolean = {
try { underlying.contains(o.asInstanceOf[A]) }
catch { case cce: ClassCastException => false }
@@ -165,7 +165,8 @@ private[collection] trait Wrappers {
new JSetWrapper[A](new ju.LinkedHashSet[A](underlying))
}
- class MapWrapper[A, B](underlying: Map[A, B]) extends ju.AbstractMap[A, B] { self =>
+ @SerialVersionUID(1L)
+ class MapWrapper[A, B](underlying: Map[A, B]) extends ju.AbstractMap[A, B] with Serializable { self =>
override def size = underlying.size
override def get(key: AnyRef): B = try {