From add75447f46bcfb608f32c15fb9a5eb69f45a10d Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 24 Apr 2011 19:15:19 +0000 Subject: Enclosed the out of bounds index with some IOOB... Enclosed the out of bounds index with some IOOB exceptions, no review. --- .../scala/collection/LinearSeqOptimized.scala | 2 +- .../collection/parallel/immutable/package.scala | 24 +--------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/library/scala/collection/LinearSeqOptimized.scala b/src/library/scala/collection/LinearSeqOptimized.scala index 236a5bdaa3..5e0bd010a6 100755 --- a/src/library/scala/collection/LinearSeqOptimized.scala +++ b/src/library/scala/collection/LinearSeqOptimized.scala @@ -48,7 +48,7 @@ trait LinearSeqOptimized[+A, +Repr <: LinearSeqOptimized[A, Repr]] extends Linea */ def apply(n: Int): A = { val rest = drop(n) - if (n < 0 || rest.isEmpty) throw new IndexOutOfBoundsException + if (n < 0 || rest.isEmpty) throw new IndexOutOfBoundsException("" + n) rest.head } diff --git a/src/library/scala/collection/parallel/immutable/package.scala b/src/library/scala/collection/parallel/immutable/package.scala index c62459deeb..19f8665667 100644 --- a/src/library/scala/collection/parallel/immutable/package.scala +++ b/src/library/scala/collection/parallel/immutable/package.scala @@ -6,19 +6,8 @@ ** |/ ** \* */ - package scala.collection.parallel - - - - - - - - - - package object immutable { /* package level methods */ @@ -36,7 +25,7 @@ package object immutable { */ private[parallel] class Repetition[T](elem: T, val length: Int) extends ParSeq[T] { self => - def apply(idx: Int) = if (0 <= idx && idx < length) elem else throw new IndexOutOfBoundsException + def apply(idx: Int) = if (0 <= idx && idx < length) elem else throw new IndexOutOfBoundsException("" + idx) override def seq = throw new UnsupportedOperationException def update(idx: Int, elem: T) = throw new UnsupportedOperationException @@ -58,15 +47,4 @@ package object immutable { def splitter = new ParIterator with SCPI } - } - - - - - - - - - - -- cgit v1.2.3