diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dotnet-library/scala/compat/Platform.scala | 3 | ||||
-rw-r--r-- | src/library/scala/collection/mutable/BitSet.scala | 4 | ||||
-rw-r--r-- | src/library/scala/collection/mutable/Set.scala | 4 | ||||
-rw-r--r-- | src/library/scala/compat/Platform.scala | 3 |
4 files changed, 11 insertions, 3 deletions
diff --git a/src/dotnet-library/scala/compat/Platform.scala b/src/dotnet-library/scala/compat/Platform.scala index 161423bedb..8b31b52539 100644 --- a/src/dotnet-library/scala/compat/Platform.scala +++ b/src/dotnet-library/scala/compat/Platform.scala @@ -17,6 +17,7 @@ import Predef._ object Platform { type StackOverflowError = System.StackOverflowException + type ConcurrentModificationException = System.Exception /** * @param src .. @@ -41,6 +42,8 @@ object Platform { def createArray(elemClass: Class, length: Int): AnyRef = System.Array.CreateInstance(elemClass, length); + def arrayclear(arr: Array[Int]): Unit = System.Array.Clear(arr.asInstanceOf[System.Array], 0, arr.length) + def getClassForName(name: String): Class = System.Type.GetType(name) val EOL = System.Environment.NewLine diff --git a/src/library/scala/collection/mutable/BitSet.scala b/src/library/scala/collection/mutable/BitSet.scala index 455d8e3687..fdf1df2454 100644 --- a/src/library/scala/collection/mutable/BitSet.scala +++ b/src/library/scala/collection/mutable/BitSet.scala @@ -24,7 +24,7 @@ package scala.collection.mutable @serializable class BitSet(initSize: Int) extends collection.BitSet with Set[Int] { - import compat.Platform.arraycopy + import compat.Platform.{arraycopy, arrayclear} /** default constructor, initial size of 512 bits. */ def this() = this(0) @@ -78,7 +78,7 @@ class BitSet(initSize: Int) extends collection.BitSet with Set[Int] { /** Clears all bits of the set. */ override def clear(): Unit = { - java.util.Arrays.fill(arr, 0) + arrayclear(arr) size = 0 } diff --git a/src/library/scala/collection/mutable/Set.scala b/src/library/scala/collection/mutable/Set.scala index 8e081191b6..faa712edf8 100644 --- a/src/library/scala/collection/mutable/Set.scala +++ b/src/library/scala/collection/mutable/Set.scala @@ -12,6 +12,8 @@ package scala.collection.mutable +import compat.Platform.ConcurrentModificationException + /** The canonical factory methods for <a href="Set.html">mutable sets</a>. * Currently these return <a href="HashSet.html">HashSet's</a>. */ @@ -209,7 +211,7 @@ trait Set[A] extends collection.Set[A] with Scriptable[Message[A]] { override val hashCode = Set.this.hashCode private def check = if (false && hashCode != Set.this.hashCode) - throw new java.util.ConcurrentModificationException + throw new ConcurrentModificationException def contains(item : A) = { check diff --git a/src/library/scala/compat/Platform.scala b/src/library/scala/compat/Platform.scala index 724102794e..7d0cec4b72 100644 --- a/src/library/scala/compat/Platform.scala +++ b/src/library/scala/compat/Platform.scala @@ -18,6 +18,7 @@ import Predef._ object Platform { type StackOverflowError = java.lang.StackOverflowError + type ConcurrentModificationException = java.util.ConcurrentModificationException /** * @param src .. @@ -39,6 +40,8 @@ object Platform { def createArray(elemClass: Class, length: Int): AnyRef = java.lang.reflect.Array.newInstance(elemClass, length) + def arrayclear(arr: Array[Int]): Unit = java.util.Arrays.fill(arr, 0) + def getClassForName(name: String): Class = java.lang.Class.forName(name) val EOL = System.getProperty("line.separator", "\n") |