summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-05-30 18:10:21 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-05-30 18:10:21 +0000
commitc6cf4fc02204d20f792bd493641d8ccd12421800 (patch)
treea8827ab270cf77a1c5f36a48a8cf125e1bcfb8c3 /src/library
parentab9381b4539097205d19df235f8cc3a5b2349e95 (diff)
downloadscala-c6cf4fc02204d20f792bd493641d8ccd12421800.tar.gz
scala-c6cf4fc02204d20f792bd493641d8ccd12421800.tar.bz2
scala-c6cf4fc02204d20f792bd493641d8ccd12421800.zip
big overhaul of annotations implementation.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/Array.scala90
-rw-r--r--src/library/scala/Attribute.scala22
-rw-r--r--src/library/scala/ClassfileAnnotation.scala2
-rw-r--r--src/library/scala/ClassfileAttribute.scala26
-rw-r--r--src/library/scala/Console.scala5
-rw-r--r--src/library/scala/CountedIterator.scala4
-rw-r--r--src/library/scala/Either.scala10
-rw-r--r--src/library/scala/Enumeration.scala47
-rw-r--r--src/library/scala/Option.scala4
-rw-r--r--src/library/scala/Predef.scala28
-rw-r--r--src/library/scala/Product.scala5
-rw-r--r--src/library/scala/Range.scala2
-rw-r--r--src/library/scala/StaticAttribute.scala25
-rw-r--r--src/library/scala/collection/Iterable.scala18
-rw-r--r--src/library/scala/collection/Iterator.scala63
-rw-r--r--src/library/scala/collection/Sequence.scala20
-rw-r--r--src/library/scala/collection/generic/BufferTemplate.scala52
-rw-r--r--src/library/scala/collection/generic/ImmutableMapTemplate.scala4
-rw-r--r--src/library/scala/collection/generic/IterableTemplate.scala19
-rw-r--r--src/library/scala/collection/generic/MapTemplate.scala11
-rw-r--r--src/library/scala/collection/generic/MutableMapTemplate.scala69
-rw-r--r--src/library/scala/collection/generic/MutableSetTemplate.scala50
-rw-r--r--src/library/scala/collection/generic/SequenceTemplate.scala38
-rw-r--r--src/library/scala/collection/generic/SetTemplate.scala3
-rw-r--r--src/library/scala/collection/generic/TraversableTemplate.scala4
-rw-r--r--src/library/scala/collection/generic/TraversableView.scala2
-rwxr-xr-xsrc/library/scala/collection/generic/TraversableView.scala.12
-rw-r--r--src/library/scala/collection/immutable/ImmutableIterator.scala.disabled2
-rw-r--r--src/library/scala/collection/immutable/IntMap.scala4
-rw-r--r--src/library/scala/collection/immutable/List.scala95
-rw-r--r--src/library/scala/collection/immutable/LongMap.scala4
-rw-r--r--src/library/scala/collection/immutable/Queue.scala10
-rw-r--r--src/library/scala/collection/immutable/RedBlack.scala12
-rw-r--r--src/library/scala/collection/immutable/Stream.scala25
-rw-r--r--src/library/scala/collection/immutable/TreeHashMap.scala2
-rw-r--r--src/library/scala/collection/mutable/ArrayStack.scala6
-rw-r--r--src/library/scala/collection/mutable/CloneableCollection.scala3
-rw-r--r--src/library/scala/collection/mutable/HashTable.scala7
-rw-r--r--src/library/scala/collection/mutable/ImmutableMapAdaptor.scala2
-rw-r--r--src/library/scala/collection/mutable/ImmutableSetAdaptor.scala2
-rw-r--r--src/library/scala/collection/mutable/MutableList.scala3
-rw-r--r--src/library/scala/collection/mutable/OpenHashMap.scala4
-rw-r--r--src/library/scala/collection/mutable/Stack.scala6
-rw-r--r--src/library/scala/collection/mutable/StringBuilder.scala51
-rw-r--r--src/library/scala/concurrent/SyncVar.scala6
-rw-r--r--src/library/scala/deprecated.scala4
-rw-r--r--src/library/scala/io/Source.scala4
-rwxr-xr-xsrc/library/scala/package.scala6
-rw-r--r--src/library/scala/reflect/BeanInfo.scala4
-rw-r--r--src/library/scala/reflect/BeanInfoSkip.scala2
-rw-r--r--src/library/scala/reflect/BeanProperty.scala2
-rw-r--r--src/library/scala/runtime/BoxedArray.scala4
-rw-r--r--src/library/scala/testing/SUnit.scala7
-rw-r--r--src/library/scala/unsealed.scala6
-rw-r--r--src/library/scala/util/parsing/input/CharArrayPosition.scala3
-rw-r--r--src/library/scala/util/parsing/input/CharArrayReader.scala4
-rw-r--r--src/library/scala/xml/Utility.scala5
57 files changed, 384 insertions, 536 deletions
diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala
index 0ea2b9f972..b72bdb01e7 100644
--- a/src/library/scala/Array.scala
+++ b/src/library/scala/Array.scala
@@ -171,22 +171,21 @@ object Array extends SequenceFactory[Array] {
def ofDim[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int): Array[Array[Array[Array[Array[A]]]]] =
tabulate(n1)(_ => ofDim[A](n2, n3, n4, n5))
- /** Create array with given dimensions
- * @deprecated use ofDim instead */
- @deprecated def withDims[A](n1: Int): Array[A] = ofDim(n1)
- @deprecated def withDims[A](n1: Int, n2: Int): Array[Array[A]] = ofDim(n1, n2)
- @deprecated def withDims[A](n1: Int, n2: Int, n3: Int): Array[Array[Array[A]]] = ofDim(n1, n2, n3)
- @deprecated def withDims[A](n1: Int, n2: Int, n3: Int, n4: Int): Array[Array[Array[Array[A]]]] = ofDim(n1, n2, n3, n4)
- @deprecated def withDims[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int): Array[Array[Array[Array[Array[A]]]]] = ofDim(n1, n2, n3, n4, n5)
+ /** Create array with given dimensions */
+ @deprecated("use `ofDim' instead") def withDims[A](n1: Int): Array[A] = ofDim(n1)
+ @deprecated("use `ofDim' instead") def withDims[A](n1: Int, n2: Int): Array[Array[A]] = ofDim(n1, n2)
+ @deprecated("use `ofDim' instead") def withDims[A](n1: Int, n2: Int, n3: Int): Array[Array[Array[A]]] = ofDim(n1, n2, n3)
+ @deprecated("use `ofDim' instead") def withDims[A](n1: Int, n2: Int, n3: Int, n4: Int): Array[Array[Array[Array[A]]]] = ofDim(n1, n2, n3, n4)
+ @deprecated("use `ofDim' instead") def withDims[A](n1: Int, n2: Int, n3: Int, n4: Int, n5: Int): Array[Array[Array[Array[Array[A]]]]] = ofDim(n1, n2, n3, n4, n5)
/** Create an array containing several copies of an element.
*
* @param n the length of the resulting array
* @param elem the element composing the resulting array
* @return an array composed of n elements all equal to elem
- * @deprecated use `Array.fill` instead.
*/
- @deprecated def make[A](n: Int, elem: A): Array[A] = {
+ @deprecated("use `Array.fill' instead")
+ def make[A](n: Int, elem: A): Array[A] = {
val a = new Array[A](n)
var i = 0
while (i < n) {
@@ -198,9 +197,9 @@ object Array extends SequenceFactory[Array] {
/** Create an array containing the values of a given function <code>f</code>
* over given range <code>[0..n)</code>
- * @deprecated use `Array.tabulate` instead.
*/
- @deprecated def fromFunction[A](f: Int => A)(n: Int): Array[A] = {
+ @deprecated("use `Array.tabulate' instead")
+ def fromFunction[A](f: Int => A)(n: Int): Array[A] = {
val a = new Array[A](n)
var i = 0
while (i < n) {
@@ -212,30 +211,30 @@ object Array extends SequenceFactory[Array] {
/** Create an array containing the values of a given function <code>f</code>
* over given range <code>[0..n1, 0..n2)</code>
- * @deprecated use `Array.tabulate` instead.
*/
- @deprecated def fromFunction[A](f: (Int, Int) => A)(n1: Int, n2: Int): Array[Array[A]] =
+ @deprecated("use `Array.tabulate' instead")
+ def fromFunction[A](f: (Int, Int) => A)(n1: Int, n2: Int): Array[Array[A]] =
fromFunction(i => fromFunction(f(i, _))(n2))(n1)
/** Create an array containing the values of a given function <code>f</code>
* over given range <code>[0..n1, 0..n2, 0..n3)</code>
- * @deprecated use `Array.tabulate` instead.
*/
- @deprecated def fromFunction[A](f: (Int, Int, Int) => A)(n1: Int, n2: Int, n3: Int): Array[Array[Array[A]]] =
+ @deprecated("use `Array.tabulate' instead")
+ def fromFunction[A](f: (Int, Int, Int) => A)(n1: Int, n2: Int, n3: Int): Array[Array[Array[A]]] =
fromFunction(i => fromFunction(f(i, _, _))(n2, n3))(n1)
/** Create an array containing the values of a given function <code>f</code>
* over given range <code>[0..n1, 0..n2, 0..n3, 0..n4)</code>
- * @deprecated use `Array.tabulate` instead.
*/
- @deprecated def fromFunction[A](f: (Int, Int, Int, Int) => A)(n1: Int, n2: Int, n3: Int, n4: Int): Array[Array[Array[Array[A]]]] =
+ @deprecated("use `Array.tabulate' instead")
+ def fromFunction[A](f: (Int, Int, Int, Int) => A)(n1: Int, n2: Int, n3: Int, n4: Int): Array[Array[Array[Array[A]]]] =
fromFunction(i => fromFunction(f(i, _, _, _))(n2, n3, n4))(n1)
/** Create an array containing the values of a given function <code>f</code>
* over given range <code>[0..n1, 0..n2, 0..n3, 0..n4, 0..n5)</code>
- * @deprecated use `Array.tabulate` instead.
*/
- @deprecated def fromFunction[A](f: (Int, Int, Int, Int, Int) => A)(n1: Int, n2: Int, n3: Int, n4: Int, n5: Int): Array[Array[Array[Array[Array[A]]]]] =
+ @deprecated("use `Array.tabulate' instead")
+ def fromFunction[A](f: (Int, Int, Int, Int, Int) => A)(n1: Int, n2: Int, n3: Int, n4: Int, n5: Int): Array[Array[Array[Array[Array[A]]]]] =
fromFunction(i => fromFunction(f(i, _, _, _, _))(n2, n3, n4, n5))(n1)
}
@@ -251,59 +250,58 @@ final class Array[A](_length: Int) extends Vector[A]
override def companion: Companion[Array] = throw new Error()
- /** Multidimensional array creation
- * @deprecated use Array.ofDim instead
- */
- @deprecated def this(dim1: Int, dim2: Int) = {
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim' instead")
+ def this(dim1: Int, dim2: Int) = {
this(dim1)
throw new Error()
}
- /** Multidimensional array creation
- * @deprecated use Array.ofDim instead */
- @deprecated def this(dim1: Int, dim2: Int, dim3: Int) = {
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim' instead")
+ def this(dim1: Int, dim2: Int, dim3: Int) = {
this(dim1)
throw new Error()
}
- /** Multidimensional array creation
- * @deprecated use Array.ofDim instead */
- @deprecated def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int) = {
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim' instead")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int) = {
this(dim1)
throw new Error()
}
- /** Multidimensional array creation
- * @deprecated use Array.ofDim instead */
- @deprecated def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int) = {
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim' instead")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int) = {
this(dim1);
throw new Error()
}
- /** Multidimensional array creation
- * @deprecated use Array.ofDim instead */
- @deprecated def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int) = {
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim' instead")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int) = {
this(dim1)
throw new Error()
}
- /** Multidimensional array creation
- * @deprecated use Array.ofDim instead */
- @deprecated def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int) = {
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim' instead")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int) = {
this(dim1)
throw new Error()
}
- /** Multidimensional array creation
- * @deprecated use Array.ofDim instead */
- @deprecated def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int) = {
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim' instead")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int) = {
this(dim1)
throw new Error()
}
- /** Multidimensional array creation
- * @deprecated use Array.ofDim instead */
- @deprecated def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int, dim9: Int) = {
+ /** Multidimensional array creation */
+ @deprecated("use `Array.ofDim' instead")
+ def this(dim1: Int, dim2: Int, dim3: Int, dim4: Int, dim5: Int, dim6: Int, dim7: Int, dim8: Int, dim9: Int) = {
this(dim1)
throw new Error()
}
@@ -400,6 +398,6 @@ final class Array[A](_length: Int) extends Vector[A]
*/
def deepEquals(that: Any): Boolean = throw new Error()
- /** @deprecated use slice instead */
- @deprecated def subArray(from: Int, end: Int): Array[A] = throw new Error()
+ @deprecated("use `slice' instead")
+ def subArray(from: Int, end: Int): Array[A] = throw new Error()
}
diff --git a/src/library/scala/Attribute.scala b/src/library/scala/Attribute.scala
deleted file mode 100644
index 1d4d1a6c60..0000000000
--- a/src/library/scala/Attribute.scala
+++ /dev/null
@@ -1,22 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2006-2009, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-// $Id$
-
-
-package scala
-
-/** <p>
- * </p>
- *
- * @deprecated use Annotation instead
- * @author Martin Odersky
- * @version 1.1, 2/02/2007
- */
-@deprecated
-abstract class Attribute {}
diff --git a/src/library/scala/ClassfileAnnotation.scala b/src/library/scala/ClassfileAnnotation.scala
index 62a9bea663..8bf1fffcf6 100644
--- a/src/library/scala/ClassfileAnnotation.scala
+++ b/src/library/scala/ClassfileAnnotation.scala
@@ -20,4 +20,4 @@ package scala
* @author Martin Odersky
* @version 1.1, 2/02/2007
*/
-trait ClassfileAnnotation extends Annotation
+trait ClassfileAnnotation extends StaticAnnotation
diff --git a/src/library/scala/ClassfileAttribute.scala b/src/library/scala/ClassfileAttribute.scala
deleted file mode 100644
index ae71060e9d..0000000000
--- a/src/library/scala/ClassfileAttribute.scala
+++ /dev/null
@@ -1,26 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2006-2009, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-// $Id$
-
-
-package scala
-
-/** <p>
- * A base class for classfile attributes. These are stored as
- * <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html"
- * target="_top">Java annotations</a> in classfiles.
- * </p>
- *
- * @deprecated use <a href="ClassfileAnnotation.html"
- * target="contentFrame">ClassfileAnnotation</a> instead
- * @author Martin Odersky
- * @version 1.1, 2/02/2007
- */
-@deprecated
-trait ClassfileAttribute extends Attribute {}
diff --git a/src/library/scala/Console.scala b/src/library/scala/Console.scala
index 31672ac8e6..bbef8aa3ce 100644
--- a/src/library/scala/Console.scala
+++ b/src/library/scala/Console.scala
@@ -182,10 +182,9 @@ object Console {
/**
* @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> formatting,
- * <code>RichString</code>'s <code>format</code> method.
*/
- @deprecated
+ @deprecated("For console output, use <code>Console.printf</code>. For <code>String</code>\n"+
+ "formatting, <code>RichString</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 : _*))
diff --git a/src/library/scala/CountedIterator.scala b/src/library/scala/CountedIterator.scala
index 490743d733..2b627437dc 100644
--- a/src/library/scala/CountedIterator.scala
+++ b/src/library/scala/CountedIterator.scala
@@ -12,9 +12,9 @@
package scala
/** Counted iterators keep track of the number of elements seen so far
- * @deprecated use iterator.zipWithIndex instead
*/
-@deprecated trait CountedIterator[+A] extends Iterator[A] {
+@deprecated("use iterator.zipWithIndex instead")
+trait CountedIterator[+A] extends Iterator[A] {
/** counts the elements in this iterator; counts start at 0
*/
def count: Int
diff --git a/src/library/scala/Either.scala b/src/library/scala/Either.scala
index 9fbb4b71ba..fc2d598f41 100644
--- a/src/library/scala/Either.scala
+++ b/src/library/scala/Either.scala
@@ -68,10 +68,8 @@ object Either {
/**
* Returns the <code>Left</code> values in the given <code>Iterable</code> of <code>Either</code>s.
- *
- * @deprecated use `for (Left(a) <- es) yield a`
- *
*/
+ @deprecated("use `for (Left(a) <- es) yield a'")
def lefts[A, B](es: Iterable[Either[A, B]]) =
es.foldRight[List[A]](Nil)((e, as) => e match {
case Left(a) => a :: as
@@ -80,9 +78,8 @@ object Either {
/**
* Returns the <code>Right</code> values in the given<code>Iterable</code> of <code>Either</code>s.
- *
- * @deprecated use `for (Right(a) <- es) yield a`
*/
+ @deprecated("use `for (Right(a) <- es) yield a'")
def rights[A, B](es: Iterable[Either[A, B]]) =
es.foldRight[List[B]](Nil)((e, bs) => e match {
case Left(_) => bs
@@ -93,9 +90,8 @@ object Either {
*
* @param xs the iterable of Eithers to separate
* @return a pair of lists.
- *
- * @deprecated use `for ((Left(l), Right(r)) <- es partition isLeft) yield (l, r)`
*/
+ @deprecated("use `for ((Left(l), Right(r)) <- es partition isLeft) yield (l, r)'")
def separate[A,B](es: Iterable[Either[A,B]]): (List[A], List[B]) =
es.foldRight[(List[A], List[B])]((Nil, Nil)) {
case (Left(a), (lefts, rights)) => (a :: lefts, rights)
diff --git a/src/library/scala/Enumeration.scala b/src/library/scala/Enumeration.scala
index e5800a209e..f3a6b2f68c 100644
--- a/src/library/scala/Enumeration.scala
+++ b/src/library/scala/Enumeration.scala
@@ -167,7 +167,6 @@ abstract class Enumeration(initial: Int, names: String*) {
/** this enumeration value as an <code>Int</code> bit mask.
* @throws IllegalArgumentException if <code>id</code> is greater than 31
- * @deprecated
*/
@deprecated def mask32: Int = {
if (id >= 32) throw new IllegalArgumentException
@@ -175,7 +174,6 @@ abstract class Enumeration(initial: Int, names: String*) {
}
/** this enumeration value as an <code>Long</code> bit mask.
* @throws IllegalArgumentException if <code>id</code> is greater than 63
- * @deprecated
*/
@deprecated def mask64: Long = {
if (id >= 64) throw new IllegalArgumentException
@@ -239,52 +237,47 @@ abstract class Enumeration(initial: Int, names: String*) {
implicit def builderFactory: BuilderFactory[Value, ValueSet, ValueSet] = new BuilderFactory[Value, ValueSet, ValueSet] { def apply(from: ValueSet) = newBuilder }
}
- /** The name of this enumeration.
- * @deprecated use toString instead
- */
- @deprecated def name = toString
+ /** The name of this enumeration. */
+ @deprecated("use toString instead") def name = toString
- /** @deprecated use withName instead
- */
- @deprecated def valueOf(s: String) = values.find(_.toString == s)
+ @deprecated("use withName instead")
+ def valueOf(s: String) = values.find(_.toString == s)
- /** A new iterator over all values of this enumeration.
- * @deprecated use values.iterator instead
- */
- @deprecated final def iterator: Iterator[Value] = values.iterator
+ /** A new iterator over all values of this enumeration. */
+ @deprecated("use values.iterator instead")
+ final def iterator: Iterator[Value] = values.iterator
- /** Apply a function f to all values of this enumeration.
- * @deprecated use values.foreach instead
- */
- @deprecated def foreach(f: Value => Unit): Unit = this.iterator foreach f
+ /** Apply a function f to all values of this enumeration. */
+ @deprecated("use values.foreach instead")
+ def foreach(f: Value => Unit): Unit = this.iterator foreach f
/** Apply a predicate p to all values of this enumeration and return
* true, iff the predicate yields true for all values.
- * @deprecated use values.forall instead
*/
- @deprecated def forall(p: Value => Boolean): Boolean = this.iterator forall p
+ @deprecated("use values.forall instead")
+ def forall(p: Value => Boolean): Boolean = this.iterator forall p
/** Apply a predicate p to all values of this enumeration and return
* true, iff there is at least one value for which p yields true.
- * @deprecated use values.exists instead
*/
- @deprecated def exists(p: Value => Boolean): Boolean = this.iterator exists p
+ @deprecated("use values.exists instead")
+ def exists(p: Value => Boolean): Boolean = this.iterator exists p
/** Returns an iterator resulting from applying the given function f to each
* value of this enumeration.
- * @deprecated use values.map instead
*/
- @deprecated def map[B](f: Value => B): Iterator[B] = this.iterator map f
+ @deprecated("use values.map instead")
+ def map[B](f: Value => B): Iterator[B] = this.iterator map f
/** Applies the given function f to each value of this enumeration, then
* concatenates the results.
- * @deprecated use values.flatMap instead
*/
- @deprecated def flatMap[B](f: Value => Iterator[B]): Iterator[B] = this.iterator flatMap f
+ @deprecated("use values.flatMap instead")
+ def flatMap[B](f: Value => Iterator[B]): Iterator[B] = this.iterator flatMap f
/** Returns all values of this enumeration that satisfy the predicate p.
* The order of values is preserved.
- * @deprecated use values.filter instead
*/
- @deprecated def filter(p: Value => Boolean): Iterator[Value] = this.iterator filter p
+ @deprecated("use values.filter instead")
+ def filter(p: Value => Boolean): Iterator[Value] = this.iterator filter p
}
diff --git a/src/library/scala/Option.scala b/src/library/scala/Option.scala
index f6cbd94748..263c9dec37 100644
--- a/src/library/scala/Option.scala
+++ b/src/library/scala/Option.scala
@@ -44,9 +44,7 @@ sealed abstract class Option[+A] extends Product {
*/
def get: A
- /** @deprecated; use <code>getOrElse</code> instead
- */
- @deprecated
+ @deprecated("use <code>getOrElse</code> instead")
def get[B >: A](default: B): B = this match {
case None => default
case Some(x) => x
diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala
index da4e51e2aa..49af94b716 100644
--- a/src/library/scala/Predef.scala
+++ b/src/library/scala/Predef.scala
@@ -25,20 +25,20 @@ object Predef {
// aliases ------------------------------------------------------------
- @deprecated type byte = scala.Byte
- @deprecated type short = scala.Short
- @deprecated type char = scala.Char
- @deprecated type int = scala.Int
- @deprecated type long = scala.Long
- @deprecated type float = scala.Float
- @deprecated type double = scala.Double
- @deprecated type boolean = scala.Boolean
- @deprecated type unit = scala.Unit
-
- /** @deprecated use <code>java.lang.Integer</code> instead */
- @deprecated type Integer = java.lang.Integer
- /** @deprecated use <code>java.lang.Character</code> instead */
- @deprecated type Character = java.lang.Character
+ @deprecated("lower-case type aliases will be removed") type byte = scala.Byte
+ @deprecated("lower-case type aliases will be removed") type short = scala.Short
+ @deprecated("lower-case type aliases will be removed") type char = scala.Char
+ @deprecated("lower-case type aliases will be removed") type int = scala.Int
+ @deprecated("lower-case type aliases will be removed") type long = scala.Long
+ @deprecated("lower-case type aliases will be removed") type float = scala.Float
+ @deprecated("lower-case type aliases will be removed") type double = scala.Double
+ @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]
diff --git a/src/library/scala/Product.scala b/src/library/scala/Product.scala
index b9a60e4c95..2e0a0b2816 100644
--- a/src/library/scala/Product.scala
+++ b/src/library/scala/Product.scala
@@ -39,9 +39,8 @@ trait Product extends AnyRef {
def next() = { val result = productElement(c); c += 1; result }
}
- /** @deprecated use productIterator instead
- */
- @deprecated def productElements: Iterator[Any] = productIterator
+ @deprecated("use productIterator instead")
+ def productElements: Iterator[Any] = productIterator
/**
* By default the empty string. Implementations may override this
diff --git a/src/library/scala/Range.scala b/src/library/scala/Range.scala
index 3be4dfb4ed..4f21bc36dc 100644
--- a/src/library/scala/Range.scala
+++ b/src/library/scala/Range.scala
@@ -200,7 +200,7 @@ extends VectorView[Int, Vector[Int]] with RangeToString[Int]
}
object Range {
- /** @deprecated use Range.inclusive instead */
+ @deprecated("use Range.inclusive instead")
final class Inclusive(start: Int, end0: Int, step: Int)
extends Range(start, if (step > 0) end0 + 1 else end0 - 1, step) { self =>
override def by(step: Int): Range = new Inclusive(start, end0, step)
diff --git a/src/library/scala/StaticAttribute.scala b/src/library/scala/StaticAttribute.scala
deleted file mode 100644
index e9e11a01c7..0000000000
--- a/src/library/scala/StaticAttribute.scala
+++ /dev/null
@@ -1,25 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2006-2009, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-// $Id$
-
-
-package scala
-
-/** <p>
- * A base class for static attributes. These are available
- * to the Scala type checker, even across different compilation units.
- * </p>
- *
- * @deprecated use <a href="StaticAnnotation.html"
- * target="contentFrame">StaticAnnotation</a> instead
- * @author Martin Odersky
- * @version 1.1, 2/02/2007
- */
-@deprecated
-trait StaticAttribute extends Attribute {}
diff --git a/src/library/scala/collection/Iterable.scala b/src/library/scala/collection/Iterable.scala
index 179ff99d92..3e886f6d5e 100644
--- a/src/library/scala/collection/Iterable.scala
+++ b/src/library/scala/collection/Iterable.scala
@@ -54,10 +54,9 @@ object Iterable extends TraversableFactory[Iterable] {
implicit def builderFactory[A]: BuilderFactory[A, Iterable[A], Coll] = new VirtualBuilderFactory[A]
def newBuilder[A]: Builder[A, Iterable[A]] = immutable.Iterable.newBuilder[A]
- /** The minimum element of a non-empty sequence of ordered elements
- * @deprecated use seq.min instead
- */
- @deprecated def min[A <% Ordered[A]](seq: Iterable[A]): A = {
+ /** The minimum element of a non-empty sequence of ordered elements */
+ @deprecated("use seq.min instead")
+ def min[A <% Ordered[A]](seq: Iterable[A]): A = {
val xs = seq.iterator
if (!xs.hasNext) throw new IllegalArgumentException("min(<empty>)")
var min = xs.next
@@ -68,10 +67,9 @@ object Iterable extends TraversableFactory[Iterable] {
min
}
- /** The maximum element of a non-empty sequence of ordered elements
- * @deprecated use seq.max iConstead
- */
- @deprecated def max[A <% Ordered[A]](seq: Iterable[A]): A = {
+ /** The maximum element of a non-empty sequence of ordered elements */
+ @deprecated("use seq.max iConstead")
+ def max[A <% Ordered[A]](seq: Iterable[A]): A = {
val xs = seq.iterator
if (!xs.hasNext) throw new IllegalArgumentException("max(<empty>)")
var max = xs.next
@@ -82,7 +80,5 @@ object Iterable extends TraversableFactory[Iterable] {
max
}
- /** @deprecated use View instead
- */
- @deprecated type Projection[A] = IterableView[A, Coll]
+ @deprecated("use View instead") type Projection[A] = IterableView[A, Coll]
}
diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala
index 5ebe0df11e..9e8cb67a65 100644
--- a/src/library/scala/collection/Iterator.scala
+++ b/src/library/scala/collection/Iterator.scala
@@ -165,16 +165,15 @@ object Iterator {
implicit def iteratorIteratorWrapper[A](its: Iterator[Iterator[A]]): IteratorIteratorOps[A] =
new IteratorIteratorOps[A](its)
- /** @deprecated use `xs.iterator` or `Iterator(xs)` instead
- */
- @deprecated def fromValues[a](xs: a*) = xs.iterator
+ @deprecated("use `xs.iterator' or `Iterator(xs)' instead")
+ def fromValues[a](xs: a*) = xs.iterator
/**
* @param xs the array of elements
* @see also: Vector.iterator and slice
- * @deprecated use `xs.iterator` instead
*/
- @deprecated def fromArray[a](xs: Array[a]): Iterator[a] =
+ @deprecated("use `xs.iterator' instead")
+ def fromArray[a](xs: Array[a]): Iterator[a] =
fromArray(xs, 0, xs.length)
/**
@@ -182,24 +181,24 @@ object Iterator {
* @param start the start index
* @param length the length
* @see also: Vector.iterator and slice
- * @deprecated use `xs.slice(start, start + length).iterator` instead
*/
- @deprecated def fromArray[a](xs: Array[a], start: Int, length: Int): Iterator[a] =
+ @deprecated("use `xs.slice(start, start + length).iterator' instead")
+ def fromArray[a](xs: Array[a], start: Int, length: Int): Iterator[a] =
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>
*/
- @deprecated def fromString(str: String): Iterator[Char] = str.iterator
+ @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&lt;n&gt;</code>.
- * @deprecated use product.productIterator instead
*/
- @deprecated def fromProduct(n: Product): Iterator[Any] = new Iterator[Any] {
+ @deprecated("use product.productIterator instead")
+ def fromProduct(n: Product): Iterator[Any] = new Iterator[Any] {
private var c: Int = 0
private val cmax = n.productArity
def hasNext = c < cmax
@@ -216,9 +215,9 @@ object Iterator {
* @param end the end value of the iterator
* @param step the increment function of the iterator, must be monotonically increasing or decreasing
* @return the iterator with values in range <code>[start;end)</code>.
- * @deprecated use Iterator.iterate(start, end - start)(step) instead
*/
- @deprecated def range(start: Int, end: Int, step: Int => Int) = new Iterator[Int] {
+ @deprecated("use Iterator.iterate(start, end - start)(step) instead")
+ def range(start: Int, end: Int, step: Int => Int) = new Iterator[Int] {
private val up = step(start) > start
private val down = step(start) < start
private var i = start
@@ -235,9 +234,9 @@ object Iterator {
* @param start the start value of the iterator
* @param step the increment function of the iterator
* @return the iterator starting at value <code>start</code>.
- * @deprecated use iterate(start)(step) instead
*/
- @deprecated def from(start: Int, step: Int => Int): Iterator[Int] = new Iterator[Int] {
+ @deprecated("use iterate(start)(step) instead")
+ def from(start: Int, step: Int => Int): Iterator[Int] = new Iterator[Int] {
private var i = start
override def hasNext: Boolean = true
def next(): Int = { val j = i; i = step(i); j }
@@ -247,9 +246,9 @@ object Iterator {
* returned by a given iterator of iterators.
* @param its The iterator which returns on each call to next
* a new iterator whose elements are to be concatenated to the result.
- * @deprecated use its.flatten instead
*/
- @deprecated def flatten[T](its: Iterator[Iterator[T]]): Iterator[T] = new Iterator[T] {
+ @deprecated("use its.flatten instead")
+ def flatten[T](its: Iterator[Iterator[T]]): Iterator[T] = new Iterator[T] {
private var cur = its.next
def hasNext: Boolean = {
while (!cur.hasNext && its.hasNext) cur = its.next
@@ -902,30 +901,28 @@ trait Iterator[+A] { self =>
/** Returns a new iterator that first yields the elements of this
* iterator followed by the elements provided by iterator <code>that</code>.
- * @deprecated use <code>++</code>
*/
- @deprecated def append[B >: A](that: Iterator[B]) = new Iterator[B] {
+ @deprecated("use <code>++</code>")
+ def append[B >: A](that: Iterator[B]) = new Iterator[B] {
def hasNext = self.hasNext || that.hasNext
def next() = (if (self.hasNext) self else that).next()
}
- /** Returns index of the first element satisfying a predicate, or -1.
- *
- * @deprecated use `indexWhere` instead
- */
- @deprecated def findIndexOf(p: A => Boolean): Int = indexWhere(p)
+ /** Returns index of the first element satisfying a predicate, or -1. */
+ @deprecated("use `indexWhere` instead")
+ def findIndexOf(p: A => Boolean): Int = indexWhere(p)
/** Collect elements into a seq.
*
* @return a sequence which enumerates all elements of this iterator.
- * @deprecated use toSequence instead
*/
- @deprecated def collect: Sequence[A] = toSequence
+ @deprecated("use toSequence instead")
+ def collect: Sequence[A] = toSequence
/** Returns a counted iterator from this iterator.
- * @deprecated use @see zipWithIndex in Iterator
*/
- @deprecated def counted = new CountedIterator[A] {
+ @deprecated("use zipWithIndex in Iterator")
+ def counted = new CountedIterator[A] {
private var cnt = 0
def count = cnt
def hasNext: Boolean = self.hasNext
@@ -940,19 +937,21 @@ trait Iterator[+A] { self =>
* @param start the starting index.
* @param sz the maximum number of elements to be read.
* @pre the array must be large enough to hold <code>sz</code> elements.
- * @deprecated use copyToArray instead
*/
- @deprecated def readInto[B >: A](xs: Array[B], start: Int, sz: Int) {
+ @deprecated("use copyToArray instead")
+ def readInto[B >: A](xs: Array[B], start: Int, sz: Int) {
var i = start
while (hasNext && i - start < sz) {
xs(i) = next
i += 1
}
}
- @deprecated def readInto[B >: A](xs: Array[B], start: Int) {
+ @deprecated("use copyToArray instead")
+ def readInto[B >: A](xs: Array[B], start: Int) {
readInto(xs, start, xs.length - start)
}
- @deprecated def readInto[B >: A](xs: Array[B]) {
+ @deprecated("use copyToArray instead")
+ def readInto[B >: A](xs: Array[B]) {
readInto(xs, 0, xs.length)
}
}
diff --git a/src/library/scala/collection/Sequence.scala b/src/library/scala/collection/Sequence.scala
index 8abfdc3334..04411c8db3 100644
--- a/src/library/scala/collection/Sequence.scala
+++ b/src/library/scala/collection/Sequence.scala
@@ -40,17 +40,13 @@ object Sequence extends SequenceFactory[Sequence] {
implicit def builderFactory[A]: BuilderFactory[A, Sequence[A], Coll] = new VirtualBuilderFactory[A]
def newBuilder[A]: Builder[A, Sequence[A]] = immutable.Sequence.newBuilder[A]
- /** @deprecated use View instead
- */
- @deprecated type Projection[A] = SequenceView[A, Coll]
-
- /** @deprecated use Sequence(value) instead */
- @deprecated def singleton[A](value: A) = Sequence(value)
-
- /** Builds a singleton sequence.
- *
- * @deprecated use <code>Sequence(x)</code> instead.
- */
- @deprecated def single[A](x: A) = singleton(x)
+ @deprecated("use View instead") type Projection[A] = SequenceView[A, Coll]
+
+ @deprecated("use Sequence(value) instead")
+ def singleton[A](value: A) = Sequence(value)
+
+ /** Builds a singleton sequence. */
+ @deprecated("use <code>Sequence(x)</code> instead.")
+ def single[A](x: A) = singleton(x)
}
diff --git a/src/library/scala/collection/generic/BufferTemplate.scala b/src/library/scala/collection/generic/BufferTemplate.scala
index 53d74a2d45..65c6631fbd 100644
--- a/src/library/scala/collection/generic/BufferTemplate.scala
+++ b/src/library/scala/collection/generic/BufferTemplate.scala
@@ -222,9 +222,9 @@ trait BufferTemplate[A, +This <: BufferTemplate[A, This] with Buffer[A]]
* @param src the array
* @param start the first element to append
* @param len the number of elements to append
- * @deprecated replace by: <code>buf ++= src.view(start, end)</code>
*/
- @deprecated def ++=(src: Array[A], start: Int, len: Int) {
+ @deprecated("replace by: <code>buf ++= src.view(start, end)</code>")
+ def ++=(src: Array[A], start: Int, len: Int) {
var i = start
val end = i + len
while (i < end) {
@@ -237,10 +237,10 @@ trait BufferTemplate[A, +This <: BufferTemplate[A, This] with Buffer[A]]
* the collection itself.
*
* @param elem the element to add.
- * @deprecated use += instead if you intend to add by side effect to an existing collection.
- * Use `clone() ++=` if you intend to create a new collection.
*/
- @deprecated override def + (elem: A): This = { +=(elem); thisCollection }
+ @deprecated("Use += instead if you intend to add by side effect to an existing collection.\n"+
+ "Use `clone() ++=' if you intend to create a new collection.")
+ override def + (elem: A): This = { +=(elem); thisCollection }
/** Adds two or more elements to this collection and returns
* the collection itself.
@@ -248,10 +248,10 @@ trait BufferTemplate[A, +This <: BufferTemplate[A, This] with Buffer[A]]
* @param elem1 the first element to add.
* @param elem2 the second element to add.
* @param elems the remaining elements to add.
- * @deprecated use += instead if you intend to add by side effect to an existing collection.
- * Use `clone() ++=` if you intend to create a new collection.
*/
- @deprecated override def + (elem1: A, elem2: A, elems: A*): This = {
+ @deprecated("Use += instead if you intend to add by side effect to an existing collection.\n"+
+ "Use `clone() ++=' if you intend to create a new collection.")
+ override def + (elem1: A, elem2: A, elems: A*): This = {
this += elem1 += elem2 ++= elems
thisCollection
}
@@ -260,10 +260,10 @@ trait BufferTemplate[A, +This <: BufferTemplate[A, This] with Buffer[A]]
* either the collection itself.
*
* @param iter the iterable object.
- * @deprecated use ++= instead if you intend to add by side effect to an existing collection.
- * Use `clone() ++=` if you intend to create a new collection.
*/
- @deprecated override def ++(iter: Traversable[A]): This = {
+ @deprecated("Use ++= instead if you intend to add by side effect to an existing collection.\n"+
+ "Use `clone() ++=` if you intend to create a new collection.")
+ override def ++(iter: Traversable[A]): This = {
for (elem <- iter) +=(elem)
thisCollection
}
@@ -272,10 +272,10 @@ trait BufferTemplate[A, +This <: BufferTemplate[A, This] with Buffer[A]]
* the collection itself.
*
* @param iter the iterator
- * @deprecated use ++= instead if you intend to add by side effect to an existing collection.
- * Use `clone() ++=` if you intend to create a new collection.
*/
- @deprecated override def ++ (iter: Iterator[A]): This = {
+ @deprecated("Use ++= instead if you intend to add by side effect to an existing collection.\n"+
+ "Use `clone() ++=` if you intend to create a new collection.")
+ override def ++ (iter: Iterator[A]): This = {
for (elem <- iter) +=(elem)
thisCollection
}
@@ -284,10 +284,10 @@ trait BufferTemplate[A, +This <: BufferTemplate[A, This] with Buffer[A]]
* the collection itself.
*
* @param elem the element to remove.
- * @deprecated use -= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() -=` if you intend to create a new collection.
*/
- @deprecated override def -(elem: A): This = { -=(elem); thisCollection }
+ @deprecated("Use -= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() -=` if you intend to create a new collection.")
+ override def -(elem: A): This = { -=(elem); thisCollection }
/** Removes two or more elements from this collection and returns
* the collection itself.
@@ -295,22 +295,22 @@ trait BufferTemplate[A, +This <: BufferTemplate[A, This] with Buffer[A]]
* @param elem1 the first element to remove.
* @param elem2 the second element to remove.
* @param elems the remaining elements to remove.
- * @deprecated use -= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() -=` if you intend to create a new collection.
*/
- @deprecated override def -(elem1: A, elem2: A, elems: A*): This = {
+ @deprecated("Use -= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() -=` if you intend to create a new collection.")
+ override def -(elem1: A, elem2: A, elems: A*): This = {
this -= elem1 -= elem2 --= elems
thisCollection
}
/** Removes a number of elements provided by a traversible object and returns
* the collection itself.
- * @deprecated use --= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() --=` if you intend to create a new collection.
*
* @param iter the iterable object.
*/
- @deprecated override def --(iter: Traversable[A]): This = {
+ @deprecated("Use --= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() --=` if you intend to create a new collection.")
+ override def --(iter: Traversable[A]): This = {
for (elem <- iter) -=(elem)
thisCollection
}
@@ -319,10 +319,10 @@ trait BufferTemplate[A, +This <: BufferTemplate[A, This] with Buffer[A]]
* the collection itself.
*
* @param iter the iterator
- * @deprecated use --= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() --=` if you intend to create a new collection.
*/
- @deprecated override def --(iter: Iterator[A]): This = {
+ @deprecated("Use --= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() --=` if you intend to create a new collection.")
+ override def --(iter: Iterator[A]): This = {
for (elem <- iter) -=(elem)
thisCollection
}
diff --git a/src/library/scala/collection/generic/ImmutableMapTemplate.scala b/src/library/scala/collection/generic/ImmutableMapTemplate.scala
index 6c5331689e..7a8c79ca41 100644
--- a/src/library/scala/collection/generic/ImmutableMapTemplate.scala
+++ b/src/library/scala/collection/generic/ImmutableMapTemplate.scala
@@ -97,6 +97,6 @@ self =>
res
}
- /** @deprecated use updated instead */
- @deprecated def update[B1 >: B](key: A, value: B1): immutable.Map[A, B1] = updated(key, value).asInstanceOf[immutable.Map[A, B1]]
+ @deprecated("use `updated' instead")
+ def update[B1 >: B](key: A, value: B1): immutable.Map[A, B1] = updated(key, value).asInstanceOf[immutable.Map[A, B1]]
}
diff --git a/src/library/scala/collection/generic/IterableTemplate.scala b/src/library/scala/collection/generic/IterableTemplate.scala
index d5e6fb2523..fa7a2529fc 100644
--- a/src/library/scala/collection/generic/IterableTemplate.scala
+++ b/src/library/scala/collection/generic/IterableTemplate.scala
@@ -39,7 +39,8 @@ trait IterableTemplate[+A, +This <: IterableTemplate[A, This] with Iterable[A]]
*/
def iterator: Iterator[A]
- @deprecated def elements = iterator
+ @deprecated("use `iterator' instead")
+ def elements = iterator
/** Apply a function <code>f</code> to all elements of this
* traversable object.
@@ -177,23 +178,17 @@ trait IterableTemplate[+A, +This <: IterableTemplate[A, This] with Iterable[A]]
*/
override def view(from: Int, until: Int) = view.slice(from, until)
- /** @deprecated use head instead */
- @deprecated def first: A = head
+ @deprecated("use `updated' instead") def first: A = head
- /** @deprecated use headOption instead
- * <code>None</code> if traversable is empty.
- */
- @deprecated def firstOption: Option[A] = headOption
+ /** <code>None</code> if traversable is empty. */
+ @deprecated("use `updated' instead") def firstOption: Option[A] = headOption
- /** @deprecated use toSequence instead
- */
- @deprecated def toSeq: Sequence[A] = toSequence
+ @deprecated("use `toSequence' instead") def toSeq: Sequence[A] = toSequence
/**
* returns a projection that can be used to call non-strict <code>filter</code>,
* <code>map</code>, and <code>flatMap</code> methods that build projections
* of the collection.
- * @deprecated use view instead
*/
- @deprecated def projection = view
+ @deprecated("use `view' instead") def projection = view
}
diff --git a/src/library/scala/collection/generic/MapTemplate.scala b/src/library/scala/collection/generic/MapTemplate.scala
index 74130cb487..8c1112f6bc 100644
--- a/src/library/scala/collection/generic/MapTemplate.scala
+++ b/src/library/scala/collection/generic/MapTemplate.scala
@@ -124,11 +124,8 @@ self =>
override def foreach[B](f: A => B) = for ((k, v) <- self) f(k)
}
- /** @deprecated use `keys` instead
- *
- * @return the keys of this map as a set.
- */
- @deprecated def keySet: collection.Set[A] = new DefaultKeySet
+ /** @return the keys of this map as a set. */
+ @deprecated("use `keys' instead") def keySet: collection.Set[A] = new DefaultKeySet
/** Creates an iterator for all keys.
*
@@ -187,9 +184,7 @@ self =>
def get(key: A) = self.get(key).map(f)
}
- /** @deprecated use mapValues instead
- */
- @deprecated def mapElements[C](f: B => C) = mapValues(f)
+ @deprecated("use `mapValues' instead") def mapElements[C](f: B => C) = mapValues(f)
// The following 5 operations (updated, two times +, two times ++) should really be
// generic, returning This[B]. We need better covariance support to express that though.
diff --git a/src/library/scala/collection/generic/MutableMapTemplate.scala b/src/library/scala/collection/generic/MutableMapTemplate.scala
index 6d6d05a119..9290986dfd 100644
--- a/src/library/scala/collection/generic/MutableMapTemplate.scala
+++ b/src/library/scala/collection/generic/MutableMapTemplate.scala
@@ -82,12 +82,11 @@ trait MutableMapTemplate[A, B, +This <: MutableMapTemplate[A, B, This] with muta
/** Add a new key/value mapping and return the map itself.
*
* @param kv the key/value mapping to be added
- * @deprecated This operation will create a new map in the future. To add
- * an element as a side effect to an existing map and return
- * that map itself, use +=. If you do want to create a fresh map,
- * you can use `clone() +=` to avoid a @deprecated warning.
*/
- @deprecated def + (kv: (A, B)): this.type = { update(kv._1, kv._2); this }
+ @deprecated("This operation will create a new map in the future. To add an element as a side\n"+
+ "effect to an existing map and return that map itself, use +=. If you do want\n"+
+ "to create a fresh map, you can use `clone() +=' to avoid a @deprecated warning.")
+ def + (kv: (A, B)): this.type = { update(kv._1, kv._2); this }
/** Adds two or more key/value mappings and return the map itself.
* with the added elements.
@@ -95,37 +94,35 @@ trait MutableMapTemplate[A, B, +This <: MutableMapTemplate[A, B, This] with muta
* @param elem1 the first element to add.
* @param elem2 the second element to add.
* @param elems the remaining elements to add.
- * @deprecated This operation will create a new map in the future. To add
- * an element as a side effect to an existing map and return
- * that map itself, use +=. If you do want to create a fresh map,
- * you can use `clone() +=` to avoid a @deprecated warning.
*/
- @deprecated def +(elem1: (A, B), elem2: (A, B), elems: (A, B)*): this.type =
+ @deprecated("This operation will create a new map in the future. To add an element as a side\n"+
+ "effect to an existing map and return that map itself, use +=. If you do want to\n"+
+ "create a fresh map, you can use `clone() +=` to avoid a @deprecated warning.")
+ def +(elem1: (A, B), elem2: (A, B), elems: (A, B)*): this.type =
this += elem1 += elem2 ++= elems
/** Adds a number of elements provided by a traversable object
* via its <code>iterator</code> method and returns
* either the collection itself (if it is mutable), or a new collection
* with the added elements.
- * @deprecated This operation will create a new map in the future. To add
- * elements as a side effect to an existing map and return
- * that map itself, use ++=. If you do want to create a fresh map,
- * you can use `clone() ++=` to avoid a @deprecated warning.
+ *
* @param iter the traversable object.
*/
- @deprecated def ++(iter: Traversable[(A, B)]): this.type = { for (elem <- iter) +=(elem); this }
+ @deprecated("This operation will create a new map in the future. To add elements as a side\n"+
+ "effect to an existing map and return that map itself, use ++=. If you do want\n"+
+ "to create a fresh map, you can use `clone() ++=` to avoid a @deprecated warning.")
+ def ++(iter: Traversable[(A, B)]): this.type = { for (elem <- iter) +=(elem); this }
/** Adds a number of elements provided by an iterator
* via its <code>iterator</code> method and returns
* the collection itself.
- * @deprecated This operation will create a new map in the future. To add
- * elements as a side effect to an existing map and return
- * that map itself, use ++=. If you do want to create a fresh map,
- * you can use `clone() +=` to avoid a @deprecated warning.
*
* @param iter the iterator
*/
- @deprecated def ++(iter: Iterator[(A, B)]): this.type = { for (elem <- iter) +=(elem); this }
+ @deprecated("This operation will create a new map in the future. To add elements as a side\n"+
+ "effect to an existing map and return that map itself, use ++=. If you do want\n"+
+ "to create a fresh map, you can use `clone() +=` to avoid a @deprecated warning.")
+ def ++(iter: Iterator[(A, B)]): this.type = { for (elem <- iter) +=(elem); this }
/** If given key is defined in this map, remove it and return associated value as an Option.
* If key is not present return None.
@@ -145,19 +142,17 @@ trait MutableMapTemplate[A, B, +This <: MutableMapTemplate[A, B, This] with muta
/** Delete a key from this map if it is present and return the map itself.
* @param key the key to be removed
- * @deprecated This operation will create a new map in the future. To add
- * elements as a side effect to an existing map and return
- * that map itself, use -=. If you do want to create a fresh map,
- * you can use `clone() -=` to avoid a @deprecated warning.
*/
- @deprecated override def -(key: A): This = { -=(key); thisCollection }
+ @deprecated("This operation will create a new map in the future. To add elements as a side\n"+
+ "effect to an existing map and return that map itself, use -=. If you do want\n"+
+ "to create a fresh map, you can use `clone() -=` to avoid a @deprecated warning.")
+ override def -(key: A): This = { -=(key); thisCollection }
/** If given key is defined in this map, remove it and return associated value as an Option.
* If key is not present return None.
* @param key the key to be removed
- * @deprecated Use `remove` instead.
*/
- @deprecated def removeKey(key: A): Option[B] = remove(key)
+ @deprecated("Use `remove' instead") def removeKey(key: A): Option[B] = remove(key)
/** Removes all elements from the set. After this operation is completed,
@@ -191,8 +186,8 @@ trait MutableMapTemplate[A, B, +This <: MutableMapTemplate[A, B, This] with muta
* <code>p</code> returns <code>true</code>.
*
* @param p The test predicate
- * @deprecated cannot be type inferred because of retain in Iterable.
*/
+ @deprecated("cannot be type inferred because of retain in Iterable.")
def retain(p: (A, B) => Boolean): this.type = {
for ((k, v) <- this) if (!p(k, v)) -=(k)
this
@@ -213,22 +208,22 @@ trait MutableMapTemplate[A, B, +This <: MutableMapTemplate[A, B, This] with muta
* @param elem1 the first element to remove.
* @param elem2 the second element to remove.
* @param elems the remaining elements to remove.
- * @deprecated use -= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() -=` if you intend to create a new collection.
*/
- @deprecated override def -(elem1: A, elem2: A, elems: A*): This = {
+ @deprecated("Use -= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() -=' if you intend to create a new collection.")
+ override def -(elem1: A, elem2: A, elems: A*): This = {
this -= elem1 -= elem2 --= elems
thisCollection
}
/** Removes a number of elements provided by a traversible object and returns
* the collection itself.
- * @deprecated use --= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() --=` if you intend to create a new collection.
*
* @param iter the iterable object.
*/
- @deprecated override def --(iter: Traversable[A]): This = {
+ @deprecated("Use --= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() --=' if you intend to create a new collection.")
+ override def --(iter: Traversable[A]): This = {
for (elem <- iter) -=(elem)
thisCollection
}
@@ -238,10 +233,10 @@ trait MutableMapTemplate[A, B, +This <: MutableMapTemplate[A, B, This] with muta
* the collection itself.
*
* @param iter the iterator
- * @deprecated use --= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() --=` if you intend to create a new collection.
*/
- @deprecated override def --(iter: Iterator[A]): This = {
+ @deprecated("Use --= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() --=' if you intend to create a new collection.")
+ override def --(iter: Iterator[A]): This = {
for (elem <- iter) -=(elem)
thisCollection
}
diff --git a/src/library/scala/collection/generic/MutableSetTemplate.scala b/src/library/scala/collection/generic/MutableSetTemplate.scala
index 40386fe27b..a266d7680d 100644
--- a/src/library/scala/collection/generic/MutableSetTemplate.scala
+++ b/src/library/scala/collection/generic/MutableSetTemplate.scala
@@ -103,10 +103,10 @@ trait MutableSetTemplate[A, +This <: MutableSetTemplate[A, This] with mutable.Se
* the collection itself.
*
* @param elem the element to add.
- * @deprecated use += instead if you intend to add by side effect to an existing collection.
- * Use `clone() +=` if you intend to create a new collection.
*/
- @deprecated override def + (elem: A): This = { +=(elem); thisCollection }
+ @deprecated("Use += instead if you intend to add by side effect to an existing collection.\n"+
+ "Use `clone() +=' if you intend to create a new collection.")
+ override def + (elem: A): This = { +=(elem); thisCollection }
/** Adds two or more elements to this collection and returns
* the collection itself.
@@ -114,10 +114,10 @@ trait MutableSetTemplate[A, +This <: MutableSetTemplate[A, This] with mutable.Se
* @param elem1 the first element to add.
* @param elem2 the second element to add.
* @param elems the remaining elements to add.
- * @deprecated use += instead if you intend to add by side effect to an existing collection.
- * Use `clone() +=` if you intend to create a new collection.
*/
- @deprecated override def + (elem1: A, elem2: A, elems: A*): This = {
+ @deprecated("Use += instead if you intend to add by side effect to an existing collection.\n"+
+ "Use `clone() +=' if you intend to create a new collection.")
+ override def + (elem1: A, elem2: A, elems: A*): This = {
this += elem1 += elem2 ++= elems
thisCollection
}
@@ -126,10 +126,10 @@ trait MutableSetTemplate[A, +This <: MutableSetTemplate[A, This] with mutable.Se
* either the collection itself.
*
* @param iter the iterable object.
- * @deprecated use ++= instead if you intend to add by side effect to an existing collection.
- * Use `clone() ++=` if you intend to create a new collection.
*/
- @deprecated override def ++(iter: Traversable[A]): This = {
+ @deprecated("Use ++= instead if you intend to add by side effect to an existing collection.\n"+
+ "Use `clone() ++=' if you intend to create a new collection.")
+ override def ++(iter: Traversable[A]): This = {
for (elem <- iter) +=(elem)
thisCollection
}
@@ -139,10 +139,10 @@ trait MutableSetTemplate[A, +This <: MutableSetTemplate[A, This] with mutable.Se
* the collection itself.
*
* @param iter the iterator
- * @deprecated use ++= instead if you intend to add by side effect to an existing collection.
- * Use `clone() ++=` if you intend to create a new collection.
*/
- @deprecated override def ++ (iter: Iterator[A]): This = {
+ @deprecated("Use ++= instead if you intend to add by side effect to an existing collection.\n"+
+ "Use `clone() ++=' if you intend to create a new collection.")
+ override def ++ (iter: Iterator[A]): This = {
for (elem <- iter) +=(elem)
thisCollection
}
@@ -151,10 +151,10 @@ trait MutableSetTemplate[A, +This <: MutableSetTemplate[A, This] with mutable.Se
* the collection itself.
*
* @param elem the element to remove.
- * @deprecated use -= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() -=` if you intend to create a new collection.
*/
- @deprecated override def -(elem: A): This = { -=(elem); thisCollection }
+ @deprecated("Use -= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() -=' if you intend to create a new collection.")
+ override def -(elem: A): This = { -=(elem); thisCollection }
/** Removes two or more elements from this collection and returns
* the collection itself.
@@ -162,22 +162,22 @@ trait MutableSetTemplate[A, +This <: MutableSetTemplate[A, This] with mutable.Se
* @param elem1 the first element to remove.
* @param elem2 the second element to remove.
* @param elems the remaining elements to remove.
- * @deprecated use -= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() -=` if you intend to create a new collection.
*/
- @deprecated override def -(elem1: A, elem2: A, elems: A*): This = {
+ @deprecated("Use -= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() -=' if you intend to create a new collection.")
+ override def -(elem1: A, elem2: A, elems: A*): This = {
this -= elem1 -= elem2 --= elems
thisCollection
}
/** Removes a number of elements provided by a traversible object and returns
* the collection itself.
- * @deprecated use --= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() --=` if you intend to create a new collection.
*
* @param iter the iterable object.
*/
- @deprecated override def --(iter: Traversable[A]): This = {
+ @deprecated("Use --= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() --=' if you intend to create a new collection.")
+ override def --(iter: Traversable[A]): This = {
for (elem <- iter) -=(elem)
thisCollection
}
@@ -186,10 +186,10 @@ trait MutableSetTemplate[A, +This <: MutableSetTemplate[A, This] with mutable.Se
* the collection itself.
*
* @param iter the iterator
- * @deprecated use --= instead if you intend to remove by side effect from an existing collection.
- * Use `clone() --=` if you intend to create a new collection.
*/
- @deprecated override def --(iter: Iterator[A]): This = {
+ @deprecated("Use --= instead if you intend to remove by side effect from an existing collection.\n"+
+ "Use `clone() --=' if you intend to create a new collection.")
+ override def --(iter: Iterator[A]): This = {
for (elem <- iter) -=(elem)
thisCollection
}
@@ -207,4 +207,4 @@ trait MutableSetTemplate[A, +This <: MutableSetTemplate[A, This] with mutable.Se
case s: Script[_] => s.iterator foreach <<
case _ => throw new UnsupportedOperationException("message " + cmd + " not understood")
}
-} \ No newline at end of file
+}
diff --git a/src/library/scala/collection/generic/SequenceTemplate.scala b/src/library/scala/collection/generic/SequenceTemplate.scala
index 3890665adf..ade5f45dad 100644
--- a/src/library/scala/collection/generic/SequenceTemplate.scala
+++ b/src/library/scala/collection/generic/SequenceTemplate.scala
@@ -180,11 +180,8 @@ trait SequenceTemplate[+A, +This <: IterableTemplate[A, This] with Sequence[A]]
result
}
- /** Returns index of the first element satisying a predicate, or -1.
- *
- * @deprecated Use `indexWhere` instead
- */
- @deprecated def findIndexOf(p: A => Boolean): Int = indexWhere(p)
+ /** Returns index of the first element satisying a predicate, or -1. */
+ @deprecated("Use `indexWhere' instead") def findIndexOf(p: A => Boolean): Int = indexWhere(p)
/** Returns the index of the first occurence of the specified
* object in this iterable object.
@@ -268,8 +265,7 @@ trait SequenceTemplate[+A, +This <: IterableTemplate[A, This] with Sequence[A]]
*/
def reverseIterator: Iterator[A] = reverse.iterator
- /** @deprecated use `reverseIterator` instead */
- @deprecated def reversedElements = reverseIterator
+ @deprecated("use `reverseIterator' instead") def reversedElements = reverseIterator
/**
* Checks whether the argument sequence is contained at the
@@ -491,42 +487,36 @@ trait SequenceTemplate[+A, +This <: IterableTemplate[A, This] with Sequence[A]]
*/
override def toString = super[IterableTemplate].toString
- /** Returns index of the last element satisying a predicate, or -1.
- * @deprecated use `lastIndexWhere` instead
- */
- @deprecated def findLastIndexOf(p: A => Boolean): Int = lastIndexWhere(p)
+ /** Returns index of the last element satisying a predicate, or -1. */
+ @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 &lt; 0</code>
- * @deprecated use <code>drop</code> instead
*/
- @deprecated def slice(from: Int): Sequence[A] = slice(from, length)
+ @deprecated("use `drop' instead")
+ def slice(from: Int): Sequence[A] = slice(from, length)
- /** @deprecated Should be replaced by
- *
- * <code>(s1, s2) forall { case (x, y) => f(x, y) }</code>
- */
- @deprecated def equalsWith[B](that: Sequence[B])(f: (A,B) => Boolean): Boolean = {
+ @deprecated("Should be replaced by <code>(s1, s2) forall { case (x, y) => f(x, y) }</code>")
+ def equalsWith[B](that: Sequence[B])(f: (A,B) => Boolean): Boolean = {
val i = this.iterator
val j = that.iterator
while (i.hasNext && j.hasNext && f(i.next, j.next)) ()
!i.hasNext && !j.hasNext
}
- /** Is <code>that</code> a slice in this?
- * @deprecated Should be repaced by <code>indexOf(that) != -1</code>
- */
- @deprecated def containsSlice[B](that: Sequence[B]): Boolean = indexOf(that) != -1
+ /** Is <code>that</code> a slice in this? */
+ @deprecated("Should be repaced by <code>indexOf(that) != -1</code>")
+ def containsSlice[B](that: Sequence[B]): Boolean = indexOf(that) != -1
/**
* returns a projection that can be used to call non-strict <code>filter</code>,
* <code>map</code>, and <code>flatMap</code> methods that build projections
* of the collection.
- * @deprecated use view instead
*/
- @deprecated override def projection = view
+ @deprecated("use `view' instead") override def projection = view
}
diff --git a/src/library/scala/collection/generic/SetTemplate.scala b/src/library/scala/collection/generic/SetTemplate.scala
index cce6ec4229..61b34108c5 100644
--- a/src/library/scala/collection/generic/SetTemplate.scala
+++ b/src/library/scala/collection/generic/SetTemplate.scala
@@ -91,9 +91,8 @@ self =>
* It removes all the elements that are not present in <code>that</code>.
*
* @param that the set to intersect with
- * @deprecated use & instead
*/
- @deprecated def ** (that: Set[A]): This = intersect(that)
+ @deprecated("use & instead") def ** (that: Set[A]): This = intersect(that)
/** The union of this set and the given set <code>that</code>.
*
diff --git a/src/library/scala/collection/generic/TraversableTemplate.scala b/src/library/scala/collection/generic/TraversableTemplate.scala
index 32402217c8..09396ef3dc 100644
--- a/src/library/scala/collection/generic/TraversableTemplate.scala
+++ b/src/library/scala/collection/generic/TraversableTemplate.scala
@@ -190,9 +190,9 @@ self =>
*
* @param p the predicate used to test elements
* @return the traversable without all elements that satisfy <code>p</code>
- * @deprecated use `filterNot` instead
*/
- @deprecated def remove(p: A => Boolean): This = filterNot(p)
+ @deprecated("use `filterNot' instead")
+ def remove(p: A => Boolean): This = filterNot(p)
/** Partitions this traversable in two traversables according to a predicate.
*
diff --git a/src/library/scala/collection/generic/TraversableView.scala b/src/library/scala/collection/generic/TraversableView.scala
index deacb1b5bb..3c2efdc92f 100644
--- a/src/library/scala/collection/generic/TraversableView.scala
+++ b/src/library/scala/collection/generic/TraversableView.scala
@@ -21,7 +21,7 @@ object TraversableView {
class NoBuilder[A] extends Builder[A, Nothing] {
def +=(elem: A): this.type = this
def iterator: Iterator[A] = Iterator.empty
- @deprecated def elements = iterator
+ @deprecated("use `iterator' instead") def elements = iterator
def result() = throw new UnsupportedOperationException("TraversableView.Builder.result")
def clear() {}
}
diff --git a/src/library/scala/collection/generic/TraversableView.scala.1 b/src/library/scala/collection/generic/TraversableView.scala.1
index 916f1182ff..69f1682339 100755
--- a/src/library/scala/collection/generic/TraversableView.scala.1
+++ b/src/library/scala/collection/generic/TraversableView.scala.1
@@ -138,7 +138,7 @@ object TraversableView {
class NoBuilder[A] extends Builder[A, Nothing, TraversableView[_, _]] {
def +=(elem: A) {}
def iterator: Iterator[A] = Iterator.empty
- @deprecated def elements = iterator
+ @deprecated("use `iterator' instead") def elements = iterator
def result() = throw new UnsupportedOperationException("TraversableView.Builder.result")
def clear() {}
}
diff --git a/src/library/scala/collection/immutable/ImmutableIterator.scala.disabled b/src/library/scala/collection/immutable/ImmutableIterator.scala.disabled
index 0cdfc4a988..db17a0c467 100644
--- a/src/library/scala/collection/immutable/ImmutableIterator.scala.disabled
+++ b/src/library/scala/collection/immutable/ImmutableIterator.scala.disabled
@@ -106,7 +106,7 @@ sealed abstract class ImmutableIterator[+A] {
*/
def iterator: Iterator[A] = new Elements
- @deprecated def elements = iterator
+ @deprecated("use `iterator' instead") def elements = iterator
}
diff --git a/src/library/scala/collection/immutable/IntMap.scala b/src/library/scala/collection/immutable/IntMap.scala
index 32ad7fca42..88e17ea09b 100644
--- a/src/library/scala/collection/immutable/IntMap.scala
+++ b/src/library/scala/collection/immutable/IntMap.scala
@@ -250,8 +250,8 @@ sealed abstract class IntMap[+T] extends scala.collection.immutable.Map[Int, T]
case IntMap.Nil => IntMap.Tip(key, value);
}
- /** @deprecated use updated instead */
- @deprecated override def update[S >: T](key: Int, value: S): IntMap[S] = updated(key, value)
+ @deprecated("use `updated' instead")
+ override def update[S >: T](key: Int, value: S): IntMap[S] = updated(key, value)
/**
* Updates the map, using the provided function to resolve conflicts if the key is already present.
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala
index 38ddfee8b5..78bb4a125e 100644
--- a/src/library/scala/collection/immutable/List.scala
+++ b/src/library/scala/collection/immutable/List.scala
@@ -313,9 +313,9 @@ sealed abstract class List[+A] extends LinearSequence[A]
* @param that the list of elements to remove from this list.
* @return this list without the elements of the given list
* <code>that</code>.
- * @deprecated use diff instead
*/
- @deprecated def -- [B >: A](that: List[B]): List[B] = {
+ @deprecated("use `diff' instead")
+ def -- [B >: A](that: List[B]): List[B] = {
val b = new ListBuffer[B]
var these = this
while (!these.isEmpty) {
@@ -331,9 +331,9 @@ sealed abstract class List[+A] extends LinearSequence[A]
* @param x the object to remove from this list.
* @return this list without occurrences of the given object
* <code>x</code>.
- * @deprecated use diff instead
*/
- @deprecated def - [B >: A](x: B): List[B] = {
+ @deprecated("use `diff' instead")
+ def - [B >: A](x: B): List[B] = {
val b = new ListBuffer[B]
var these = this
while (!these.isEmpty) {
@@ -358,9 +358,9 @@ sealed abstract class List[+A] extends LinearSequence[A]
* List("Steve", "Tom", "John", "Bob")
* .sort((e1, e2) => (e1 compareTo e2) &lt; 0) =
* List("Bob", "John", "Steve", "Tom")</pre>
- * @deprecated use sortWith instead
*/
- @deprecated def sort(lt : (A,A) => Boolean): List[A] = {
+ @deprecated("use `sortWith' instead")
+ def sort(lt : (A,A) => Boolean): List[A] = {
/** Merge two already-sorted lists */
def merge(l1: List[A], l2: List[A]): List[A] = {
val res = new ListBuffer[A]
@@ -501,7 +501,6 @@ object List extends SequenceFactory[List] {
* and elements are in the range between <code>start</code> (inclusive)
* and <code>end</code> (exclusive)
*
- * @deprecated use @see iterate instead.
* @param start the start value of the list
* @param end the end value of the list
* @param step the increment function of the list, which given <code>v<sub>n</sub></code>,
@@ -509,7 +508,8 @@ object List extends SequenceFactory[List] {
* or decreasing.
* @return the sorted list of all integers in range [start;end).
*/
- @deprecated def range(start: Int, end: Int, step: Int => Int): List[Int] = {
+ @deprecated("use `iterate' instead")
+ def range(start: Int, end: Int, step: Int => Int): List[Int] = {
val up = step(start) > start
val down = step(start) < start
val b = new ListBuffer[Int]
@@ -525,13 +525,13 @@ object List extends SequenceFactory[List] {
}
/** Create a list containing several copies of an element.
- * @deprecated use @see fill instead
*
* @param n the length of the resulting list
* @param elem the element composing the resulting list
* @return a list composed of n elements all equal to elem
*/
- @deprecated def make[A](n: Int, elem: A): List[A] = {
+ @deprecated("use `fill' instead")
+ def make[A](n: Int, elem: A): List[A] = {
val b = new ListBuffer[A]
var i = 0
while (i < n) {
@@ -543,11 +543,11 @@ object List extends SequenceFactory[List] {
/** Concatenate all the elements of a given list of lists.
*
- * @deprecated use `xss.flatten` instead
* @param xss the list of lists that are to be concatenated
* @return the concatenation of all the lists
*/
- @deprecated def flatten[A](xss: List[List[A]]): List[A] = {
+ @deprecated("use `xss.flatten' instead")
+ def flatten[A](xss: List[List[A]]): List[A] = {
val b = new ListBuffer[A]
for (xs <- xss) {
var xc = xs
@@ -563,9 +563,9 @@ object List extends SequenceFactory[List] {
*
* @param xs the list of pairs to unzip
* @return a pair of lists.
- * @deprecated use `xs.unzp` instead
*/
- @deprecated def unzip[A,B](xs: List[(A,B)]): (List[A], List[B]) = {
+ @deprecated("use `xs.unzip' instead")
+ def unzip[A,B](xs: List[(A,B)]): (List[A], List[B]) = {
val b1 = new ListBuffer[A]
val b2 = new ListBuffer[B]
var xc = xs
@@ -579,20 +579,21 @@ object List extends SequenceFactory[List] {
/** Transforms an iterable of pairs into a pair of lists.
*
- * @deprecated use `xs.unzip` instead
* @param xs the iterable of pairs to unzip
* @return a pair of lists.
*/
- @deprecated def unzip[A,B](xs: Iterable[(A,B)]): (List[A], List[B]) =
+ @deprecated("use `xs.unzip' instead")
+ def unzip[A,B](xs: Iterable[(A,B)]): (List[A], List[B]) =
xs.foldRight[(List[A], List[B])]((Nil, Nil)) {
case ((x, y), (xs, ys)) => (x :: xs, y :: ys)
}
/**
- * Returns the <code>Left</code> values in the given <code>Iterable</code> of <code>Either</code>s.
- * @deprecated use `Either.lefts` instead
+ * Returns the <code>Left</code> values in the given <code>Iterable</code>
+ * of <code>Either</code>s.
*/
- @deprecated def lefts[A, B](es: Iterable[Either[A, B]]) =
+ @deprecated("use `Either.lefts' instead")
+ def lefts[A, B](es: Iterable[Either[A, B]]) =
es.foldRight[List[A]](Nil)((e, as) => e match {
case Left(a) => a :: as
case Right(_) => as
@@ -600,9 +601,9 @@ object List extends SequenceFactory[List] {
/**
* Returns the <code>Right</code> values in the given<code>Iterable</code> of <code>Either</code>s.
- * @deprecated use `Either.rights` instead
*/
- @deprecated def rights[A, B](es: Iterable[Either[A, B]]) =
+ @deprecated("use `Either.rights' instead")
+ def rights[A, B](es: Iterable[Either[A, B]]) =
es.foldRight[List[B]](Nil)((e, bs) => e match {
case Left(_) => bs
case Right(b) => b :: bs
@@ -612,9 +613,9 @@ object List extends SequenceFactory[List] {
*
* @param xs the iterable of Eithers to separate
* @return a pair of lists.
- * @deprecated use `Either.separate` instead
*/
- @deprecated def separate[A,B](es: Iterable[Either[A,B]]): (List[A], List[B]) =
+ @deprecated("use `Either.separate' instead")
+ def separate[A,B](es: Iterable[Either[A,B]]): (List[A], List[B]) =
es.foldRight[(List[A], List[B])]((Nil, Nil)) {
case (Left(a), (lefts, rights)) => (a :: lefts, rights)
case (Right(b), (lefts, rights)) => (lefts, b :: rights)
@@ -625,18 +626,18 @@ object List extends SequenceFactory[List] {
* @param it the iterator to convert
* @return a list that contains the elements returned by successive
* calls to <code>it.next</code>
- * @deprecated use it.toList instead
*/
- @deprecated def fromIterator[A](it: Iterator[A]): List[A] = it.toList
+ @deprecated("use `it.toList' instead")
+ def fromIterator[A](it: Iterator[A]): List[A] = it.toList
/** Converts an array into a list.
*
* @param arr the array to convert
* @return a list that contains the same elements than <code>arr</code>
* in the same order
- * @deprecated use `array.toList` instead
*/
- @deprecated def fromArray[A](arr: Array[A]): List[A] = fromArray(arr, 0, arr.length)
+ @deprecated("use `array.toList' instead")
+ def fromArray[A](arr: Array[A]): List[A] = fromArray(arr, 0, arr.length)
/** Converts a range of an array into a list.
*
@@ -645,9 +646,9 @@ object List extends SequenceFactory[List] {
* @param len the lenght of the range to convert
* @return a list that contains the same elements than <code>arr</code>
* in the same order
- * @deprecated use `array.view(start, end).toList` instead
*/
- @deprecated def fromArray[A](arr: Array[A], start: Int, len: Int): List[A] = {
+ @deprecated("use `array.view(start, end).toList' instead")
+ def fromArray[A](arr: Array[A], start: Int, len: Int): List[A] = {
var res: List[A] = Nil
var i = start + len
while (i > start) {
@@ -663,9 +664,9 @@ object List extends SequenceFactory[List] {
* @param str the string to parse
* @param separator the separator character
* @return the list of substrings
- * @deprecated use `str.split(separator).toList` instead
*/
- @deprecated def fromString(str: String, separator: Char): List[String] = {
+ @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) {
@@ -681,17 +682,17 @@ object List extends SequenceFactory[List] {
*
* @param str the string to convert.
* @return the string as a list of characters.
- * @deprecated use <code>str.toList</code> instead
*/
- @deprecated def fromString(str: String): List[Char] = str.toList
+ @deprecated("use `str.toList' instead")
+ def fromString(str: String): List[Char] = str.toList
/** Returns the given list of characters as a string.
*
* @param xs the list to convert.
* @return the list in form of a string.
- * @deprecated use xs.mkString instead
*/
- @deprecated def toString(xs: List[Char]): String = {
+ @deprecated("use `xs.mkString' instead")
+ def toString(xs: List[Char]): String = {
val sb = new StringBuilder()
var xc = xs
while (!xc.isEmpty) {
@@ -703,9 +704,9 @@ object List extends SequenceFactory[List] {
/** Like xs map f, but returns <code>xs</code> unchanged if function
* <code>f</code> maps all elements to themselves.
- * @deprecated use xs.mapConserve(f)
*/
- @deprecated def mapConserve[A <: AnyRef](xs: List[A])(f: A => A): List[A] = {
+ @deprecated("use `xs.mapConserve(f)' instead")
+ def mapConserve[A <: AnyRef](xs: List[A])(f: A => A): List[A] = {
def loop(ys: List[A]): List[A] =
if (ys.isEmpty) xs
else {
@@ -732,13 +733,13 @@ object List extends SequenceFactory[List] {
/** Returns the list resulting from applying the given function <code>f</code>
* to corresponding elements of the argument lists.
- * @deprecated use (xs, ys).map(f) instead
* @param f function to apply to each pair of elements.
* @return <code>[f(a0,b0), ..., f(an,bn)]</code> if the lists are
* <code>[a0, ..., ak]</code>, <code>[b0, ..., bl]</code> and
* <code>n = min(k,l)</code>
*/
- @deprecated def map2[A,B,C](xs: List[A], ys: List[B])(f: (A, B) => C): List[C] = {
+ @deprecated("use `(xs, ys).map(f)' instead")
+ def map2[A,B,C](xs: List[A], ys: List[B])(f: (A, B) => C): List[C] = {
val b = new ListBuffer[C]
var xc = xs
var yc = ys
@@ -754,7 +755,6 @@ object List extends SequenceFactory[List] {
* <code>f</code> to corresponding elements of the argument lists.
*
* @param f function to apply to each pair of elements.
- * @deprecated use (xs, ys, zs).map(f) instead
* @return <code>[f(a<sub>0</sub>,b<sub>0</sub>,c<sub>0</sub>),
* ..., f(a<sub>n</sub>,b<sub>n</sub>,c<sub>n</sub>)]</code>
* if the lists are <code>[a<sub>0</sub>, ..., a<sub>k</sub>]</code>,
@@ -762,7 +762,8 @@ object List extends SequenceFactory[List] {
* <code>[c<sub>0</sub>, ..., c<sub>m</sub>]</code> and
* <code>n = min(k,l,m)</code>
*/
- @deprecated def map3[A,B,C,D](xs: List[A], ys: List[B], zs: List[C])(f: (A, B, C) => D): List[D] = {
+ @deprecated("use `(xs, ys, zs).map(f)' instead")
+ def map3[A,B,C,D](xs: List[A], ys: List[B], zs: List[C])(f: (A, B, C) => D): List[D] = {
val b = new ListBuffer[D]
var xc = xs
var yc = ys
@@ -785,9 +786,9 @@ object List extends SequenceFactory[List] {
* if the lists are <code>[a<sub>0</sub>, ..., a<sub>k</sub>]</code>;
* <code>[b<sub>0</sub>, ..., b<sub>l</sub>]</code>
* and <code>n = min(k,l)</code>
- * @deprecated use (xs, ys).forall(f) instead
*/
- @deprecated def forall2[A,B](xs: List[A], ys: List[B])(f: (A, B) => Boolean): Boolean = {
+ @deprecated("use `(xs, ys).forall(f)' instead")
+ def forall2[A,B](xs: List[A], ys: List[B])(f: (A, B) => Boolean): Boolean = {
var xc = xs
var yc = ys
while (!xc.isEmpty && !yc.isEmpty) {
@@ -807,9 +808,9 @@ object List extends SequenceFactory[List] {
* <code>[a<sub>0</sub>, ..., a<sub>k</sub>]</code>,
* <code>[b<sub>0</sub>, ..., b<sub>l</sub>]</code> and
* <code>n = min(k,l)</code>
- * @deprecated use (xs, ys).exists(f) instead
*/
- @deprecated def exists2[A,B](xs: List[A], ys: List[B])(f: (A, B) => Boolean): Boolean = {
+ @deprecated("use `(xs, ys).exists(f)' instead")
+ def exists2[A,B](xs: List[A], ys: List[B])(f: (A, B) => Boolean): Boolean = {
var xc = xs
var yc = ys
while (!xc.isEmpty && !yc.isEmpty) {
@@ -825,9 +826,9 @@ object List extends SequenceFactory[List] {
*
* @param xss the list of lists
* @return the transposed list of lists
- * @deprecated use xss.transpose instead
*/
- @deprecated def transpose[A](xss: List[List[A]]): List[List[A]] = {
+ @deprecated("use p`xss.transpose' instead")
+ def transpose[A](xss: List[List[A]]): List[List[A]] = {
val buf = new ListBuffer[List[A]]
var yss = xss
while (!yss.head.isEmpty) {
diff --git a/src/library/scala/collection/immutable/LongMap.scala b/src/library/scala/collection/immutable/LongMap.scala
index 346e97345f..5ea52e5add 100644
--- a/src/library/scala/collection/immutable/LongMap.scala
+++ b/src/library/scala/collection/immutable/LongMap.scala
@@ -251,8 +251,8 @@ sealed abstract class LongMap[+T] extends scala.collection.immutable.Map[Long, T
case LongMap.Nil => LongMap.Tip(key, value);
}
- /** @deprecated use updated instead */
- @deprecated override def update[S >: T](key: Long, value: S): LongMap[S] = updated(key, value)
+ @deprecated("use `updated' instead")
+ override def update[S >: T](key: Long, value: S): LongMap[S] = updated(key, value)
/**
* Updates the map, using the provided function to resolve conflicts if the key is already present.
diff --git a/src/library/scala/collection/immutable/Queue.scala b/src/library/scala/collection/immutable/Queue.scala
index e0a2387ea4..f63545cbe7 100644
--- a/src/library/scala/collection/immutable/Queue.scala
+++ b/src/library/scala/collection/immutable/Queue.scala
@@ -68,11 +68,10 @@ extends immutable.Sequence[A]
/** Creates a new queue with element added at the end
* of the old queue.
*
- * @deprecated Use the method <code>enqueue</code> from now on.
- *
* @param elem the element to insert
*/
- @deprecated def +[B >: A](elem: B) = enqueue(elem)
+ @deprecated("Use the method <code>enqueue</code> from now on.")
+ def +[B >: A](elem: B) = enqueue(elem)
/** Creates a new queue with element added at the end
* of the old queue.
@@ -87,11 +86,10 @@ extends immutable.Sequence[A]
* The elements are prepended in the order they
* are given out by the iterator.
*
- * @deprecated Use the method <code>enqueue</code> from now on.
- *
* @param iter an iterable object
*/
- @deprecated def +[B >: A](iter: Iterable[B]) = enqueue(iter)
+ @deprecated("Use the method <code>enqueue</code> from now on.")
+ def +[B >: A](iter: Iterable[B]) = enqueue(iter)
/** Returns a new queue with all elements provided by
* an <code>Iterable</code> object added at the end of
diff --git a/src/library/scala/collection/immutable/RedBlack.scala b/src/library/scala/collection/immutable/RedBlack.scala
index a13250363d..a33e5b11c2 100644
--- a/src/library/scala/collection/immutable/RedBlack.scala
+++ b/src/library/scala/collection/immutable/RedBlack.scala
@@ -29,11 +29,11 @@ abstract class RedBlack[A] {
def update[B1 >: B](k: A, v: B1): Tree[B1] = blacken(upd(k, v))
def delete(k: A): Tree[B] = del(k)
def foreach[U](f: (A, B) => U)
- /** @deprecated use foreach instead */
- @deprecated def visit[T](input : T)(f : (T,A,B) => Tuple2[Boolean,T]) : Tuple2[Boolean,T];
+ @deprecated("use `foreach' instead")
+ def visit[T](input : T)(f : (T,A,B) => Tuple2[Boolean,T]) : Tuple2[Boolean,T];
def toStream: Stream[(A,B)]
def iterator: Iterator[(A, B)]
- @deprecated def elements = iterator
+ @deprecated("use `iterator' instead") def elements = iterator
def upd[B1 >: B](k: A, v: B1): Tree[B1]
def del(k: A): Tree[B]
def smallest: NonEmpty[B]
@@ -97,8 +97,7 @@ abstract class RedBlack[A] {
right foreach f
}
- /** @deprecated use foreach instead */
- @deprecated
+ @deprecated("use `foreach' instead")
def visit[T](input : T)(f : (T,A,B) => Tuple2[Boolean,T]) : Tuple2[Boolean,T] = {
val left = this.left.visit(input)(f)
if (!left._1) return left
@@ -135,8 +134,7 @@ abstract class RedBlack[A] {
def foreach[U](f: (A, Nothing) => U) {}
- /** @deprecated use foreach instead */
- @deprecated
+ @deprecated("use `foreach' instead")
def visit[T](input : T)(f : (T,A,Nothing) => Tuple2[Boolean,T]) = Tuple2(true,input)
def range(from : Option[A], until : Option[A]) = this
diff --git a/src/library/scala/collection/immutable/Stream.scala b/src/library/scala/collection/immutable/Stream.scala
index 538e9d85fe..77b196c167 100644
--- a/src/library/scala/collection/immutable/Stream.scala
+++ b/src/library/scala/collection/immutable/Stream.scala
@@ -416,8 +416,7 @@ object Stream extends SequenceFactory[Stream] {
else Some((xs.head, xs.tail))
}
- /** @deprecated use #:: instead */
- @deprecated lazy val lazy_:: = #::
+ @deprecated("use #:: instead") lazy val lazy_:: = #::
/** An alternative way of building and matching Streams using Stream.cons(hd, tl).
*/
@@ -480,8 +479,8 @@ object Stream extends SequenceFactory[Stream] {
* occurrence)
* @param elem the element composing the resulting stream
* @return the stream containing an inifinite number of elem
- * @deprecated use fill instead
*/
+ @deprecated("use `fill' instead")
def continually[A](elem: => A): Stream[A] = new Cons(elem, continually(elem))
override def fill[A](n: Int)(elem: => A): Stream[A] =
@@ -499,19 +498,19 @@ object Stream extends SequenceFactory[Stream] {
/** A stream containing all elements of a given iterator, in the order they are produced.
* @param it The iterator producing the stream's elements
- * @deprecated use it.toStream instead
*/
- @deprecated def fromIterator[A](it: Iterator[A]): Stream[A] =
+ @deprecated("use it.toStream instead")
+ def fromIterator[A](it: Iterator[A]): Stream[A] =
if (it.hasNext) cons(it.next, fromIterator(it)) else empty
/** The concatenation of a sequence of streams
- * @deprecated use xs.flatten instead
*/
+ @deprecated("use xs.flatten instead")
def concat[A](xs: Iterable[Stream[A]]): Stream[A] = concat(xs.iterator)
/** The concatenation of all streams returned by an iterator
- * @deprecated use xs.toStream.flatten instead
*/
+ @deprecated("use xs.toStream.flatten instead")
def concat[A](xs: Iterator[Stream[A]]): Stream[A] =
if (xs.hasNext) xs.next append concat(xs)
else empty
@@ -522,13 +521,13 @@ object Stream extends SequenceFactory[Stream] {
* where <code>v<sub>0</sub> = start</code>
* and elements are in the range between <code>start</code> (inclusive)
* and <code>end</code> (exclusive)
- * @deprecated use @see iterate instead.
* @param start the start value of the stream
* @param end the end value of the stream
* @param step the increment function of the stream, must be monotonically increasing or decreasing
* @return the stream starting at value <code>start</code>.
*/
- @deprecated def range(start: Int, end: Int, step: Int => Int): Stream[Int] = {
+ @deprecated("use `iterate' instead.")
+ def range(start: Int, end: Int, step: Int => Int): Stream[Int] = {
val up = step(start) > start
val down = step(start) < start
def loop(lo: Int): Stream[Int] =
@@ -542,18 +541,18 @@ object Stream extends SequenceFactory[Stream] {
*
* @param elem the element composing the resulting stream
* @return the stream containing an inifinite number of elem
- * @deprecated use fill(elem) instead
*/
- @deprecated def const[A](elem: A): Stream[A] = cons(elem, const(elem))
+ @deprecated("use fill(elem) instead")
+ def const[A](elem: A): Stream[A] = cons(elem, const(elem))
/** Create a stream containing several copies of an element.
*
* @param n the length of the resulting stream
* @param elem the element composing the resulting stream
* @return the stream composed of n elements all equal to elem
- * @deprecated use fill(n, elem) instead
*/
- @deprecated def make[A](n: Int, elem: A): Stream[A] =
+ @deprecated("use fill(n, elem) instead")
+ def make[A](n: Int, elem: A): Stream[A] =
const(elem) take n
}
diff --git a/src/library/scala/collection/immutable/TreeHashMap.scala b/src/library/scala/collection/immutable/TreeHashMap.scala
index 1b45a8b5b8..76ce1ab16e 100644
--- a/src/library/scala/collection/immutable/TreeHashMap.scala
+++ b/src/library/scala/collection/immutable/TreeHashMap.scala
@@ -184,7 +184,7 @@ private[collection] sealed abstract class AssocMap[Key, +Value] extends immutabl
def iterator : Iterator[(Key, Value)] = new AssocMapIterator(this)
- @deprecated def elements = iterator
+ @deprecated("use `iterator' instead") def elements = iterator
override final def foreach[U](f : ((Key, Value)) => U) = this match {
case Cons(key, value, tail) => { f((key, value)); tail.foreach(f); }
diff --git a/src/library/scala/collection/mutable/ArrayStack.scala b/src/library/scala/collection/mutable/ArrayStack.scala
index 0c420300a4..b0090da156 100644
--- a/src/library/scala/collection/mutable/ArrayStack.scala
+++ b/src/library/scala/collection/mutable/ArrayStack.scala
@@ -57,10 +57,8 @@ class ArrayStack[T] private(private var table : Array[AnyRef],
x;
}
- /**
- * View the top element of the stack.
- * @deprecated use top instead
- */
+ /** View the top element of the stack. */
+ @deprecated("use top instead")
def peek = top
/**
diff --git a/src/library/scala/collection/mutable/CloneableCollection.scala b/src/library/scala/collection/mutable/CloneableCollection.scala
index 8dea90eb2a..354e71435e 100644
--- a/src/library/scala/collection/mutable/CloneableCollection.scala
+++ b/src/library/scala/collection/mutable/CloneableCollection.scala
@@ -13,8 +13,7 @@ package scala.collection.mutable
/** The J2ME version of the library defined this trait with a clone method
* to substitute for the lack of Object.clone there
- * @deprecated use Cloneable instead
*/
-@deprecated trait CloneableCollection {
+@deprecated("use Cloneable instead") trait CloneableCollection {
override def clone(): AnyRef = super.clone()
}
diff --git a/src/library/scala/collection/mutable/HashTable.scala b/src/library/scala/collection/mutable/HashTable.scala
index be0a84bd41..56843013ad 100644
--- a/src/library/scala/collection/mutable/HashTable.scala
+++ b/src/library/scala/collection/mutable/HashTable.scala
@@ -131,10 +131,9 @@ trait HashTable[A] extends AnyRef {
}
}
- /** An iterator returning all entries
- * @deprecated use entriesIterator instead
- */
- @deprecated protected def entries: Iterator[Entry] = entriesIterator
+ /** An iterator returning all entries */
+ @deprecated("use entriesIterator instead")
+ protected def entries: Iterator[Entry] = entriesIterator
/** Remove all entries from table
*/
diff --git a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala
index 86d8facfc4..6f954d299b 100644
--- a/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala
+++ b/src/library/scala/collection/mutable/ImmutableMapAdaptor.scala
@@ -50,7 +50,7 @@ extends Map[A, B]
def iterator: Iterator[(A, B)] = imap.iterator
- @deprecated def elements = iterator
+ @deprecated("use `iterator' instead") def elements = iterator
override def toList: List[(A, B)] = imap.toList
diff --git a/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala b/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala
index bac4f95246..452aa3afe1 100644
--- a/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala
+++ b/src/library/scala/collection/mutable/ImmutableSetAdaptor.scala
@@ -41,7 +41,7 @@ class ImmutableSetAdaptor[A](protected var set: immutable.Set[A]) extends Set[A]
def iterator: Iterator[A] = set.iterator
- @deprecated override def elements: Iterator[A] = iterator
+ @deprecated("use `iterator' instead") override def elements: Iterator[A] = iterator
def +=(elem: A): this.type = { set = set + elem; this }
diff --git a/src/library/scala/collection/mutable/MutableList.scala b/src/library/scala/collection/mutable/MutableList.scala
index a2a283f2c4..ce9060acf8 100644
--- a/src/library/scala/collection/mutable/MutableList.scala
+++ b/src/library/scala/collection/mutable/MutableList.scala
@@ -87,8 +87,7 @@ class MutableList[A] extends LinearSequence[A] with LinearSequenceTemplate[A, Mu
len = len + 1
}
- /** @deprecated use clear instead */
- @deprecated def reset() { clear() }
+ @deprecated("use clear instead") def reset() { clear() }
/** Returns an iterator over all elements of this list.
*/
diff --git a/src/library/scala/collection/mutable/OpenHashMap.scala b/src/library/scala/collection/mutable/OpenHashMap.scala
index 8373b4fdde..ab5e897ca3 100644
--- a/src/library/scala/collection/mutable/OpenHashMap.scala
+++ b/src/library/scala/collection/mutable/OpenHashMap.scala
@@ -184,8 +184,8 @@ class OpenHashMap[Key, Value](initialSize : Int) extends scala.collection.mutabl
}
}
- /** @deprecated use `iterator` instead */
- @deprecated override def elements: Iterator[(Key, Value)] = iterator
+ @deprecated("use `iterator' instead")
+ override def elements: Iterator[(Key, Value)] = iterator
override def clone : OpenHashMap[Key, Value] = {
val it = new OpenHashMap[Key, Value]
diff --git a/src/library/scala/collection/mutable/Stack.scala b/src/library/scala/collection/mutable/Stack.scala
index b079a94f92..9735eeb215 100644
--- a/src/library/scala/collection/mutable/Stack.scala
+++ b/src/library/scala/collection/mutable/Stack.scala
@@ -71,10 +71,8 @@ class Stack[A] private (var elems: List[A]) extends collection.Sequence[A] with
*/
def pushAll(elems: collection.Traversable[A]): this.type = { for (elem <- elems) { push(elem); () }; this }
- /** @deprecated use pushAll */
- @deprecated def ++=(it: Iterator[A]): this.type = pushAll(it)
- /** @deprecated use pushAll */
- @deprecated def ++=(it: Iterable[A]): this.type = pushAll(it)
+ @deprecated("use pushAll") def ++=(it: Iterator[A]): this.type = pushAll(it)
+ @deprecated("use pushAll") def ++=(it: Iterable[A]): this.type = pushAll(it)
/** Returns the top element of the stack. This method will not remove
* the element from the stack. An error is signaled if there is no
diff --git a/src/library/scala/collection/mutable/StringBuilder.scala b/src/library/scala/collection/mutable/StringBuilder.scala
index c8ddb065ea..245e867e9f 100644
--- a/src/library/scala/collection/mutable/StringBuilder.scala
+++ b/src/library/scala/collection/mutable/StringBuilder.scala
@@ -87,11 +87,10 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
*/
def capacity: Int = array.length
- /** Same as <code>ensureCapacity</code>.
- * @deprecated use `ensureCapacity` instead. An assignment is misleading
- * because it can never decrease the capacity.
- */
- @deprecated def capacity_=(n: Int) { ensureCapacity(n) }
+ /** Same as <code>ensureCapacity</code>. */
+ @deprecated("use `ensureCapacity' instead. An assignment is misleading because\n"+
+ "it can never decrease the capacity.")
+ def capacity_=(n: Int) { ensureCapacity(n) }
/** <p>
* Ensures that the capacity is at least equal to the specified minimum.
@@ -293,10 +292,9 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
def appendAll(x: Seq[Char]): StringBuilder =
appendAll(x.toArray, 0, x.length)
- /* @deprecated use appendAll instead. This method is deprecated
- * because of the possible confusion with `append(Any)`.
- */
- @deprecated def append(x: Seq[Char]): StringBuilder =
+ @deprecated("use appendAll instead. This method is deprecated because of the\n"+
+ "possible confusion with `append(Any)'.")
+ def append(x: Seq[Char]): StringBuilder =
appendAll(x)
/** <p>
@@ -315,10 +313,9 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
def appendAll(x: Array[Char]): StringBuilder =
appendAll(x, 0, x.length)
- /** @deprecated use appendAll instead. This method is deprecated
- * because of the possible confusion with `append(Any)`.
- */
- @deprecated def append(x: Array[Char]): StringBuilder =
+ @deprecated("use appendAll instead. This method is deprecated because\n"+
+ "of the possible confusion with `append(Any)'.")
+ def append(x: Array[Char]): StringBuilder =
appendAll(x)
/** <p>
@@ -344,10 +341,9 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
this
}
- /** @deprecated use appendAll instead. This method is deprecated
- * because of the possible confusion with `append(Any, Int, Int)`.
- */
- @deprecated def append(x: Array[Char], offset: Int, len: Int): StringBuilder =
+ @deprecated("use appendAll instead. This method is deprecated because\n"+
+ "of the possible confusion with `append(Any, Int, Int)'.")
+ def append(x: Array[Char], offset: Int, len: Int): StringBuilder =
appendAll(x, offset, len)
/** <p>
@@ -477,10 +473,9 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
this
}
- /** @deprecated use insertAll instead. This method is deprecated
- * because of the possible confusion with `insert(Int, Any, Int, Int)`.
- */
- @deprecated def insert(index: Int, str: Array[Char], offset: Int, len: Int): StringBuilder =
+ @deprecated("use insertAll instead. This method is deprecated because of the\n"+
+ "possible confusion with `insert(Int, Any, Int, Int)'.")
+ def insert(index: Int, str: Array[Char], offset: Int, len: Int): StringBuilder =
insertAll(index, str, offset, len)
/** <p>
@@ -537,10 +532,9 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
def insertAll(at: Int, x: Seq[Char]): StringBuilder =
insertAll(at, x.toArray)
- /* @deprecated use insertAll instead. This method is deprecated
- * because of the possible confusion with `insert(Int, Any)`.
- */
- @deprecated def insert(at: Int, x: Seq[Char]): StringBuilder =
+ @deprecated("use insertAll instead. This method is deprecated because of\n"+
+ "the possible confusion with `insert(Int, Any)'.")
+ def insert(at: Int, x: Seq[Char]): StringBuilder =
insertAll(at, x)
/** Inserts the string representation of the <code>Char</code> array
@@ -562,10 +556,9 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
this
}
- /* @deprecated use insertAll instead. This method is deprecated
- * because of the possible confusion with `insert(Int, Any)`.
- */
- @deprecated def insert(at: Int, x: Array[Char]): StringBuilder =
+ @deprecated("use insertAll instead. This method is deprecated because of\n"+
+ "the possible confusion with `insert(Int, Any)'.")
+ def insert(at: Int, x: Array[Char]): StringBuilder =
insertAll(at, x)
/** <p>
diff --git a/src/library/scala/concurrent/SyncVar.scala b/src/library/scala/concurrent/SyncVar.scala
index 3e25f8a514..3b35c9ef10 100644
--- a/src/library/scala/concurrent/SyncVar.scala
+++ b/src/library/scala/concurrent/SyncVar.scala
@@ -49,10 +49,8 @@ class SyncVar[A] {
notifyAll()
}
- /**
- * @deprecated Will be removed in 2.8. SyncVar should not allow exception by design.
- */
- @deprecated def setWithCatch(x: => A) = synchronized {
+ @deprecated("Will be removed in 2.8. SyncVar should not allow exception by design.")
+ def setWithCatch(x: => A) = synchronized {
try {
this set x
} catch {
diff --git a/src/library/scala/deprecated.scala b/src/library/scala/deprecated.scala
index cb152f1465..fb4e4e879d 100644
--- a/src/library/scala/deprecated.scala
+++ b/src/library/scala/deprecated.scala
@@ -15,4 +15,6 @@ package scala
* An annotation that designates the definition to which it is applied as deprecated.
* Access to the member then generates a deprecated warning.
*/
-class deprecated extends StaticAnnotation {}
+class deprecated(message: String) extends StaticAnnotation {
+ def this() = this("")
+}
diff --git a/src/library/scala/io/Source.scala b/src/library/scala/io/Source.scala
index 03c2e4dc00..b79de507f6 100644
--- a/src/library/scala/io/Source.scala
+++ b/src/library/scala/io/Source.scala
@@ -145,8 +145,8 @@ object Source {
/**
* @param s ...
* @return ...
- * @deprecated use fromURL(s, enc)
*/
+ @deprecated("use fromURL(s, enc)")
def fromURL(s: String): Source =
fromURL(new URL(s))
@@ -158,8 +158,8 @@ object Source {
/**
* @param url the source URL
* @return ...
- * @deprecated use fromURL(url, enc)
*/
+ @deprecated("use fromURL(url, enc)")
def fromURL(url: URL): Source = {
val it = new Iterator[Char] {
var data: Int = _
diff --git a/src/library/scala/package.scala b/src/library/scala/package.scala
index d4130b3920..7bec5ae8ac 100755
--- a/src/library/scala/package.scala
+++ b/src/library/scala/package.scala
@@ -2,10 +2,8 @@ package object scala {
type Iterable[+A] = scala.collection.Iterable[A]
val Iterable = scala.collection.Iterable
- /** @deprecated use Iterable instead */
- @deprecated type Collection[+A] = Iterable[A]
- /** @deprecated use Iterable instead */
- @deprecated val Collection = Iterable
+ @deprecated("use Iterable instead") type Collection[+A] = Iterable[A]
+ @deprecated("use Iterable instead") val Collection = Iterable
type Seq[+A] = scala.collection.Sequence[A]
val Seq = scala.collection.Sequence
diff --git a/src/library/scala/reflect/BeanInfo.scala b/src/library/scala/reflect/BeanInfo.scala
index eea808b6bd..a2249c818b 100644
--- a/src/library/scala/reflect/BeanInfo.scala
+++ b/src/library/scala/reflect/BeanInfo.scala
@@ -11,8 +11,8 @@
package scala.reflect
/** <p>
- * This attribute indicates that a JavaBean-compliant BeanInfo
- * class should be generated for this attributed Scala class.
+ * This annotation indicates that a JavaBean-compliant BeanInfo
+ * class should be generated for this annotated Scala class.
* A val becomes a read-only property. A var becomes a read-write
* property. A def becomes a method.
* </p>
diff --git a/src/library/scala/reflect/BeanInfoSkip.scala b/src/library/scala/reflect/BeanInfoSkip.scala
index b3c7a1dfa8..f7717a8825 100644
--- a/src/library/scala/reflect/BeanInfoSkip.scala
+++ b/src/library/scala/reflect/BeanInfoSkip.scala
@@ -10,7 +10,7 @@
package scala.reflect
-/** This attribute indicates that bean information should
+/** This annotation indicates that bean information should
* <strong>not</strong> be generated for the val, var, or def that it is
* attached to.
*
diff --git a/src/library/scala/reflect/BeanProperty.scala b/src/library/scala/reflect/BeanProperty.scala
index 6c432fbd03..1c75cb02fc 100644
--- a/src/library/scala/reflect/BeanProperty.scala
+++ b/src/library/scala/reflect/BeanProperty.scala
@@ -12,7 +12,7 @@
package scala.reflect
/** <p>
- * This attribute adds a setter and a getter method, following the
+ * This annotation adds a setter and a getter method, following the
* Java Bean convention (first letter of the property is capitalized)
* used by popular Java web frameworks. For example:
* </p><pre>
diff --git a/src/library/scala/runtime/BoxedArray.scala b/src/library/scala/runtime/BoxedArray.scala
index 91651a9cec..d13c08ba38 100644
--- a/src/library/scala/runtime/BoxedArray.scala
+++ b/src/library/scala/runtime/BoxedArray.scala
@@ -139,6 +139,6 @@ abstract class BoxedArray[A] extends Vector[A] with VectorTemplate[A, BoxedArray
(count, memo)
}
- /** @deprecated use slice instead */
- @deprecated def subArray(from: Int, end: Int): BoxedArray[A] = slice(from, end)
+ @deprecated("use slice instead")
+ def subArray(from: Int, end: Int): BoxedArray[A] = slice(from, end)
}
diff --git a/src/library/scala/testing/SUnit.scala b/src/library/scala/testing/SUnit.scala
index 1a333397a7..2cb8517527 100644
--- a/src/library/scala/testing/SUnit.scala
+++ b/src/library/scala/testing/SUnit.scala
@@ -44,13 +44,10 @@ import scala.collection.mutable.ArrayBuffer
* a <code>main</code> method, for convenience.
* </p>
*
- * @deprecated SUnit will be removed in 2.8.0. There are several free and
- * sophisticated testing frameworks for Scala available, examples are
- * "ScalaTest", "ScalaCheck" or "Specs".
- *
* @author Burak Emir
*/
-@deprecated
+@deprecated("SUnit will be removed in 2.8.0. There are several free and sophisticated testing\n"+
+ "frameworks for Scala available, examples are \"ScalaTest\", \"ScalaCheck\" or \"Specs\".")
object SUnit {
/** <p>
diff --git a/src/library/scala/unsealed.scala b/src/library/scala/unsealed.scala
index ad021eda1f..847c2d3e1d 100644
--- a/src/library/scala/unsealed.scala
+++ b/src/library/scala/unsealed.scala
@@ -11,7 +11,5 @@
package scala
-/** @deprecated use <a href="unchecked.html">
- * <code>@unchecked</code></a> instead.
- */
-@deprecated class unsealed extends Annotation
+@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
index a465184bc0..54907e037e 100644
--- a/src/library/scala/util/parsing/input/CharArrayPosition.scala
+++ b/src/library/scala/util/parsing/input/CharArrayPosition.scala
@@ -18,9 +18,8 @@ package scala.util.parsing.input
* @param columm The column number of the position (1-based)
*
* @author Martin Odersky, Adriaan Moors
- * @deprecated; use OffsetPosition instead
*/
-@deprecated
+@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:
diff --git a/src/library/scala/util/parsing/input/CharArrayReader.scala b/src/library/scala/util/parsing/input/CharArrayReader.scala
index 8562ffe150..360820608c 100644
--- a/src/library/scala/util/parsing/input/CharArrayReader.scala
+++ b/src/library/scala/util/parsing/input/CharArrayReader.scala
@@ -17,8 +17,8 @@ package scala.util.parsing.input
object CharArrayReader {
final val EofCh = '\032'
- /** @deprecated This should probably be LF instead? */
- @deprecated final val CR = '\015'
+ @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 635585f79c..42f71cd981 100644
--- a/src/library/scala/xml/Utility.scala
+++ b/src/library/scala/xml/Utility.scala
@@ -82,9 +82,8 @@ object Utility extends AnyRef with parsing.TokenTests
case _ => n
}
- /** @deprecated a string might also be Atom(s) - define your own conversion
- */
- @deprecated def view(s: String): Text = Text(s)
+ @deprecated("a string might also be Atom(s) - define your own conversion")
+ def view(s: String): Text = Text(s)
/**
* Escapes the characters &lt; &gt; &amp; and &quot; from string.