Scala Toolchain for Eclipse is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

scala-eclipse-toolchain

Commit ba9143a7234c742748a922ebf738afdf7874ce3f

User picture

Enclosed the out of bounds index with some IOOB exceptions, no review.

git-svn-id: https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24816 5e8d7ff9-d8ef-0310-90f0-a4852d11357a

Files Affected

 
dbc0c592ab1431cb3c99f14861668d9c41294485ba9143a7234c742748a922ebf738afdf7874ce3f
48
   */
48
   */
49
  def apply(n: Int): A = {
49
  def apply(n: Int): A = {
50
    val rest = drop(n)
50
    val rest = drop(n)
51
    if (n < 0 || rest.isEmpty) throw new IndexOutOfBoundsException
51
    if (n < 0 || rest.isEmpty) throw new IndexOutOfBoundsException("" + n)
52
    rest.head
52
    rest.head
53
  }
53
  }
54
 
54
 
dbc0c592ab1431cb3c99f14861668d9c41294485ba9143a7234c742748a922ebf738afdf7874ce3f
6
**                          |/                                          **
6
**                          |/                                          **
7
\*                                                                      */
7
\*                                                                      */
8
 
8
 
9
 
 
 
10
package scala.collection.parallel
9
package scala.collection.parallel
11
 
10
 
12
 
 
 
13
 
 
 
14
 
 
 
15
 
 
 
16
 
 
 
17
 
 
 
18
 
 
 
19
 
 
 
20
 
 
 
21
 
 
 
22
package object immutable {
11
package object immutable {
23
 
12
 
24
  /* package level methods */
13
  /* package level methods */
...
 
...
 
36
   */
25
   */
37
  private[parallel] class Repetition[T](elem: T, val length: Int) extends ParSeq[T] {
26
  private[parallel] class Repetition[T](elem: T, val length: Int) extends ParSeq[T] {
38
  self =>
27
  self =>
39
    def apply(idx: Int) = if (0 <= idx && idx < length) elem else throw new IndexOutOfBoundsException
28
    def apply(idx: Int) = if (0 <= idx && idx < length) elem else throw new IndexOutOfBoundsException("" + idx)
40
    override def seq = throw new UnsupportedOperationException
29
    override def seq = throw new UnsupportedOperationException
41
    def update(idx: Int, elem: T) = throw new UnsupportedOperationException
30
    def update(idx: Int, elem: T) = throw new UnsupportedOperationException
42
 
31
 
...
 
...
 
58
    def splitter = new ParIterator with SCPI
47
    def splitter = new ParIterator with SCPI
59
 
48
 
60
  }
49
  }
61
  
 
 
62
}
50
}
63
 
 
 
64
 
 
 
65
 
 
 
66
 
 
 
67
 
 
 
68
 
 
 
69
 
 
 
70
 
 
 
71
 
 
 
72