summaryrefslogtreecommitdiff
path: root/src/library/scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/scala')
-rw-r--r--src/library/scala/Enumeration.scala2
-rw-r--r--src/library/scala/collection/mutable/BufferProxy.scala10
-rw-r--r--src/library/scala/collection/mutable/Stack.scala5
-rw-r--r--src/library/scala/io/Source.scala12
-rw-r--r--src/library/scala/runtime/AnyValCompanion.scala2
5 files changed, 20 insertions, 11 deletions
diff --git a/src/library/scala/Enumeration.scala b/src/library/scala/Enumeration.scala
index 5d1a0997ed..b5a46f7018 100644
--- a/src/library/scala/Enumeration.scala
+++ b/src/library/scala/Enumeration.scala
@@ -52,7 +52,7 @@ private object Enumeration {
*
* <b>def</b> isWorkingDay(d: WeekDay) = ! (d == Sat || d == Sun)
*
- * WeekDay.iterator filter isWorkingDay foreach println
+ * WeekDay.values filter isWorkingDay foreach println
* }</pre>
*
* @param initial The initial value from which to count the integers that
diff --git a/src/library/scala/collection/mutable/BufferProxy.scala b/src/library/scala/collection/mutable/BufferProxy.scala
index 7adbb8ee3f..5d2e7fd86d 100644
--- a/src/library/scala/collection/mutable/BufferProxy.scala
+++ b/src/library/scala/collection/mutable/BufferProxy.scala
@@ -125,16 +125,20 @@ trait BufferProxy[A] extends Buffer[A] with Proxy {
* @param n the index where a new element will be inserted.
* @param iter the iterable object providing all elements to insert.
*/
- def insertAll(n: Int, iter: scala.collection.Iterable[A]): Unit = self.insertAll(n, iter)
+ def insertAll(n: Int, iter: scala.collection.Iterable[A]) {
+ self.insertAll(n, iter)
+ }
- override def insertAll(n: Int, iter: scala.collection.Traversable[A]): Unit = self.insertAll(n, iter)
+ override def insertAll(n: Int, iter: scala.collection.Traversable[A]) {
+ self.insertAll(n, iter)
+ }
/** Replace element at index `n` with the new element `newelem`.
*
* @param n the index of the element to replace.
* @param newelem the new element.
*/
- def update(n: Int, newelem: A): Unit = self.update(n, newelem)
+ def update(n: Int, newelem: A) { self.update(n, newelem) }
/** Removes the element on a given index position.
*
diff --git a/src/library/scala/collection/mutable/Stack.scala b/src/library/scala/collection/mutable/Stack.scala
index e678f7fa5c..c791066398 100644
--- a/src/library/scala/collection/mutable/Stack.scala
+++ b/src/library/scala/collection/mutable/Stack.scala
@@ -62,7 +62,8 @@ class Stack[A] private (var elems: List[A]) extends scala.collection.Seq[A] with
* @param elems the element sequence.
* @return the stack with the new elements on top.
*/
- def push(elem1: A, elem2: A, elems: A*): this.type = this.push(elem1).push(elem2).pushAll(elems)
+ def push(elem1: A, elem2: A, elems: A*): this.type =
+ this.push(elem1).push(elem2).pushAll(elems)
/** Push all elements in the given traversable object onto
* the stack. The last element in the traversable object
@@ -134,5 +135,5 @@ class Stack[A] private (var elems: List[A]) extends scala.collection.Seq[A] with
// !!! TODO - integrate
object Stack {
- def apply[A](xs: A*): Stack[A] = new Stack[A] ++= xs
+ def apply[A](xs: A*): Stack[A] = new Stack[A] pushAll xs
}
diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala
index b5313ef61b..935fe022be 100644
--- a/src/library/scala/io/Source.scala
+++ b/src/library/scala/io/Source.scala
@@ -114,11 +114,13 @@ object Source {
/** Create a <code>Source</code> from array of bytes, assuming
* one byte per character (ISO-8859-1 encoding.)
*/
- def fromRawBytes(bytes: Array[Byte]): Source = fromString(new String(bytes, Codec.ISO8859.name))
+ def fromRawBytes(bytes: Array[Byte]): Source =
+ fromString(new String(bytes, Codec.ISO8859.name))
/** creates <code>Source</code> from file with given file: URI
*/
- def fromURI(uri: URI)(implicit codec: Codec): BufferedSource = fromFile(new JFile(uri))(codec)
+ def fromURI(uri: URI)(implicit codec: Codec): BufferedSource =
+ fromFile(new JFile(uri))(codec)
/** same as fromURL(new URL(s))(Codec(enc))
*/
@@ -298,8 +300,9 @@ abstract class Source extends Iterator[Char] {
def report(pos: Int, msg: String, out: PrintStream) {
val line = Position line pos
val col = Position column pos
+ val str = getLines() toIndexedSeq line
- out println "%s:%d:%d: %s%s%s^".format(descr, line, col, msg, getLine(line), spaces(col - 1))
+ out println "%s:%d:%d: %s%s%s^".format(descr, line, col, msg, str, spaces(col - 1))
}
/**
@@ -340,8 +343,9 @@ abstract class Source extends Iterator[Char] {
}
/** The close() method closes the underlying resource. */
- def close(): Unit =
+ def close() {
if (closeFunction != null) closeFunction()
+ }
/** The reset() method creates a fresh copy of this Source. */
def reset(): Source =
diff --git a/src/library/scala/runtime/AnyValCompanion.scala b/src/library/scala/runtime/AnyValCompanion.scala
index 0a6f93805a..0fba1cfd60 100644
--- a/src/library/scala/runtime/AnyValCompanion.scala
+++ b/src/library/scala/runtime/AnyValCompanion.scala
@@ -6,7 +6,7 @@
** |/ **
\* */
-// $Id$
+
package scala.runtime