From 1ce5ecc912833a4452e1de23c6bb2fd859d66bd4 Mon Sep 17 00:00:00 2001 From: Sean McDirmid Date: Wed, 22 Aug 2007 16:01:57 +0000 Subject: Fixed Array.slice to use impementation in Rando... Fixed Array.slice to use impementation in RandomAccessSeq, updated iterators, a bunch of stuff that I forgot to check in! --- src/library/scala/Array.scala | 8 +++--- src/library/scala/BufferedIterator.scala | 10 ++++---- src/library/scala/CountedIterator.scala | 2 +- src/library/scala/Iterator.scala | 10 ++++---- src/library/scala/List.scala | 30 +++++++++++++++++++--- src/library/scala/RandomAccessSeq.scala | 5 +++- src/library/scala/Stream.scala | 5 ++-- .../scala/collection/RollbackIterator.scala | 2 +- src/library/scala/collection/Set.scala | 25 ++++++++++++++++-- .../scala/collection/jcl/MutableIterator.scala | 6 ++--- .../scala/collection/mutable/JavaMapAdaptor.scala | 2 +- .../scala/collection/mutable/JavaSetAdaptor.scala | 2 +- .../scala/collection/mutable/LinkedHashSet.scala | 2 +- src/library/scala/collection/mutable/Set.scala | 25 +++--------------- src/library/scala/ref/Reference.scala | 3 ++- src/library/scala/ref/ReferenceWrapper.scala | 5 ++++ src/library/scala/runtime/BoxedAnyArray.scala | 3 ++- src/library/scala/runtime/BoxedArray.scala | 18 +++---------- src/library/scala/runtime/BoxedBooleanArray.scala | 3 ++- src/library/scala/runtime/BoxedByteArray.scala | 3 ++- src/library/scala/runtime/BoxedCharArray.scala | 3 ++- src/library/scala/runtime/BoxedDoubleArray.scala | 3 ++- src/library/scala/runtime/BoxedFloatArray.scala | 3 ++- src/library/scala/runtime/BoxedIntArray.scala | 3 ++- src/library/scala/runtime/BoxedLongArray.scala | 3 ++- src/library/scala/runtime/BoxedObjectArray.scala | 3 ++- src/library/scala/runtime/BoxedShortArray.scala | 3 ++- 27 files changed, 114 insertions(+), 76 deletions(-) (limited to 'src/library') diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index b9e58afbed..fc673b7507 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -290,7 +290,7 @@ final class Array[A](_length: Int) extends RandomAccessSeq.Mutable[A] { * @throws IndexOutOfBoundsException if from < 0 * or length < end */ - override def slice(from: Int, end: Int): Array[A] = throw new Error() + //override def slice(from: Int, end: Int): Array[A] = throw new Error() /** Returns an array consisting of all elements of this array that satisfy the @@ -308,7 +308,7 @@ final class Array[A](_length: Int) extends RandomAccessSeq.Mutable[A] { * @param n the number of elements to take * @return the new array */ - override def take(n: Int): Array[A] = throw new Error() + //override def take(n: Int): Array[A] = throw new Error() /** Returns this array without its n first elements * If this array has less than n elements, the empty @@ -317,7 +317,7 @@ final class Array[A](_length: Int) extends RandomAccessSeq.Mutable[A] { * @param n the number of elements to drop * @return the new array */ - override def drop(n: Int): Array[A] =throw new Error() + //override def drop(n: Int): Array[A] =throw new Error() /** Returns the longest prefix of this array whose elements satisfy * the predicate p. @@ -339,7 +339,7 @@ final class Array[A](_length: Int) extends RandomAccessSeq.Mutable[A] { /** A array consisting of all elements of this array in reverse order. */ - override def reverse: Array[A] = throw new Error() + //override def reverse: Array[A] = throw new Error() /** Returns an array consisting of all elements of this array followed * by all elements of the argument iterable. diff --git a/src/library/scala/BufferedIterator.scala b/src/library/scala/BufferedIterator.scala index a206ccaa48..bd442e6d00 100644 --- a/src/library/scala/BufferedIterator.scala +++ b/src/library/scala/BufferedIterator.scala @@ -49,7 +49,7 @@ trait BufferedIterator[+A] extends Iterator[A] { read } def advanced : BufferedIterator.Advanced[A] = new BufferedIterator.Default[A] { - protected def fill : Seq[A] = if (BufferedIterator.this.hasNext) (BufferedIterator.this.next) :: Nil else Nil + protected def fill(sz : Int) : Seq[A] = if (BufferedIterator.this.hasNext) (BufferedIterator.this.next) :: Nil else Nil } } @@ -154,8 +154,8 @@ object BufferedIterator { override protected def defaultPeek : A = throw new Predef.NoSuchElementException override def hasNext = !lookahead.isEmpty || super.hasNext - /** used to fill lookahead buffer */ - protected def fill : Seq[A] + /** used to fill lookahead buffer. sz can be used by implementations as a heauristic to determine how many elements are desired */ + protected def fill(sz : Int) : Seq[A] private[BufferedIterator] def forget : List[A] = { val ret = lookahead.toList @@ -167,7 +167,7 @@ object BufferedIterator { if (sz == 0) return lookahead.readOnly else if (sz == 1) { if (!lookahead.isEmpty) return lookahead.readOnly - fill match { + fill(sz) match { case Seq.singleton(x) => lookahead += x case next => lookahead ++= next } @@ -175,7 +175,7 @@ object BufferedIterator { } var sz0 = lookahead.length while (sz0 < sz) { - val next = fill + val next = fill(sz - sz0) if (next.isEmpty) return lookahead.readOnly sz0 += next.length lookahead ++= next diff --git a/src/library/scala/CountedIterator.scala b/src/library/scala/CountedIterator.scala index 6d6f0669e7..d818d6086b 100644 --- a/src/library/scala/CountedIterator.scala +++ b/src/library/scala/CountedIterator.scala @@ -23,7 +23,7 @@ trait CountedIterator[+A] extends Iterator[A] { override def counted : this.type = this override def buffered: BufferedIterator[A] with CountedIterator[A] = new BufferedIterator.Default[A] with CountedIterator[A] { - protected def fill = if (CountedIterator.this.hasNext) (CountedIterator.this.next) :: Nil else Nil + protected def fill(sz : Int) = if (CountedIterator.this.hasNext) (CountedIterator.this.next) :: Nil else Nil override def count = CountedIterator.this.count - peekList(0).length override def counted : this.type = this override def buffered : this.type = this diff --git a/src/library/scala/Iterator.scala b/src/library/scala/Iterator.scala index f81b94939f..8115796f14 100644 --- a/src/library/scala/Iterator.scala +++ b/src/library/scala/Iterator.scala @@ -282,8 +282,8 @@ trait Iterator[+A] { } protected class PredicatedIterator(p : A => Boolean) extends BufferedIterator.Default[A] { - protected def skip0 : Seq[A] = fill - protected override def fill : Seq[A] = + protected def skip0 : Seq[A] = fill(1) + protected override def fill(sz : Int) : Seq[A] = if (!Iterator.this.hasNext) return Nil else { val ret = Iterator.this.next; @@ -297,8 +297,8 @@ trait Iterator[+A] { ended = true Nil } - override protected def fill : Seq[A] = - if (ended) Nil else super.fill + override protected def fill(sz : Int) : Seq[A] = + if (ended) Nil else super.fill(sz) } @@ -509,7 +509,7 @@ trait Iterator[+A] { /** Returns a buffered iterator from this iterator. */ def buffered: BufferedIterator[A] = new BufferedIterator.Default[A] { - protected def fill = if (Iterator.this.hasNext) (Iterator.this.next) :: Nil else Nil + protected def fill(sz : Int) = if (Iterator.this.hasNext) (Iterator.this.next) :: Nil else Nil } /** Returns a counted iterator from this iterator. diff --git a/src/library/scala/List.scala b/src/library/scala/List.scala index a2e1045b25..9fd43f5140 100644 --- a/src/library/scala/List.scala +++ b/src/library/scala/List.scala @@ -1210,8 +1210,32 @@ case object Nil extends List[Nothing] { * @version 1.0, 15/07/2003 */ @SerialVersionUID(0L - 8476791151983527571L) -final case class ::[B](hd: B, private[scala] var tl: List[B]) extends List[B] { - def head = hd - def tail = tl +final case class ::[B](private[scala] var hd: B, private[scala] var tl: List[B]) extends List[B] { + /* XXX: making hd a class-private var crashes the compiler. */ + def head : B = hd + def tail : List[B] = tl override def isEmpty: Boolean = false + + import java.io._ + + private def writeObject(out : ObjectOutputStream) = { + val i = elements + while (i.hasNext) out.writeObject(i.next) + out.writeObject(ListSerializeEnd) + } + private def readObject(in : ObjectInputStream) : Unit = { + hd = in.readObject.asInstanceOf[B] + assert(hd != ListSerializeEnd) + var current : ::[B] = this + while (true) in.readObject match { + case ListSerializeEnd => current.tl = Nil; return + case a : Any => + val list : ::[B] = new ::(a.asInstanceOf[B], Nil) + current.tl = list + current = list + } + } } +/** Only used for list serialization */ +@SerialVersionUID(0L - 8476791151975527571L) +private[scala] case object ListSerializeEnd \ No newline at end of file diff --git a/src/library/scala/RandomAccessSeq.scala b/src/library/scala/RandomAccessSeq.scala index edee52b250..edcec42d07 100644 --- a/src/library/scala/RandomAccessSeq.scala +++ b/src/library/scala/RandomAccessSeq.scala @@ -83,7 +83,7 @@ object RandomAccessSeq { } } -/** Sequences that support O(1) element access +/** Sequences that support O(1) element access and O(1) length computation. * @author Sean McDirmid */ trait RandomAccessSeq[+A] extends Seq[A] { @@ -118,6 +118,9 @@ trait RandomAccessSeq[+A] extends Seq[A] { def length = until - from def apply(idx : Int) = if (idx < 0 || idx >= length) throw new Predef.IndexOutOfBoundsException else RandomAccessSeq.this.apply(from + idx) + override def slice(from0 : Int, until0 : Int) = // minimize the object chain. + if (from + until0 > until) RandomAccessSeq.this.slice(from + from0, until) + else RandomAccessSeq.this.slice(from + from0, from + until0) } } override def reverse : Seq[A] = new RandomAccessSeq.Projection[A] { diff --git a/src/library/scala/Stream.scala b/src/library/scala/Stream.scala index 14bfd258d6..ed8c8957ab 100644 --- a/src/library/scala/Stream.scala +++ b/src/library/scala/Stream.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** +** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -12,6 +12,7 @@ package scala import Predef._ +import compat.StringBuilder /** * The object Stream provides helper functions diff --git a/src/library/scala/collection/RollbackIterator.scala b/src/library/scala/collection/RollbackIterator.scala index 8436155957..291d72f507 100644 --- a/src/library/scala/collection/RollbackIterator.scala +++ b/src/library/scala/collection/RollbackIterator.scala @@ -7,7 +7,7 @@ import scala.collection.mutable.{ArrayBuffer} */ class RollbackIterator[+A](underlying : Iterator[A]) extends BufferedIterator.Default[A] { private[this] var rollback : ArrayBuffer[A] = null - protected def fill : Seq[A] = if (underlying.hasNext) underlying.next :: Nil else Nil + protected def fill(sz : Int) : Seq[A] = if (underlying.hasNext) underlying.next :: Nil else Nil override def next : A = { val ret = super.next diff --git a/src/library/scala/collection/Set.scala b/src/library/scala/collection/Set.scala index cdad6e4638..6cc99a0509 100644 --- a/src/library/scala/collection/Set.scala +++ b/src/library/scala/collection/Set.scala @@ -72,11 +72,34 @@ trait Set[A] extends (A => Boolean) with Collection[A] { */ def subsetOf(that: Set[A]): Boolean = forall(that.contains) + /** set intersection */ + def *(that : Set[A]) : Set[A] = { + val min = Math.min(size, that.size) + val buf = new Array[A](min) + var count = 0 + val i = elements + while (i.hasNext) { + val a = i.next + if (that.contains(a)) { + buf(count) = a + count += 1 + } + } + if (count == size) this + else if (count == that.size) that + else { + import scala.collection.jcl.LinkedHashSet + val ret = new LinkedHashSet[A] + ret ++= buf.projection.take(count) + ret.readOnly + } + } /** Compares this set with another object and returns true, iff the * other object is also a set which contains the same elements as * this set. * * @param that the other object + * @note not necessarily run-time type safe. * @return true iff this set and the other set * contain the same elements. */ @@ -87,11 +110,9 @@ trait Set[A] extends (A => Boolean) with Collection[A] { false } - /** hashcode for this set */ override def hashCode() = (0 /: this)((hash, e) => hash + e.hashCode()) - override def toArray[B >: A]: Array[B] = { val result = new Array[B](size) copyToArray(result, 0) diff --git a/src/library/scala/collection/jcl/MutableIterator.scala b/src/library/scala/collection/jcl/MutableIterator.scala index 56ece90dd2..d82368698e 100644 --- a/src/library/scala/collection/jcl/MutableIterator.scala +++ b/src/library/scala/collection/jcl/MutableIterator.scala @@ -71,10 +71,10 @@ b **/ // XXX: broken private[jcl] def peekNext = Buffered.this.seekNext(p) match { case Some(result) => result; - case None => throw new NoSuchElementException; + case None => throw new Predef.NoSuchElementException; } override def next = { - val ret = peekNext; val ret0 = Buffered.this.next; assert(ret == ret0); ret; + val ret = peekNext; val ret0 = Buffered.this.next; Predef.assert(ret == ret0); ret; } override def hasNext : Boolean = seekNext(p) != None; override def remove : Unit = Buffered.this.remove; @@ -93,7 +93,7 @@ b **/ val ret = peekNext; head = null.asInstanceOf[A]; ret; } override def remove = { - if (head != null) throw new NoSuchElementException; + if (head != null) throw new Predef.NoSuchElementException; underlying.remove; } override def toString = "buffered[" + underlying + "]"; diff --git a/src/library/scala/collection/mutable/JavaMapAdaptor.scala b/src/library/scala/collection/mutable/JavaMapAdaptor.scala index b4b9a923f2..02bfc06961 100644 --- a/src/library/scala/collection/mutable/JavaMapAdaptor.scala +++ b/src/library/scala/collection/mutable/JavaMapAdaptor.scala @@ -18,7 +18,7 @@ package scala.collection.mutable * @author Matthias Zenger * @version 1.0, 21/07/2003 */ -class JavaMapAdaptor[A, B](jmap: java.util.Map) extends Map[A, B] { +@deprecated class JavaMapAdaptor[A, B](jmap: java.util.Map) extends Map[A, B] { def size: Int = jmap.size() diff --git a/src/library/scala/collection/mutable/JavaSetAdaptor.scala b/src/library/scala/collection/mutable/JavaSetAdaptor.scala index 45c49d58d7..51e48d122d 100644 --- a/src/library/scala/collection/mutable/JavaSetAdaptor.scala +++ b/src/library/scala/collection/mutable/JavaSetAdaptor.scala @@ -18,7 +18,7 @@ package scala.collection.mutable * @author Matthias Zenger * @version 1.0, 19/09/2003 */ -class JavaSetAdaptor[A](jset: java.util.Set) extends Set[A] { +@deprecated class JavaSetAdaptor[A](jset: java.util.Set) extends Set[A] { def size: Int = jset.size() diff --git a/src/library/scala/collection/mutable/LinkedHashSet.scala b/src/library/scala/collection/mutable/LinkedHashSet.scala index e38a7151e9..ed0ef128a4 100644 --- a/src/library/scala/collection/mutable/LinkedHashSet.scala +++ b/src/library/scala/collection/mutable/LinkedHashSet.scala @@ -15,7 +15,7 @@ package scala.collection.mutable * @author Sean McDirmid * @version 1.0 */ -class LinkedHashSet[A](private val set0 : java.util.LinkedHashSet) extends Set[A] { +@deprecated class LinkedHashSet[A](private val set0 : java.util.LinkedHashSet) extends Set[A] { def this() = this(new java.util.LinkedHashSet) diff --git a/src/library/scala/collection/mutable/Set.scala b/src/library/scala/collection/mutable/Set.scala index 1d68687f26..077e018e6f 100644 --- a/src/library/scala/collection/mutable/Set.scala +++ b/src/library/scala/collection/mutable/Set.scala @@ -207,26 +207,9 @@ trait Set[A] extends collection.Set[A] with Scriptable[Message[A]] with Cloneabl /** Return a read-only projection of this set */ def readOnly : scala.collection.Set[A] = new scala.collection.Set[A] { - /** used to trigger version checking in JCL and hopefully the mutable collections */ - override val hashCode = Set.this.hashCode - private def check = - if (false && hashCode != Set.this.hashCode) - throw new ConcurrentModificationException - - def contains(item : A) = { - check - Set.this.contains(item) - } - override def toString = { - "read-only-" + Set.this.toString - } - override def size = { - check - Set.this.size - } - override def elements = { - check - Set.this.elements - } + def contains(item : A) = Set.this.contains(item) + override def toString = "read-only-" + Set.this.toString + override def size = Set.this.size + override def elements = Set.this.elements } } diff --git a/src/library/scala/ref/Reference.scala b/src/library/scala/ref/Reference.scala index 65c49583ae..f36d355831 100644 --- a/src/library/scala/ref/Reference.scala +++ b/src/library/scala/ref/Reference.scala @@ -11,7 +11,8 @@ package scala.ref /** - * @author Sean McDirmid + * @see java.lang.ref.Reference + * @author Sean McDirmid */ trait Reference[+T <: AnyRef] extends Function0[T] { @deprecated def isValid: Boolean diff --git a/src/library/scala/ref/ReferenceWrapper.scala b/src/library/scala/ref/ReferenceWrapper.scala index 004496d95b..d0adb559d7 100644 --- a/src/library/scala/ref/ReferenceWrapper.scala +++ b/src/library/scala/ref/ReferenceWrapper.scala @@ -28,4 +28,9 @@ trait ReferenceWrapper[+T <: AnyRef] extends Reference[T] { def clear = underlying.clear def enqueue = underlying.enqueue def isEnqueued = underlying.isEnqueued + override def hashCode = underlying.hashCode + override def equals(that : Any) = that match { + case that : ReferenceWrapper[_] => get equals that.get + case that => super.equals(that) + } } diff --git a/src/library/scala/runtime/BoxedAnyArray.scala b/src/library/scala/runtime/BoxedAnyArray.scala index cbc967774b..59ea4cd81a 100644 --- a/src/library/scala/runtime/BoxedAnyArray.scala +++ b/src/library/scala/runtime/BoxedAnyArray.scala @@ -254,12 +254,13 @@ final class BoxedAnyArray(val length: Int) extends BoxedArray { } result } - +/* final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = new BoxedAnyArray(len) Array.copy(this, s, result, 0, len) result } +*/ } diff --git a/src/library/scala/runtime/BoxedArray.scala b/src/library/scala/runtime/BoxedArray.scala index aa5c9fe8c2..b92f737fea 100644 --- a/src/library/scala/runtime/BoxedArray.scala +++ b/src/library/scala/runtime/BoxedArray.scala @@ -126,20 +126,10 @@ abstract class BoxedArray extends RandomAccessSeq.Mutable[Any] { /** Returns an array that contains all indices of this array */ def indices: Array[Int] = Array.range(0, length) - override def slice(start: Int, end: Int): BoxedArray = throw new Error("internal: slice") - - /** Calculate start position and length in source array to - * be passed to the array copy operation. - */ - protected def slice0(start: Int, end: Int): (Int, Int) = { - val s = start max 0 - val e = end min this.length - if (s > e) (0, 0) else (s, e - s) - } - - override def take(n: Int) = slice(0, n) - - override def drop(n: Int) = slice(n, length) + // use implementation in RandomAccessSeq + //override def slice(start: Int, end: Int): BoxedArray = throw new Error("internal: slice") + //override def take(n: Int) = slice(0, n) + //override def drop(n: Int) = slice(n, length) override def takeWhile(p: Any => Boolean) = { val c = length + 1 diff --git a/src/library/scala/runtime/BoxedBooleanArray.scala b/src/library/scala/runtime/BoxedBooleanArray.scala index cf0144214e..ede3396a29 100644 --- a/src/library/scala/runtime/BoxedBooleanArray.scala +++ b/src/library/scala/runtime/BoxedBooleanArray.scala @@ -57,11 +57,12 @@ final class BoxedBooleanArray(val value: Array[Boolean]) extends BoxedArray { } new BoxedBooleanArray(result) } - +/* final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = new Array[Boolean](len) Array.copy(value, s, result, 0, len) new BoxedBooleanArray(result) } +*/ } diff --git a/src/library/scala/runtime/BoxedByteArray.scala b/src/library/scala/runtime/BoxedByteArray.scala index 481905b24b..c509cb1f22 100644 --- a/src/library/scala/runtime/BoxedByteArray.scala +++ b/src/library/scala/runtime/BoxedByteArray.scala @@ -57,11 +57,12 @@ final class BoxedByteArray(val value: Array[Byte]) extends BoxedArray { } new BoxedByteArray(result) } - +/* final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = new Array[Byte](len) Array.copy(value, s, result, 0, len) new BoxedByteArray(result) } +*/ } diff --git a/src/library/scala/runtime/BoxedCharArray.scala b/src/library/scala/runtime/BoxedCharArray.scala index 47402d0819..e70efedfd0 100644 --- a/src/library/scala/runtime/BoxedCharArray.scala +++ b/src/library/scala/runtime/BoxedCharArray.scala @@ -58,11 +58,12 @@ final class BoxedCharArray(val value: Array[Char]) extends BoxedArray { } new BoxedCharArray(result) } - +/* final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = new Array[Char](len) Array.copy(value, s, result, 0, len) new BoxedCharArray(result) } +*/ } diff --git a/src/library/scala/runtime/BoxedDoubleArray.scala b/src/library/scala/runtime/BoxedDoubleArray.scala index f96b9a5b67..bbf0189285 100644 --- a/src/library/scala/runtime/BoxedDoubleArray.scala +++ b/src/library/scala/runtime/BoxedDoubleArray.scala @@ -57,11 +57,12 @@ final class BoxedDoubleArray(val value: Array[Double]) extends BoxedArray { } new BoxedDoubleArray(result) } - +/* final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = new Array[Double](len) Array.copy(value, s, result, 0, len) new BoxedDoubleArray(result) } +*/ } diff --git a/src/library/scala/runtime/BoxedFloatArray.scala b/src/library/scala/runtime/BoxedFloatArray.scala index aa5c987d0f..d78facc705 100644 --- a/src/library/scala/runtime/BoxedFloatArray.scala +++ b/src/library/scala/runtime/BoxedFloatArray.scala @@ -57,11 +57,12 @@ final class BoxedFloatArray(val value: Array[Float]) extends BoxedArray { } new BoxedFloatArray(result) } - +/* final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = new Array[Float](len) Array.copy(value, s, result, 0, len) new BoxedFloatArray(result) } +*/ } diff --git a/src/library/scala/runtime/BoxedIntArray.scala b/src/library/scala/runtime/BoxedIntArray.scala index 0fee3b675d..a837a0ee6f 100644 --- a/src/library/scala/runtime/BoxedIntArray.scala +++ b/src/library/scala/runtime/BoxedIntArray.scala @@ -57,11 +57,12 @@ final class BoxedIntArray(val value: Array[Int]) extends BoxedArray { } new BoxedIntArray(result) } - +/* use implementation in RandomAccessSeq final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = new Array[Int](len) Array.copy(value, s, result, 0, len) new BoxedIntArray(result) } +*/ } diff --git a/src/library/scala/runtime/BoxedLongArray.scala b/src/library/scala/runtime/BoxedLongArray.scala index 009aa72dc7..b8ea3ee5fb 100644 --- a/src/library/scala/runtime/BoxedLongArray.scala +++ b/src/library/scala/runtime/BoxedLongArray.scala @@ -57,11 +57,12 @@ final class BoxedLongArray(val value: Array[Long]) extends BoxedArray { } new BoxedLongArray(result) } - +/* final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = new Array[Long](len) Array.copy(value, s, result, 0, len) new BoxedLongArray(result) } +*/ } diff --git a/src/library/scala/runtime/BoxedObjectArray.scala b/src/library/scala/runtime/BoxedObjectArray.scala index 36decf6a4c..ded515b87f 100644 --- a/src/library/scala/runtime/BoxedObjectArray.scala +++ b/src/library/scala/runtime/BoxedObjectArray.scala @@ -62,11 +62,12 @@ final class BoxedObjectArray(val value: Array[AnyRef]) extends BoxedArray { } new BoxedObjectArray(result) } - +/* final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = create(len) Array.copy(value, s, result, 0, len) new BoxedObjectArray(result) } +*/ } diff --git a/src/library/scala/runtime/BoxedShortArray.scala b/src/library/scala/runtime/BoxedShortArray.scala index f4c594978e..c34faf76d9 100644 --- a/src/library/scala/runtime/BoxedShortArray.scala +++ b/src/library/scala/runtime/BoxedShortArray.scala @@ -57,11 +57,12 @@ final class BoxedShortArray(val value: Array[Short]) extends BoxedArray { } new BoxedShortArray(result) } - +/* final override def slice(start: Int, end: Int): BoxedArray = { val (s, len) = slice0(start, end) val result = new Array[Short](len) Array.copy(value, s, result, 0, len) new BoxedShortArray(result) } +*/ } -- cgit v1.2.3