summaryrefslogtreecommitdiff
path: root/src/library/scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2009-03-10 11:39:04 +0000
committermichelou <michelou@epfl.ch>2009-03-10 11:39:04 +0000
commit40f8fa94026d482f8318481bb64ae0245a39acbc (patch)
treef5f6cd4423ee49f9c77f5222cb6ae4de62fbc461 /src/library/scala
parent5e2dd3850dd6da531b4e9ba7075081aae65a1502 (diff)
downloadscala-40f8fa94026d482f8318481bb64ae0245a39acbc.tar.gz
scala-40f8fa94026d482f8318481bb64ae0245a39acbc.tar.bz2
scala-40f8fa94026d482f8318481bb64ae0245a39acbc.zip
removed deprecated warning, updated svn props, ...
removed deprecated warning, updated svn props, cleaned up code
Diffstat (limited to 'src/library/scala')
-rw-r--r--src/library/scala/Application.scala13
-rw-r--r--src/library/scala/Console.scala42
-rw-r--r--src/library/scala/Seq.scala26
-rw-r--r--src/library/scala/SeqProxy.scala10
-rw-r--r--src/library/scala/collection/immutable/Stack.scala11
-rw-r--r--src/library/scala/collection/immutable/TreeHashMap.scala44
-rw-r--r--src/library/scala/deprecated.scala2
-rw-r--r--src/library/scala/io/Position.scala20
-rw-r--r--src/library/scala/io/Source.scala49
-rw-r--r--src/library/scala/io/UTF8Codec.scala20
-rw-r--r--src/library/scala/remote.scala2
-rw-r--r--src/library/scala/util/Sorting.scala4
12 files changed, 129 insertions, 114 deletions
diff --git a/src/library/scala/Application.scala b/src/library/scala/Application.scala
index aaec5f88c9..4321f8ed71 100644
--- a/src/library/scala/Application.scala
+++ b/src/library/scala/Application.scala
@@ -16,7 +16,8 @@ import scala.compat.Platform.currentTime
/** <p>
* The <code>Application</code> trait can be used to quickly turn objects
- * into executable programs, but is <em>not recommended</em>. Here is an example:
+ * into executable programs, but is <em>not recommended</em>.
+ * Here is an example:
* </p><pre>
* <b>object</b> Main <b>extends</b> Application {
* Console.println("Hello World!")
@@ -36,8 +37,10 @@ import scala.compat.Platform.currentTime
* </p><pre>
* java -Dscala.time Main
* </pre>
- * <p>In practice the <code>Application</code> trait has a number of serious
- * pitfalls:
+ * <p>
+ * In practice the <code>Application</code> trait has a number of serious
+ * pitfalls:
+ * </p>
* <ul>
* <li>As described above, there is no way to obtain the
* command-line arguments because all code in body of an <code>object</code>
@@ -55,7 +58,7 @@ import scala.compat.Platform.currentTime
* optimize or JIT the code in the body of an <code>object</code> extending
* <code>Application</code>. This can lead to a significant
* performance degradation.</li>
- * </p>
+ * </ul>
*
* @author Matthias Zenger
* @version 1.0, 10/09/2003
@@ -71,7 +74,7 @@ trait Application {
*
* @param args the arguments passed to the main method
*/
- def main(args: Array[String]) = {
+ def main(args: Array[String]) {
if (getProperty("scala.time") ne null) {
val total = currentTime - executionStart
Console.println("[total " + total + "ms]")
diff --git a/src/library/scala/Console.scala b/src/library/scala/Console.scala
index cb682c2310..d2a06e7e4a 100644
--- a/src/library/scala/Console.scala
+++ b/src/library/scala/Console.scala
@@ -106,7 +106,7 @@ object Console {
*
* @param reader specifies the new input stream.
*/
- def setIn(reader: Reader): Unit = {
+ def setIn(reader: Reader) {
inVar.value = new BufferedReader(reader)
}
@@ -125,8 +125,9 @@ object Console {
*
* @param in the new input stream.
*/
- def setIn(in: InputStream): Unit =
+ def setIn(in: InputStream) {
setIn(new InputStreamReader(in))
+ }
/** Set the default input stream for the duration
* of execution of one thunk.
@@ -142,8 +143,9 @@ object Console {
*
* @param obj the object to print.
*/
- def print(obj: Any): Unit =
+ def print(obj: Any) {
out.print(if (null == obj) "null" else obj.toString())
+ }
/** Flush the output stream. This function is required when partial
* output (i.e. output not terminated by a new line character) has
@@ -153,13 +155,13 @@ object Console {
/** Print a new line character on the terminal.
*/
- def println(): Unit = out.println()
+ def println() { out.println() }
/** Print out an object followed by a new line character.
*
* @param x the object to print.
*/
- def println(x: Any): Unit = out.println(x)
+ def println(x: Any) { out.println(x) }
/** <p>
* Prints its arguments as a formatted string, based on a string
@@ -183,8 +185,10 @@ object Console {
* @deprecated For console output, use <code>Console.printf</code>. For <code>String</code> formatting,
* <code>RichString</code>'s <code>format</code> method.
*/
- @deprecated def format(text: String, args: Any*) {
- if (text eq null) out.printf("null") else (out.print(text format (args : _*)))
+ @deprecated
+ def format(text: String, args: Any*) {
+ if (text eq null) out.printf("null")
+ else out.print(text format (args : _*))
}
/** Read a full line from the terminal. Returns <code>null</code> if the end of the
@@ -202,7 +206,7 @@ object Console {
* @return the string read from the terminal.
*/
def readLine(text: String, args: Any*): String = {
- format(text, args: _*)
+ printf(text, args: _*)
readLine()
}
@@ -214,17 +218,17 @@ object Console {
* @throws java.io.EOFException
*/
def readBoolean(): Boolean = {
- val s = readLine()
- if (s == null)
- throw new java.io.EOFException("Console has reached end of input")
- else
- s.toLowerCase() match {
- case "true" => true
- case "t" => true
- case "yes" => true
- case "y" => true
- case _ => false
- }
+ val s = readLine()
+ if (s == null)
+ throw new java.io.EOFException("Console has reached end of input")
+ else
+ s.toLowerCase() match {
+ case "true" => true
+ case "t" => true
+ case "yes" => true
+ case "y" => true
+ case _ => false
+ }
}
/** Read a byte value from the terminal.
diff --git a/src/library/scala/Seq.scala b/src/library/scala/Seq.scala
index 18b8dac676..656d3b6fab 100644
--- a/src/library/scala/Seq.scala
+++ b/src/library/scala/Seq.scala
@@ -301,7 +301,8 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Collection[A] {
* @param p the predicate used to filter the list.
* @return the elements of this list satisfying <code>p</code>.
*/
- override def filter(p: A => Boolean): Seq[A] = super.filter(p).asInstanceOf[Seq[A]]
+ override def filter(p: A => Boolean): Seq[A] =
+ super.filter(p).asInstanceOf[Seq[A]]
/** Returns a sequence consisting only over the first <code>n</code>
* elements of this sequence, or else the whole sequence, if it has less
@@ -366,7 +367,8 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Collection[A] {
* @return the longest prefix of this sequence whose elements satisfy
* the predicate <code>p</code>.
*/
- override def takeWhile(p: A => Boolean): Seq[A] = super.takeWhile(p).asInstanceOf[Seq[A]]
+ override def takeWhile(p: A => Boolean): Seq[A] =
+ super.takeWhile(p).asInstanceOf[Seq[A]]
/** Returns the longest suffix of this sequence whose first element
* does not satisfy the predicate <code>p</code>.
@@ -375,7 +377,8 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Collection[A] {
* @return the longest suffix of the sequence whose first element
* does not satisfy the predicate <code>p</code>.
*/
- override def dropWhile(p: A => Boolean): Seq[A] = super.dropWhile(p).asInstanceOf[Seq[A]]
+ override def dropWhile(p: A => Boolean): Seq[A] =
+ super.dropWhile(p).asInstanceOf[Seq[A]]
/** A sequence consisting of all elements of this sequence in reverse order.
*/
@@ -422,17 +425,18 @@ trait Seq[+A] extends AnyRef with PartialFunction[Int, A] with Collection[A] {
override def force: Seq[A] = Seq.this
def elements = Seq.this.elements
def length = Seq.this.length
- def apply(idx : Int) = (Seq.this.apply(idx))
+ def apply(idx: Int) = Seq.this.apply(idx)
override def stringPrefix = Seq.this.stringPrefix + "P"
}
- def equalsWith[B](that: Seq[B])(f: (A,B) => Boolean): Boolean = {
- if (size != that.size) return false
- val i = elements
- val j = that.elements
- while (i.hasNext) if (!f(i.next, j.next)) return false
- true
- }
+ def equalsWith[B](that: Seq[B])(f: (A,B) => Boolean): Boolean =
+ if (size != that.size) false
+ else {
+ val i = elements
+ val j = that.elements
+ while (i.hasNext) if (!f(i.next, j.next)) return false
+ true
+ }
/**
* Checks whether the argument sequence is contained at the
diff --git a/src/library/scala/SeqProxy.scala b/src/library/scala/SeqProxy.scala
index 7c7a286e83..915211b2e9 100644
--- a/src/library/scala/SeqProxy.scala
+++ b/src/library/scala/SeqProxy.scala
@@ -40,7 +40,8 @@ trait SeqProxy[+A] extends Seq[A] with CollectionProxy[A] {
override def lastOption = self.lastOption
override def first = self.first
override def firstOption = self.firstOption
- override def headOption = self.headOption
+ @deprecated
+ override def headOption = firstOption
override def ++ [B >: A](that: Iterable[B]) = self ++ that
override def isDefinedAt(x: Int): Boolean = self isDefinedAt x
@@ -57,7 +58,8 @@ trait SeqProxy[+A] extends Seq[A] with CollectionProxy[A] {
override def drop(n: Int): Seq[A] = self drop n
override def slice(from: Int, len: Int): Seq[A] = self.slice(from, len)
- override def slice(from: Int) = self slice from
+ @deprecated
+ override def slice(from: Int) = slice(from, length)
override def takeWhile(p: A => Boolean): Seq[A] = self takeWhile p
override def dropWhile(p: A => Boolean): Seq[A] = self dropWhile p
@@ -65,8 +67,8 @@ trait SeqProxy[+A] extends Seq[A] with CollectionProxy[A] {
override def reverse: Seq[A] = self.reverse
override def contains(elem: Any): Boolean = self contains elem
-
- override def subseq(from: Int, end: Int) = self.subseq(from, end)
+ @deprecated
+ override def subseq(from: Int, end: Int) = slice(from, end - from)
override def toArray[B >: A]: Array[B] = self.toArray
diff --git a/src/library/scala/collection/immutable/Stack.scala b/src/library/scala/collection/immutable/Stack.scala
index 4826048309..7aff093471 100644
--- a/src/library/scala/collection/immutable/Stack.scala
+++ b/src/library/scala/collection/immutable/Stack.scala
@@ -48,7 +48,8 @@ class Stack[+A] extends Seq[A] {
* @param elem the element to push on the stack.
* @return the stack with the new element on top.
*/
- @deprecated def +[B >: A](elem: B): Stack[B] = new Node(elem)
+ @deprecated
+ def +[B >: A](elem: B): Stack[B] = new Node(elem)
/** Push an element on the stack.
*
@@ -63,7 +64,7 @@ class Stack[+A] extends Seq[A] {
* @param elems the element sequence.
* @return the stack with the new elements on top.
*/
- def push[B >: A](elems: B*): Stack[B] = this + elems
+ def push[B >: A](elems: B*): Stack[B] = this ++ elems
/** Push all elements provided by the given iterable object onto
* the stack. The last element returned by the iterable object
@@ -74,7 +75,8 @@ class Stack[+A] extends Seq[A] {
* @param elems the iterable object.
* @return the stack with the new elements on top.
*/
- @deprecated def +[B >: A](elems: Iterable[B]): Stack[B] =
+ @deprecated
+ def +[B >: A](elems: Iterable[B]): Stack[B] =
elems.foldLeft(this: Stack[B]){ (stack, elem) => stack + elem }
/** Push all elements provided by the given iterable object onto
@@ -84,8 +86,7 @@ class Stack[+A] extends Seq[A] {
* @param elems the iterable object.
* @return the stack with the new elements on top.
*/
- def push[B >: A](elems: Iterable[B]): Stack[B] =
- this ++ elems
+ def push[B >: A](elems: Iterable[B]): Stack[B] = this ++ elems
/** Push all elements provided by the given iterator object onto
* the stack. The last element returned by the iterable object
diff --git a/src/library/scala/collection/immutable/TreeHashMap.scala b/src/library/scala/collection/immutable/TreeHashMap.scala
index 27f5112e0c..33915402ec 100644
--- a/src/library/scala/collection/immutable/TreeHashMap.scala
+++ b/src/library/scala/collection/immutable/TreeHashMap.scala
@@ -1,13 +1,14 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2008, David MacIver **
+** / __/ __// _ | / / / _ | (c) 2008-2009, David MacIver **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id: $
-package scala.collection.immutable;
+
+package scala.collection.immutable
object TreeHashMap {
private[TreeHashMap] val _empty = new TreeHashMap[Any, Nothing](IntMap.empty[Nothing]);
@@ -45,15 +46,15 @@ class TreeHashMap[Key, +Value] private (private val underlying : IntMap[AssocMap
}
}
- def empty[V] = TreeHashMap.empty[Key, V];
+ def empty[V] = TreeHashMap.empty[Key, V]
- private def hash(key : Key) = {
+ private def hash(key : Key) = {
var h = key.hashCode;
h ^= ((h >>> 20) ^ (h >>> 12));
h ^ (h >>> 7) ^ (h >>> 4);
}
- override def stringPrefix="TreeHashMap"
+ override def stringPrefix = "TreeHashMap"
override lazy val size = underlying.values.foldLeft(0)((x, y) => x + y.size);
@@ -65,7 +66,7 @@ class TreeHashMap[Key, +Value] private (private val underlying : IntMap[AssocMap
case _ => false;
}
- override def hashCode = underlying.hashCode;
+ override def hashCode = underlying.hashCode
override def foreach(f : ((Key, Value)) => Unit) = underlying.foreachValue(_.foreach(f));
@@ -131,23 +132,24 @@ class TreeHashMap[Key, +Value] private (private val underlying : IntMap[AssocMap
}
-private [collection] object AssocMap{
- val _empty = Nil[Any];
+private [collection] object AssocMap {
+ val _empty = Nil[Any]
def empty[Key, Value] : AssocMap[Key, Value] = _empty.asInstanceOf[AssocMap[Key, Value]]
def singleton[Key, Value](key : Key, value : Value) = Cons(key, value, empty);
def apply[Key, Value](maps : (Key, Value)*) =
maps.foldLeft(empty[Key, Value])((x, y) => x.update(y._1, y._2));
- private[collection] case class Nil[Key] extends AssocMap[Key, Nothing];
- private[collection] case class Cons[S, +T](key : S, value : T, tail : AssocMap[S, T]) extends AssocMap[S, T]
+ private[collection] case class Nil[Key]() extends AssocMap[Key, Nothing]
+ private[collection] case class Cons[S, +T](key: S, value: T, tail: AssocMap[S, T]) extends AssocMap[S, T]
}
-import AssocMap._;
+import AssocMap._
-// AssocMap is very similar to ListMap. I don't want to patch ListMap right now, so I've got a separate
-// implementation here to make tweaks to. Long term any of these changes should be merged into ListMap
-// Short term it doesn't really matter because there are almost no viable use cases for ListMap compared
-// to one of the alternatives.
+// AssocMap is very similar to ListMap. I don't want to patch ListMap right
+// now, so I've got a separate implementation here to make tweaks to. Long
+// term any of these changes should be merged into ListMap
+// Short term it doesn't really matter because there are almost no viable
+// use cases for ListMap compared to one of the alternatives.
private[collection] sealed abstract class AssocMap[Key, +Value] extends immutable.Map[Key, Value]{
def empty[V] = AssocMap.empty[Key, V]
@@ -239,14 +241,14 @@ private[collection] sealed abstract class AssocMap[Key, +Value] extends immutabl
else Cons(key2, value2, tail.update(key, value));
}
- override def transform[C](f : (Key, Value) => C) : AssocMap[Key, C] = this match {
- case Nil() => AssocMap.empty[Key, C];
- case Cons(key, value, tail) => {
- val newtail = tail.transform(f);
- val newval = f(key, value);
+ override def transform[C](f: (Key, Value) => C): AssocMap[Key, C] = this match {
+ case Nil() =>
+ AssocMap.empty[Key, C]
+ case Cons(key, value, tail) =>
+ val newtail = tail.transform(f)
+ val newval = f(key, value)
if ((tail eq newtail) && (value.asInstanceOf[AnyRef] eq newval.asInstanceOf[AnyRef])) this.asInstanceOf[AssocMap[Key, C]];
else Cons(key, newval, newtail);
- }
}
def -(key : Key) : AssocMap[Key, Value]= this match {
diff --git a/src/library/scala/deprecated.scala b/src/library/scala/deprecated.scala
index e5321aefaa..cb152f1465 100644
--- a/src/library/scala/deprecated.scala
+++ b/src/library/scala/deprecated.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2009, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
diff --git a/src/library/scala/io/Position.scala b/src/library/scala/io/Position.scala
index 9ee868f5ca..4eec0e39d6 100644
--- a/src/library/scala/io/Position.scala
+++ b/src/library/scala/io/Position.scala
@@ -60,9 +60,6 @@ object Position {
/** The first position in a source file */
final val FIRSTPOS = encode(1, 1)
- //########################################################################
- // Public Functions
-
/** Encodes a position into a single integer. */
final def encode(line: Int, column: Int): Int = {
var line1, column1 = 0
@@ -73,17 +70,18 @@ object Position {
if (column < 0)
throw new IllegalArgumentException(line + "," + column + " not allowed")
- {if (line >= LINE_MASK) {
+ if (line >= LINE_MASK) {
line1 = LINE_MASK
column1 = 0
- } else {
+ }
+ else {
line1 = line
if (column > COLUMN_MASK)
column1 = COLUMN_MASK
else
column1 = column
- }}
- {(line1 << COLUMN_BITS) | column1;}
+ }
+ (line1 << COLUMN_BITS) | column1
}
/** Returns the line number of the encoded position. */
@@ -96,10 +94,10 @@ object Position {
/** Returns a string representation of the encoded position. */
def toString(pos: Int): String = {
- val sb = new StringBuilder()
- sb.append(line(pos))
- sb.append(':')
- sb.append(column(pos))
+ val sb = new StringBuilder
+ sb append line(pos)
+ sb append ':'
+ sb append column(pos)
sb.toString()
}
}
diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala
index b97135f69c..3b79202b41 100644
--- a/src/library/scala/io/Source.scala
+++ b/src/library/scala/io/Source.scala
@@ -14,9 +14,9 @@ package scala.io
import java.io.{BufferedInputStream, File, FileInputStream, InputStream,
PrintStream}
+import java.net.{URI, URL}
import java.nio.{ByteBuffer, CharBuffer}
import java.nio.charset.Charset
-import java.net.{URI, URL}
/** This object provides convenience methods to create an iterable
* representation of a source file.
@@ -156,7 +156,7 @@ object Source {
fromURL(new URL(s), enc)
/**
- * @param url ...
+ * @param url the source URL
* @return ...
* @deprecated use fromURL(url, enc)
*/
@@ -192,13 +192,14 @@ object Source {
* @param enc the encoding to apply to the bytes
* @param maxlen optionally, a positive int specifying maximum number of bytes to read
*/
- @deprecated def fromInputStream(istream: InputStream, enc: String, maxlen: Option[Int]): Source = {
+ @deprecated
+ def fromInputStream(istream: InputStream, enc: String, maxlen: Option[Int]): Source = {
val limit = maxlen match { case Some(i) => i; case None => 0 }
val bi = new BufferedInputStream(istream, Source.DefaultBufSize)
val bytes = new collection.mutable.ArrayBuffer[Byte]()
var b = 0
var i = 0
- while( {b = bi.read; i += 1; b} != -1 && (limit <= 0 || i < limit)) {
+ while ( {b = bi.read; i += 1; b} != -1 && (limit <= 0 || i < limit)) {
bytes += b.toByte;
}
if(limit <= 0) bi.close
@@ -267,8 +268,8 @@ abstract class Source extends Iterator[Char] {
*/
def getLine(line: Int): String = { // faster than getLines.drop(line).next
// todo: should @throws scala.compat.Platform.IndexOutOfBoundsException
- if (line < 1) throw new IllegalArgumentException(line.toString);
- val buf = new StringBuilder()
+ if (line < 1) throw new IllegalArgumentException(line.toString)
+ val buf = new StringBuilder
val it = reset
var i = 0
@@ -279,7 +280,7 @@ abstract class Source extends Iterator[Char] {
if (!it.hasNext) // this should not happen
throw new IllegalArgumentException(
"line " + line + " does not exist"
- );
+ )
var ch = it.next
while (it.hasNext && '\n' != ch) {
@@ -302,11 +303,11 @@ abstract class Source extends Iterator[Char] {
val buf = new StringBuilder
def next = {
var ch = iter.next
- while(ch != '\n' && iter.hasNext) {
+ while (ch != '\n' && iter.hasNext) {
buf append ch
ch = iter.next
}
- buf.append(ch)
+ buf append ch
val res = buf.toString()
buf setLength 0 // clean things up for next call of "next"
res
@@ -320,9 +321,9 @@ abstract class Source extends Iterator[Char] {
/** returns next character and has the following side-effects: updates
* position (ccol and cline) and assigns the character to ch
*/
- def next = {
+ def next: Char = {
ch = iter.next
- pos = Position.encode(cline,ccol)
+ pos = Position.encode(cline, ccol)
ch match {
case '\n' =>
ccol = 1
@@ -337,26 +338,26 @@ abstract class Source extends Iterator[Char] {
/** Reports an error message to console.
*
- * @param pos ...
+ * @param pos the source position (line/column)
* @param msg the error message to report
*/
def reportError(pos: Int, msg: String) {
- reportError(pos, msg, java.lang.System.out)
+ reportError(pos, msg, Console.out)
}
/** Reports an error message to the output stream <code>out</code>.
*
- * @param pos ...
+ * @param pos the source position (line/column)
* @param msg the error message to report
* @param out ...
*/
def reportError(pos: Int, msg: String, out: PrintStream) {
- nerrors = nerrors + 1
+ nerrors += 1
report(pos, msg, out)
}
/**
- * @param pos ...
+ * @param pos the source position (line/column)
* @param msg the error message to report
* @param out ...
*/
@@ -365,32 +366,32 @@ abstract class Source extends Iterator[Char] {
val line = Position.line(pos)
val col = Position.column(pos)
buf.append(descr + ":" + line + ":" + col + ": " + msg)
- buf.append(getLine(line))
+ buf append getLine(line)
var i = 1
while (i < col) {
- buf.append(' ')
+ buf append ' '
i += 1
}
- buf.append('^')
+ buf append '^'
out.println(buf.toString)
}
- /** Reports a warning message to <code>java.lang.System.out</code>.
+ /** Reports a warning message to <code>Console.out</code>.
*
- * @param pos ...
+ * @param pos the source position (line/column)
* @param msg the warning message to report
*/
def reportWarning(pos: Int, msg: String) {
- reportWarning(pos, msg, java.lang.System.out)
+ reportWarning(pos, msg, Console.out)
}
/**
- * @param pos ...
+ * @param pos the source position (line/column)
* @param msg the warning message to report
* @param out ...
*/
def reportWarning(pos: Int, msg: String, out: PrintStream) {
- nwarnings = nwarnings + 1
+ nwarnings += 1
report(pos, "warning! " + msg, out)
}
diff --git a/src/library/scala/io/UTF8Codec.scala b/src/library/scala/io/UTF8Codec.scala
index 3d1d307c53..6d5e569971 100644
--- a/src/library/scala/io/UTF8Codec.scala
+++ b/src/library/scala/io/UTF8Codec.scala
@@ -28,7 +28,7 @@ object UTF8Codec {
val byteMask = 0xBF
val byteMark = 0x80
var bytesToWrite = 0
- val firstByteMark = List[Byte](0x00.asInstanceOf[Byte], 0x00.asInstanceOf[Byte], 0xC0.asInstanceOf[Byte], 0xE0.asInstanceOf[Byte], 0xF0.asInstanceOf[Byte], 0xF8.asInstanceOf[Byte], 0xFC.asInstanceOf[Byte])
+ val firstByteMark = List[Byte](0x00.toByte, 0x00.toByte, 0xC0.toByte, 0xE0.toByte, 0xF0.toByte, 0xF8.toByte, 0xFC.toByte)
if (ch < 0x80) { bytesToWrite = 1 }
else if (ch < 0x800) { bytesToWrite = 2 }
@@ -39,19 +39,19 @@ object UTF8Codec {
val res = new Array[Byte](bytesToWrite)
var bw = bytesToWrite
- if(bw>=4) {
- res(3) = ((ch | byteMark) & byteMask).asInstanceOf[Byte]; ch = ch >> 6; bw -= 1
+ if (bw >= 4) {
+ res(3) = ((ch | byteMark) & byteMask).toByte; ch = ch >> 6; bw -= 1
}
- if(bw>=3) {
- res(2) = ((ch | byteMark) & byteMask).asInstanceOf[Byte]; ch = ch >> 6; bw -= 1
+ if (bw >= 3) {
+ res(2) = ((ch | byteMark) & byteMask).toByte; ch = ch >> 6; bw -= 1
}
- if(bw>=2) {
- res(1) = ((ch | byteMark) & byteMask).asInstanceOf[Byte]; ch = ch >> 6; bw -= 1
+ if (bw >= 2) {
+ res(1) = ((ch | byteMark) & byteMask).toByte; ch = ch >> 6; bw -= 1
}
- if(bw>=1) {
- res(0) = (ch | firstByteMark(bytesToWrite)).asInstanceOf[Byte]
+ if (bw >= 1) {
+ res(0) = (ch | firstByteMark(bytesToWrite)).toByte
}
- return res
+ res
}
def encode(src: Array[Char], from: Int, dst: Array[Byte], to: Int, len: Int): Int = {
diff --git a/src/library/scala/remote.scala b/src/library/scala/remote.scala
index 6b377bc2e0..5208417807 100644
--- a/src/library/scala/remote.scala
+++ b/src/library/scala/remote.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2009, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
diff --git a/src/library/scala/util/Sorting.scala b/src/library/scala/util/Sorting.scala
index ab22314916..a7b740ce40 100644
--- a/src/library/scala/util/Sorting.scala
+++ b/src/library/scala/util/Sorting.scala
@@ -550,7 +550,7 @@ object Sorting {
5.785996973446602E9,
// 0.0/0.0,
3.973064849653333E10,
- 3.724737288678125E10,
+ 3.724737288678125E10
// 0.0/0.0
)
val floats = Array(
@@ -561,7 +561,7 @@ object Sorting {
5.785996973446602E9f,
// 0.0f/0.0f,
3.973064849653333E10f,
- 3.724737288678125E10f,
+ 3.724737288678125E10f
// 0.0f/0.0f
)
Sorting quickSort tuples