summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2012-08-29 15:50:13 -0400
committerJosh Suereth <joshua.suereth@gmail.com>2012-08-29 15:50:13 -0400
commitdb94e06b1c11b9afdc0fd9a18e456e0774fabd80 (patch)
tree27d5e5fcb76d746e4889a2051ec569bba5cd2eaa /src
parente03a5b766be27a1f43c9151a611b04519a2b15df (diff)
downloadscala-db94e06b1c11b9afdc0fd9a18e456e0774fabd80.tar.gz
scala-db94e06b1c11b9afdc0fd9a18e456e0774fabd80.tar.bz2
scala-db94e06b1c11b9afdc0fd9a18e456e0774fabd80.zip
Fixed cloning a double-linked list.
Still need to determine if this is a systemic issue and needs to be addressed higher in the linked list hierarchy. For now, just fixing the reported bug, with a note here for other maintainers.
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/collection/mutable/DoubleLinkedList.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/library/scala/collection/mutable/DoubleLinkedList.scala b/src/library/scala/collection/mutable/DoubleLinkedList.scala
index cba4e9725e..b7c5f07502 100644
--- a/src/library/scala/collection/mutable/DoubleLinkedList.scala
+++ b/src/library/scala/collection/mutable/DoubleLinkedList.scala
@@ -63,6 +63,13 @@ class DoubleLinkedList[A]() extends AbstractSeq[A]
}
override def companion: GenericCompanion[DoubleLinkedList] = DoubleLinkedList
+
+ // Accurately clone this collection. See SI-6296
+ override def clone(): DoubleLinkedList[A] = {
+ val builder = newBuilder
+ builder ++= this
+ builder.result
+ }
}
/** $factoryInfo