Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SI-8251 Remove ListBuffer.readOnly as deprecated #4140

Merged
merged 1 commit into from
Nov 21, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/library/scala/collection/mutable/BufferLike.scala
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,6 @@ trait BufferLike[A, +This <: BufferLike[A, This] with Buffer[A]]
*/
override def stringPrefix: String = "Buffer"

/** Returns the current evolving(!) state of this buffer as a read-only sequence.
*
* @return A sequence that forwards to this buffer for all its operations.
*/
@deprecated("The returned sequence changes as this buffer is mutated. For an immutable copy, use, e.g., toList.", "2.11.0")
def readOnly: scala.collection.Seq[A] = toSeq

/** Creates a new collection containing both the elements of this collection and the provided
* traversable object.
*
Expand Down
2 changes: 0 additions & 2 deletions src/library/scala/collection/mutable/BufferProxy.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ trait BufferProxy[A] extends Buffer[A] with Proxy {
*/
def +=(elem: A): this.type = { self.+=(elem); this }

override def readOnly = self.readOnly

/** Appends a number of elements provided by a traversable object.
*
* @param xs the traversable object.
Expand Down
5 changes: 1 addition & 4 deletions src/library/scala/collection/mutable/ListBuffer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,6 @@ final class ListBuffer[A]
}
}

@deprecated("The result of this method will change along with this buffer, which is often not what's expected.", "2.11.0")
override def readOnly: List[A] = start

// Private methods

/** Copy contents of this buffer */
Expand All @@ -426,7 +423,7 @@ final class ListBuffer[A]
}

override def equals(that: Any): Boolean = that match {
case that: ListBuffer[_] => this.readOnly equals that.readOnly
case that: ListBuffer[_] => this.start equals that.start
case _ => super.equals(that)
}

Expand Down