diff options
19 files changed, 12 insertions, 262 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala index a3cc5310ab..8ed2b04045 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala @@ -237,7 +237,7 @@ trait TypeKinds { self: ICodes => // override def maxType(other: TypeKind): TypeKind = other match { // case STRING => STRING; // case _ => - // abort("Uncomparbale type kinds: STRING with " + other); + // abort("Uncomparable type kinds: STRING with " + other); // } // } @@ -263,7 +263,7 @@ trait TypeKinds { self: ICodes => case REFERENCE(_) | ARRAY(_) => REFERENCE(AnyRefClass) case _ => - abort("Uncomparbale type kinds: REFERENCE with " + other) + abort("Uncomparable type kinds: REFERENCE with " + other) } /** Checks subtyping relationship. */ @@ -334,7 +334,7 @@ trait TypeKinds { self: ICodes => if (elem == elem2) ARRAY(elem) else REFERENCE(AnyRefClass) case _ => - abort("Uncomparbale type kinds: ARRAY with " + other) + abort("Uncomparable type kinds: ARRAY with " + other) } /** Array subtyping is covariant, as in Java. Necessary for checking @@ -370,7 +370,7 @@ trait TypeKinds { self: ICodes => case REFERENCE(_) | ARRAY(_) | BOXED(_) => REFERENCE(AnyRefClass) case _ => - abort("Uncomparbale type kinds: ARRAY with " + other) + abort("Uncomparable type kinds: ARRAY with " + other) } /** Checks subtyping relationship. */ @@ -409,7 +409,7 @@ trait TypeKinds { self: ICodes => case REFERENCE(_) => REFERENCE(AnyRefClass) case _ => - abort("Uncomparbale type kinds: ConcatClass with " + other) + abort("Uncomparable type kinds: ConcatClass with " + other) } /** Checks subtyping relationship. */ diff --git a/src/library/scala/Console.scala b/src/library/scala/Console.scala index 8be1e0f8dc..e99a0af8ff 100644 --- a/src/library/scala/Console.scala +++ b/src/library/scala/Console.scala @@ -213,17 +213,6 @@ object Console { */ def printf(text: String, args: Any*) { out.print(text format (args : _*)) } - /** - * @see <a href="#printf(java.lang.String,scala.Any*)" - * target="contentFrame">Console.printf</a>. - */ - @deprecated("For console output, use <code>Console.printf</code>. For <code>String</code>\n"+ - "formatting, <code>StringOps</code>'s <code>format</code> method.") - 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 * input stream has been reached. * @@ -435,26 +424,4 @@ object Console { } res } - - private def textParams(s: Seq[Any]): Array[AnyRef] = { - val res = new Array[AnyRef](s.length) - var i: Int = 0 - val iter = s.iterator - while (iter.hasNext) { - res(i) = iter.next match { - case x: Boolean => java.lang.Boolean.valueOf(x) - case x: Byte => java.lang.Byte.valueOf(x) - case x: Short => java.lang.Short.valueOf(x) - case x: Char => java.lang.Character.valueOf(x) - case x: Int => java.lang.Integer.valueOf(x) - case x: Long => java.lang.Long.valueOf(x) - case x: Float => java.lang.Float.valueOf(x) - case x: Double => java.lang.Double.valueOf(x) - case x: Unit => "()" - case x: AnyRef => x - } - i += 1 - } - res - } } diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala index 6f9ba306ad..57539e7139 100644 --- a/src/library/scala/Option.scala +++ b/src/library/scala/Option.scala @@ -50,12 +50,6 @@ sealed abstract class Option[+A] extends Product { */ def get: A - @deprecated("use <code>getOrElse</code> instead") - def get[B >: A](default: B): B = this match { - case None => default - case Some(x) => x - } - /** If the option is nonempty return its value, * otherwise return the result of evaluating a default expression. * diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index c44ec72299..d220b922c3 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -38,11 +38,6 @@ object Predef extends LowPriorityImplicits { @deprecated("lower-case type aliases will be removed") type boolean = scala.Boolean @deprecated("lower-case type aliases will be removed") type unit = scala.Unit - @deprecated("use <code>java.lang.Integer</code> instead") - type Integer = java.lang.Integer - @deprecated("use <code>java.lang.Character</code> instead") - type Character = java.lang.Character - type String = java.lang.String type Class[T] = java.lang.Class[T] type Runnable = java.lang.Runnable diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala index 22b8328b1e..ea186c7a7e 100644 --- a/src/library/scala/collection/Iterator.scala +++ b/src/library/scala/collection/Iterator.scala @@ -190,13 +190,6 @@ object Iterator { xs.slice(start, start + length).iterator /** - * @param str the given string - * @return the iterator on <code>str</code> - */ - @deprecated("replaced by <code>str.iterator</code>") - def fromString(str: String): Iterator[Char] = str.iterator - - /** * @param n the product arity * @return the iterator on <code>Product<n></code>. */ diff --git a/src/library/scala/collection/Seq.scala b/src/library/scala/collection/Seq.scala index 8ae857af32..18d37eba82 100644 --- a/src/library/scala/collection/Seq.scala +++ b/src/library/scala/collection/Seq.scala @@ -54,9 +54,5 @@ object Seq extends SeqFactory[Seq] { @deprecated("use Seq(value) instead") def singleton[A](value: A) = Seq(value) - - /** Builds a singleton sequence. */ - @deprecated("use <code>Seq(x)</code> instead.") - def single[A](x: A) = singleton(x) } diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala index 749aeacd73..661f7b7a04 100644 --- a/src/library/scala/collection/SeqLike.scala +++ b/src/library/scala/collection/SeqLike.scala @@ -617,15 +617,6 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self => @deprecated("use `lastIndexWhere' instead") def findLastIndexOf(p: A => Boolean): Int = lastIndexWhere(p) - /** A sub-sequence starting at index <code>from</code> - * and extending up to the length of the current sequence - * - * @param from The index of the first element of the slice - * @throws IndexOutOfBoundsException if <code>from < 0</code> - */ - @deprecated("use `drop' instead") - def slice(from: Int): Seq[A] = toCollection(slice(from, length)) - @deprecated("Should be replaced by <code>(s1, s2) forall { case (x, y) => f(x, y) }</code>") def equalsWith[B](that: Seq[B])(f: (A,B) => Boolean): Boolean = { val i = this.iterator diff --git a/src/library/scala/collection/SeqProxyLike.scala b/src/library/scala/collection/SeqProxyLike.scala index df4ea77f56..1ca3bfa155 100644 --- a/src/library/scala/collection/SeqProxyLike.scala +++ b/src/library/scala/collection/SeqProxyLike.scala @@ -57,7 +57,6 @@ trait SeqProxyLike[+A, +This <: SeqLike[A, This] with Seq[A]] extends SeqLike[A, override def view = self.view override def view(from: Int, until: Int) = self.view(from, until) override def findLastIndexOf(p: A => Boolean): Int = self.lastIndexWhere(p) - override def slice(from: Int): Seq[A] = self.drop(from) override def equalsWith[B](that: Seq[B])(f: (A,B) => Boolean): Boolean = (self zip that) forall { case (x,y) => f(x,y) } override def containsSlice[B](that: Seq[B]): Boolean = self.indexOfSeq(that) != -1 } diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index 94732d7ad5..d22865cad4 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -656,26 +656,6 @@ object List extends SeqFactory[List] { res } - /** Parses a string which contains substrings separated by a - * separator character and returns a list of all substrings. - * - * @param str the string to parse - * @param separator the separator character - * @return the list of substrings - */ - @deprecated("use `str.split(separator).toList' instead") - def fromString(str: String, separator: Char): List[String] = { - var words: List[String] = Nil - var pos = str.length() - while (pos > 0) { - val pos1 = str.lastIndexOf(separator, pos - 1) - if (pos1 + 1 < pos) - words = str.substring(pos1 + 1, pos) :: words - pos = pos1 - } - words - } - /** Returns the given string as a list of characters. * * @param str the string to convert. diff --git a/src/library/scala/collection/immutable/PagedSeq.scala b/src/library/scala/collection/immutable/PagedSeq.scala index 72e09829d4..08979ac347 100644 --- a/src/library/scala/collection/immutable/PagedSeq.scala +++ b/src/library/scala/collection/immutable/PagedSeq.scala @@ -182,7 +182,7 @@ extends scala.collection.IndexedSeq[T] /** the subsequence from index `start' up to the * length of the current sequence. */ - override def slice(start: Int) = slice(start, UndeterminedEnd) + def slice(start: Int): PagedSeq[T] = slice(start, UndeterminedEnd) /** Convert sequence to string */ override def toString = { diff --git a/src/library/scala/concurrent/SyncVar.scala b/src/library/scala/concurrent/SyncVar.scala index d64c2fa51c..d577966f17 100644 --- a/src/library/scala/concurrent/SyncVar.scala +++ b/src/library/scala/concurrent/SyncVar.scala @@ -63,17 +63,6 @@ class SyncVar[A] { notifyAll() } - @deprecated("Will be removed in 2.8. SyncVar should not allow exception by design.") - def setWithCatch(x: => A) = synchronized { - try { - this set x - } catch { - case e => - this setException e - throw e - } - } - def put(x: A) = synchronized { while (isDefined) wait() set(x) diff --git a/src/library/scala/concurrent/jolib.scala b/src/library/scala/concurrent/jolib.scala deleted file mode 100644 index c2cf5d2186..0000000000 --- a/src/library/scala/concurrent/jolib.scala +++ /dev/null @@ -1,82 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2009, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala.concurrent - -import ops._ - -/** - * Library for using join-calculus concurrent primitives in Scala. - * - * @author Vincent Cremet - * @version 1.0, 17/10/2003 - */ -@deprecated("Will be removed.") -object jolib { - - type Pattern = List[Signal] - - type Rule = PartialFunction[List[Any], Unit] - - /////////////////// JOIN DEFINITION ///////////////////////// - - class Join { - - private var ruls: List[(Pattern, Rule)] = null - - def canMatch(p: Pattern) = - p forall { s => !s.queue.isEmpty } - - def values(p: Pattern): List[Any] = - p map { s => s.queue.dequeue: Any } - - def rules(rs: (Pattern, Rule)*) = - ruls = rs.asInstanceOf[List[(Pattern, Rule)]] - - def tryMatch = - ruls find { case (p, _) => canMatch(p) } match { - case None => () => () - case Some((p, r)) => { - val args = values(p) - () => spawn(r(args)) - } - } - - } - - /////////////////// SIGNALS ///////////////////////// - - abstract class Signal(join: Join) { - type C - val queue = new collection.mutable.Queue[C] - def tryReduction(x: C) { - val continuation = join synchronized { - queue.enqueue(x) - join.tryMatch - } - continuation() - } - } - - abstract class Asynchr(join: Join) extends Signal(join) { - def apply(x: C): Unit = tryReduction(x) - } - - abstract class Synchr[A](join: Join) extends Signal(join) { - type C <: SyncVar[A] - def apply(x: C): A = { - tryReduction(x) - x.get - } - } - -} - diff --git a/src/library/scala/ref/Reference.scala b/src/library/scala/ref/Reference.scala index 4fa69f77b3..ea25b48bee 100644 --- a/src/library/scala/ref/Reference.scala +++ b/src/library/scala/ref/Reference.scala @@ -15,12 +15,10 @@ package scala.ref * @author Sean McDirmid */ trait Reference[+T <: AnyRef] extends Function0[T] { - @deprecated("Use .get.isDefined instead") - def isValid: Boolean /** return the underlying value */ def apply(): T /** return <code>Some</code> underlying if it hasn't been collected, otherwise <code>None</code> */ - def get : Option[T] + def get: Option[T] override def toString = get.map(_.toString).getOrElse("<deleted>") def clear(): Unit def enqueue(): Boolean diff --git a/src/library/scala/ref/ReferenceWrapper.scala b/src/library/scala/ref/ReferenceWrapper.scala index a562e56c3a..2793876d51 100644 --- a/src/library/scala/ref/ReferenceWrapper.scala +++ b/src/library/scala/ref/ReferenceWrapper.scala @@ -15,7 +15,6 @@ package scala.ref */ trait ReferenceWrapper[+T <: AnyRef] extends Reference[T] with Proxy { val underlying: java.lang.ref.Reference[_ <: T] - @deprecated("Use .get.isDefined instead") def isValid = underlying.get != null override def get = { val ret = underlying.get if (ret eq null) None else Some(ret) diff --git a/src/library/scala/unsealed.scala b/src/library/scala/unsealed.scala deleted file mode 100644 index 458d971555..0000000000 --- a/src/library/scala/unsealed.scala +++ /dev/null @@ -1,18 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2009, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - - -package scala - -/** - * @since 2.4 - */ -@deprecated("use `unchecked' instead") -class unsealed extends Annotation diff --git a/src/library/scala/util/parsing/input/CharArrayPosition.scala b/src/library/scala/util/parsing/input/CharArrayPosition.scala deleted file mode 100644 index 54907e037e..0000000000 --- a/src/library/scala/util/parsing/input/CharArrayPosition.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2006-2009, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -// $Id$ - -package scala.util.parsing.input - -/** <code>CharArrayPosition</code> implements the general <code>Position</code> - * class for documents represented by an <code>Array</code> of `char's. - * - * @param source The contents of the document in which this position is contained - * @param line The line number of the position (1-based) - * @param columm The column number of the position (1-based) - * - * @author Martin Odersky, Adriaan Moors - */ -@deprecated("use OffsetPosition instead") -class CharArrayPosition(val source: Array[Char], val line: Int, val column: Int) extends Position { - - // TODO: this could be implemented more high-level: - // return the string representation of the sub-array of source that starts - // after the (lnum-1)'ed '\n' up to (but not including) the (lnum)'ed '\n' - protected def lineContents = { - var i = 0 - var l = 1 - while (i < source.length && l < line) { - while (i < source.length && source(i) != '\n') i += 1 - i += 1 - l += 1 - } - var chars = new StringBuffer - while (i < source.length && source(i) != '\n') { - chars append source(i) - i += 1 - } - chars.toString - } -} - diff --git a/src/library/scala/util/parsing/input/CharArrayReader.scala b/src/library/scala/util/parsing/input/CharArrayReader.scala index 360820608c..713636796b 100644 --- a/src/library/scala/util/parsing/input/CharArrayReader.scala +++ b/src/library/scala/util/parsing/input/CharArrayReader.scala @@ -16,9 +16,6 @@ package scala.util.parsing.input */ object CharArrayReader { final val EofCh = '\032' - - @deprecated("This should probably be LF instead?") - final val CR = '\015' } /** A character array reader reads a stream of characters (keeping track of their positions) diff --git a/src/library/scala/xml/Utility.scala b/src/library/scala/xml/Utility.scala index 0628de8922..2613da6c61 100644 --- a/src/library/scala/xml/Utility.scala +++ b/src/library/scala/xml/Utility.scala @@ -74,9 +74,6 @@ object Utility extends AnyRef with parsing.TokenTests case _ => n } - @deprecated("a string might also be Atom(s) - define your own conversion") - def view(s: String): Text = Text(s) - /** * Escapes the characters < > & and " from string. * diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala index 2e2049ffbe..641950f7b9 100644 --- a/src/partest/scala/tools/partest/nest/Worker.scala +++ b/src/partest/scala/tools/partest/nest/Worker.scala @@ -125,10 +125,9 @@ class Worker(val fileManager: FileManager) extends Actor { val classpath: List[URL] = outDir.toURL :: //List(file.getParentFile.toURL) ::: - List(latestCompFile.toURL, latestLibFile.toURL, - latestActFile.toURL, latestPartestFile.toURL) ::: - (List.fromString(CLASSPATH, File.pathSeparatorChar) map { x => - (new File(x)).toURL }) + List(latestCompFile.toURL, latestLibFile.toURL, latestActFile.toURL, latestPartestFile.toURL) ::: + ((CLASSPATH split File.pathSeparatorChar).toList map (x => new File(x).toURL)) + NestUI.verbose("ObjectRunner classpath: "+classpath) try { @@ -589,7 +588,7 @@ class Worker(val fileManager: FileManager) extends Actor { "-d "+outDir.getCanonicalFile.getAbsolutePath+ " -Xresident"+ " -sourcepath "+sourcepath - val argList = List.fromString(argString, ' ') + val argList = argString split ' ' toList // configure input/output files val logOut = new FileOutputStream(logFile) @@ -610,7 +609,7 @@ class Worker(val fileManager: FileManager) extends Actor { val resCompile = (line: String) => { NestUI.verbose("compiling "+line) - val cmdArgs = List.fromString(line, ' ') map { fs => new File(dir, fs).getAbsolutePath } + val cmdArgs = (line split ' ').toList map (fs => new File(dir, fs).getAbsolutePath) NestUI.verbose("cmdArgs: "+cmdArgs) val sett = new Settings(error) sett.sourcepath.value = sourcepath |