summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-04-24 19:15:19 +0000
committerPaul Phillips <paulp@improving.org>2011-04-24 19:15:19 +0000
commitadd75447f46bcfb608f32c15fb9a5eb69f45a10d (patch)
tree1901ea1c68d67c4a2fd62ab61ee1c3d5f22e2a4a
parentbca5660e3893f91cf1c3a7e9f0dca4530373801f (diff)
downloadscala-add75447f46bcfb608f32c15fb9a5eb69f45a10d.tar.gz
scala-add75447f46bcfb608f32c15fb9a5eb69f45a10d.tar.bz2
scala-add75447f46bcfb608f32c15fb9a5eb69f45a10d.zip
Enclosed the out of bounds index with some IOOB...
Enclosed the out of bounds index with some IOOB exceptions, no review.
-rwxr-xr-xsrc/library/scala/collection/LinearSeqOptimized.scala2
-rw-r--r--src/library/scala/collection/parallel/immutable/package.scala24
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
}
-
}
-
-
-
-
-
-
-
-
-
-