summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-11-18 05:41:16 +0000
committerPaul Phillips <paulp@improving.org>2009-11-18 05:41:16 +0000
commit7bad13f1799234ef8ebdde07f304319d4fd035d2 (patch)
tree46eb278d56028a0018bc514f6f3e44c2dd4422e0 /src/library
parent6a23aa029bb78aa6f769b3daab71bb8330af5f3f (diff)
downloadscala-7bad13f1799234ef8ebdde07f304319d4fd035d2.tar.gz
scala-7bad13f1799234ef8ebdde07f304319d4fd035d2.tar.bz2
scala-7bad13f1799234ef8ebdde07f304319d4fd035d2.zip
More deprecation work.
since 2.7.2 (still except for lower case primitive type aliases) and removes every deprecated method which has never shipped in a release.
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/Array.scala42
-rw-r--r--src/library/scala/Either.scala32
-rw-r--r--src/library/scala/Product.scala3
-rw-r--r--src/library/scala/collection/IterableLike.scala5
-rw-r--r--src/library/scala/collection/Iterator.scala8
-rw-r--r--src/library/scala/collection/SeqLike.scala7
-rw-r--r--src/library/scala/collection/SeqProxyLike.scala1
-rw-r--r--src/library/scala/collection/SetLike.scala8
-rw-r--r--src/library/scala/collection/immutable/List.scala62
-rw-r--r--src/library/scala/collection/immutable/Stack.scala1
-rw-r--r--src/library/scala/collection/immutable/TreeHashMap.scala2
-rw-r--r--src/library/scala/collection/interfaces/SeqMethods.scala1
-rw-r--r--src/library/scala/collection/mutable/BufferLike.scala3
-rw-r--r--src/library/scala/collection/mutable/OpenHashMap.scala3
-rw-r--r--src/library/scala/collection/mutable/Stack.scala1
-rw-r--r--src/library/scala/collection/mutable/StringBuilder.scala35
16 files changed, 0 insertions, 214 deletions
diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala
index a323dccffc..a9f07157a0 100644
--- a/src/library/scala/Array.scala
+++ b/src/library/scala/Array.scala
@@ -397,48 +397,6 @@ object Array extends FallbackArrayBuilding {
}
a
}
-
- /** 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")
- def fromFunction[T: ClassManifest](f: Int => T)(n: Int): Array[T] = {
- val a = new Array[T](n)
- var i = 0
- while (i < n) {
- a(i) = f(i)
- i += 1
- }
- a
- }
-
- /** 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")
- def fromFunction[T: ClassManifest](f: (Int, Int) => T)(n1: Int, n2: Int): Array[Array[T]] =
- 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")
- def fromFunction[T: ClassManifest](f: (Int, Int, Int) => T)(n1: Int, n2: Int, n3: Int): Array[Array[Array[T]]] =
- 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")
- def fromFunction[T: ClassManifest](f: (Int, Int, Int, Int) => T)(n1: Int, n2: Int, n3: Int, n4: Int): Array[Array[Array[Array[T]]]] =
- 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")
- def fromFunction[T: ClassManifest](f: (Int, Int, Int, Int, Int) => T)(n1: Int, n2: Int, n3: Int, n4: Int, n5: Int): Array[Array[Array[Array[Array[T]]]]] =
- fromFunction(i => fromFunction(f(i, _, _, _, _))(n2, n3, n4, n5))(n1)
}
/** This class represents polymorphic arrays. <code>Array[T]</code> is Scala's representation
diff --git a/src/library/scala/Either.scala b/src/library/scala/Either.scala
index cc84685287..e456dab2dd 100644
--- a/src/library/scala/Either.scala
+++ b/src/library/scala/Either.scala
@@ -328,38 +328,6 @@ object Either {
case Right(t) => t
}
- /**
- * 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'")
- 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
- })
-
- /**
- * 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'")
- 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
- })
-
- /** Transforms an Iterable of Eithers into a pair of lists.
- *
- * @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)'")
- 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)
- }
-
/** If the condition satisfies, return the given A in <code>Left</code>,
* otherwise, return the given B in <code>Right</code>.
*/
diff --git a/src/library/scala/Product.scala b/src/library/scala/Product.scala
index ce8f733771..a9ced34768 100644
--- a/src/library/scala/Product.scala
+++ b/src/library/scala/Product.scala
@@ -41,9 +41,6 @@ trait Product extends Equals {
def next() = { val result = productElement(c); c += 1; result }
}
- @deprecated("use productIterator instead")
- def productElements: Iterator[Any] = productIterator
-
/**
* By default the empty string. Implementations may override this
* method in order to prepend a string prefix to the result of the
diff --git a/src/library/scala/collection/IterableLike.scala b/src/library/scala/collection/IterableLike.scala
index 2946426748..1a17c9b7b0 100644
--- a/src/library/scala/collection/IterableLike.scala
+++ b/src/library/scala/collection/IterableLike.scala
@@ -360,11 +360,6 @@ self =>
*/
override def view(from: Int, until: Int) = view.slice(from, until)
- @deprecated("use `head' instead") def first: A = head
-
- /** <code>None</code> if iterable is empty. */
- @deprecated("use `headOption' instead") def firstOption: Option[A] = headOption
-
/**
* 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
diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala
index ea186c7a7e..20573ca3ab 100644
--- a/src/library/scala/collection/Iterator.scala
+++ b/src/library/scala/collection/Iterator.scala
@@ -48,14 +48,6 @@ object Iterator {
*/
def apply[A](elems: A*): Iterator[A] = elems.iterator
- /** Concatenates the given argument iterators into a single iterator.
- *
- * @param its the argument iterators that are to be concatenated
- * @return the concatenation of all the argument iterators
- */
- @deprecated("use <code>++</code>")
- def concat[A](xss: Iterator[A]*): Iterator[A] = xss.iterator.flatten
-
/** An iterator that returns the results of some element computation a number of times.
* @param len The number of elements returned
* @param elem The element computation determinining each result
diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala
index 661f7b7a04..65b4bb016c 100644
--- a/src/library/scala/collection/SeqLike.scala
+++ b/src/library/scala/collection/SeqLike.scala
@@ -293,9 +293,6 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
*/
def reverseIterator: Iterator[A] = toCollection(reverse).iterator
- @deprecated("use `reverseIterator' instead")
- def reversedElements = reverseIterator
-
/**
* Checks whether the argument sequence is contained at the
* specified index within the receiver object.
@@ -613,10 +610,6 @@ trait SeqLike[+A, +Repr] extends IterableLike[A, Repr] { self =>
*/
override def toString = super[IterableLike].toString
- /** Returns index of the last element satisying a predicate, or -1. */
- @deprecated("use `lastIndexWhere' instead")
- def findLastIndexOf(p: A => Boolean): Int = lastIndexWhere(p)
-
@deprecated("Should be replaced by <code>(s1, s2) forall { case (x, y) => f(x, y) }</code>")
def equalsWith[B](that: Seq[B])(f: (A,B) => Boolean): Boolean = {
val i = this.iterator
diff --git a/src/library/scala/collection/SeqProxyLike.scala b/src/library/scala/collection/SeqProxyLike.scala
index 1ca3bfa155..06bae39aef 100644
--- a/src/library/scala/collection/SeqProxyLike.scala
+++ b/src/library/scala/collection/SeqProxyLike.scala
@@ -56,7 +56,6 @@ trait SeqProxyLike[+A, +This <: SeqLike[A, This] with Seq[A]] extends SeqLike[A,
override def indices: Range = self.indices
override def view = self.view
override def view(from: Int, until: Int) = self.view(from, until)
- override def findLastIndexOf(p: A => Boolean): Int = self.lastIndexWhere(p)
override def equalsWith[B](that: Seq[B])(f: (A,B) => Boolean): Boolean = (self zip that) forall { case (x,y) => f(x,y) }
override def containsSlice[B](that: Seq[B]): Boolean = self.indexOfSeq(that) != -1
}
diff --git a/src/library/scala/collection/SetLike.scala b/src/library/scala/collection/SetLike.scala
index 0752f4185f..0b123b0c90 100644
--- a/src/library/scala/collection/SetLike.scala
+++ b/src/library/scala/collection/SetLike.scala
@@ -105,14 +105,6 @@ self =>
*/
def &(that: Set[A]): This = intersect(that)
- /** This method is an alias for <code>intersect</code>.
- * It computes an intersection with set <code>that</code>.
- * It removes all the elements that are not present in <code>that</code>.
- *
- * @param that the set to intersect with
- */
- @deprecated("use & instead") def ** (that: Set[A]): This = intersect(that)
-
/** The union of this set and the given set <code>that</code>.
*
* @param that the set of elements to add
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala
index f1546f1f0f..d60ea0f58b 100644
--- a/src/library/scala/collection/immutable/List.scala
+++ b/src/library/scala/collection/immutable/List.scala
@@ -555,68 +555,6 @@ object List extends SeqFactory[List] {
b.toList
}
- /** Transforms a list of pairs into a pair of lists.
- *
- * @param xs the list of pairs to unzip
- * @return a pair of lists.
- */
- @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
- while (!xc.isEmpty) {
- b1 += xc.head._1
- b2 += xc.head._2
- xc = xc.tail
- }
- (b1.toList, b2.toList)
- }
-
- /** Transforms an iterable of pairs into a pair of lists.
- *
- * @param xs the iterable of pairs to unzip
- * @return a pair of lists.
- */
- @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")
- 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
- })
-
- /**
- * Returns the <code>Right</code> values in the given<code>Iterable</code> of <code>Either</code>s.
- */
- @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
- })
-
- /** Transforms an Iterable of Eithers into a pair of lists.
- *
- * @param xs the iterable of Eithers to separate
- * @return a pair of lists.
- */
- @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)
- }
-
/** Converts an iterator to a list.
*
* @param it the iterator to convert
diff --git a/src/library/scala/collection/immutable/Stack.scala b/src/library/scala/collection/immutable/Stack.scala
index 2813bc6656..288b1707cb 100644
--- a/src/library/scala/collection/immutable/Stack.scala
+++ b/src/library/scala/collection/immutable/Stack.scala
@@ -69,7 +69,6 @@ class Stack[+A] protected (protected val elems: List[A]) extends Seq[A] {
*
* @param elems the iterator object.
* @return the stack with the new elements on top.
- * @deprecated
*/
def pushAll[B >: A](elems: Iterator[B]): Stack[B] =
((this: Stack[B]) /: elems)(_ push _)
diff --git a/src/library/scala/collection/immutable/TreeHashMap.scala b/src/library/scala/collection/immutable/TreeHashMap.scala
index d991df196f..6b4f728925 100644
--- a/src/library/scala/collection/immutable/TreeHashMap.scala
+++ b/src/library/scala/collection/immutable/TreeHashMap.scala
@@ -177,8 +177,6 @@ private[collection] sealed abstract class AssocMap[Key, +Value] extends immutabl
def iterator : Iterator[(Key, Value)] = new AssocMapIterator(this)
- @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); }
case Nil() => {}
diff --git a/src/library/scala/collection/interfaces/SeqMethods.scala b/src/library/scala/collection/interfaces/SeqMethods.scala
index 8256c5304c..c7c138c2c3 100644
--- a/src/library/scala/collection/interfaces/SeqMethods.scala
+++ b/src/library/scala/collection/interfaces/SeqMethods.scala
@@ -48,7 +48,6 @@ trait SeqMethods[+A, +This <: SeqLike[A, This] with Seq[A]] extends IterableMeth
def reverse: This
def reverseIterator: Iterator[A]
def segmentLength(p: A => Boolean, from: Int): Int
- def slice(from: Int): Seq[A]
def startsWith[B](that: Seq[B]): Boolean
def startsWith[B](that: Seq[B], offset: Int): Boolean
def union[B >: A, That](that: Seq[B])(implicit bf: CanBuildFrom[This, B, That]): That
diff --git a/src/library/scala/collection/mutable/BufferLike.scala b/src/library/scala/collection/mutable/BufferLike.scala
index 3a92f4f7da..20c2d67658 100644
--- a/src/library/scala/collection/mutable/BufferLike.scala
+++ b/src/library/scala/collection/mutable/BufferLike.scala
@@ -139,9 +139,6 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]]
*/
def ++=:(iter: Iterator[A]): This = { insertAll(0, iter.toSeq); this }
- @deprecated("use ++=: instead")
- final def ++:(iter: Iterator[A]): This = ++=:(iter)
-
/** Appends elements to this buffer.
*
* @param elems the elements to append.
diff --git a/src/library/scala/collection/mutable/OpenHashMap.scala b/src/library/scala/collection/mutable/OpenHashMap.scala
index 044ae59fd8..5582d48355 100644
--- a/src/library/scala/collection/mutable/OpenHashMap.scala
+++ b/src/library/scala/collection/mutable/OpenHashMap.scala
@@ -189,9 +189,6 @@ class OpenHashMap[Key, Value](initialSize : Int) extends scala.collection.mutabl
}
}
- @deprecated("use `iterator' instead")
- override def elements: Iterator[(Key, Value)] = iterator
-
override def clone : OpenHashMap[Key, Value] = {
val it = new OpenHashMap[Key, Value]
foreachUndeletedEntry(entry => it.put(entry.key, entry.hash, entry.value.get));
diff --git a/src/library/scala/collection/mutable/Stack.scala b/src/library/scala/collection/mutable/Stack.scala
index 6e7205c3fa..5725580139 100644
--- a/src/library/scala/collection/mutable/Stack.scala
+++ b/src/library/scala/collection/mutable/Stack.scala
@@ -62,7 +62,6 @@ class Stack[A] private (var elems: List[A]) extends scala.collection.Seq[A] with
*
* @param elems the iterator object.
* @return the stack with the new elements on top.
- * @deprecated
*/
def pushAll(elems: Iterator[A]): this.type = { for (elem <- elems) { push(elem); () }; this }
diff --git a/src/library/scala/collection/mutable/StringBuilder.scala b/src/library/scala/collection/mutable/StringBuilder.scala
index 47bac8ad47..b216e24c5d 100644
--- a/src/library/scala/collection/mutable/StringBuilder.scala
+++ b/src/library/scala/collection/mutable/StringBuilder.scala
@@ -92,11 +92,6 @@ 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\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.
* If the current capacity is less than the argument, then a new internal
@@ -297,11 +292,6 @@ 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\n"+
- "possible confusion with `append(Any)'.")
- def append(x: Seq[Char]): StringBuilder =
- appendAll(x)
-
/** <p>
* Appends the string representation of the <code>Char</code> array
* argument to this sequence.
@@ -318,11 +308,6 @@ 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\n"+
- "of the possible confusion with `append(Any)'.")
- def append(x: Array[Char]): StringBuilder =
- appendAll(x)
-
/** <p>
* Appends the string representation of a subarray of the
* <code>char</code> array argument to this sequence.
@@ -346,11 +331,6 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
this
}
- @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>
* Appends the string representation of the <code>Boolean</code>
* argument to the sequence.
@@ -478,11 +458,6 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
this
}
- @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>
* Inserts the string representation of the <code>Any</code>
* argument into this character sequence.
@@ -537,11 +512,6 @@ 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\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
* argument into this sequence.
*
@@ -561,11 +531,6 @@ final class StringBuilder(initCapacity: Int, private val initValue: String)
this
}
- @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>
* Inserts the string representation of the <code>Boolean</code> argument
* into this sequence.