diff options
author | Simon Ochsenreither <simon@ochsenreither.de> | 2011-12-07 17:20:29 +0100 |
---|---|---|
committer | Simon Ochsenreither <simon@ochsenreither.de> | 2011-12-07 21:40:49 +0100 |
commit | 60b90b18d6407b886ed9f12061406fd3ece05e29 (patch) | |
tree | 9dc557c387063597c6bf3058666e28495770480e /src/library/scala/collection/mutable/SetLike.scala | |
parent | 332fec96e31840878bed41dd7b5314b97d8da7c2 (diff) | |
download | scala-60b90b18d6407b886ed9f12061406fd3ece05e29.tar.gz scala-60b90b18d6407b886ed9f12061406fd3ece05e29.tar.bz2 scala-60b90b18d6407b886ed9f12061406fd3ece05e29.zip |
Migration message and version cleanup
The @migration annotation can now be used like @deprecation.
Old syntax is still supported, but deprecated.
Improve wording and consistency of migration messages, migration
warnings also print the version in which the change occurred now.
Partially fixes SI-4990.
Diffstat (limited to 'src/library/scala/collection/mutable/SetLike.scala')
-rw-r--r-- | src/library/scala/collection/mutable/SetLike.scala | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/library/scala/collection/mutable/SetLike.scala b/src/library/scala/collection/mutable/SetLike.scala index c5eeb1ae7f..5e201d9959 100644 --- a/src/library/scala/collection/mutable/SetLike.scala +++ b/src/library/scala/collection/mutable/SetLike.scala @@ -141,10 +141,7 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] * @param elem the element to add. * @return a new set consisting of elements of this set and `elem`. */ - @migration(2, 8, - "As of 2.8, this operation creates a new set. To add an element as a\n"+ - "side effect to an existing set and return that set itself, use +=." - ) + @migration("`+` creates a new set. Use `+=` to add an element to this set and return that set itself.", "2.8.0") override def + (elem: A): This = clone() += elem /** Creates a new set consisting of all the elements of this set and two or more @@ -158,10 +155,7 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] * @return a new set consisting of all the elements of this set, `elem1`, * `elem2` and those in `elems`. */ - @migration(2, 8, - "As of 2.8, this operation creates a new set. To add the elements as a\n"+ - "side effect to an existing set and return that set itself, use +=." - ) + @migration("`+` creates a new set. Use `+=` to add an element to this set and return that set itself.", "2.8.0") override def + (elem1: A, elem2: A, elems: A*): This = clone() += elem1 += elem2 ++= elems @@ -173,10 +167,7 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] * @param xs the traversable object. * @return a new set consisting of elements of this set and those in `xs`. */ - @migration(2, 8, - "As of 2.8, this operation creates a new set. To add the elements as a\n"+ - "side effect to an existing set and return that set itself, use ++=." - ) + @migration("`++` creates a new set. Use `++=` to add elements to this set and return that set itself.", "2.8.0") override def ++(xs: GenTraversableOnce[A]): This = clone() ++= xs.seq @bridge def ++(xs: TraversableOnce[A]): This = ++(xs: GenTraversableOnce[A]) @@ -186,10 +177,7 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] * @param elem the element to remove. * @return a new set consisting of all the elements of this set except `elem`. */ - @migration(2, 8, - "As of 2.8, this operation creates a new set. To remove the element as a\n"+ - "side effect to an existing set and return that set itself, use -=." - ) + @migration("`-` creates a new set. Use `-=` to remove an element from this set and return that set itself.", "2.8.0") override def -(elem: A): This = clone() -= elem /** Creates a new set consisting of all the elements of this set except the two @@ -201,10 +189,7 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] * @return a new set consisting of all the elements of this set except * `elem1`, `elem2` and `elems`. */ - @migration(2, 8, - "As of 2.8, this operation creates a new set. To remove the elements as a\n"+ - "side effect to an existing set and return that set itself, use -=." - ) + @migration("`-` creates a new set. Use `-=` to remove an element from this set and return that set itself.", "2.8.0") override def -(elem1: A, elem2: A, elems: A*): This = clone() -= elem1 -= elem2 --= elems @@ -215,10 +200,7 @@ trait SetLike[A, +This <: SetLike[A, This] with Set[A]] * @return a new set consisting of all the elements of this set except * elements from `xs`. */ - @migration(2, 8, - "As of 2.8, this operation creates a new set. To remove the elements as a\n"+ - "side effect to an existing set and return that set itself, use --=." - ) + @migration("`--` creates a new set. Use `--=` to remove elements from this set and return that set itself.", "2.8.0") override def --(xs: GenTraversableOnce[A]): This = clone() --= xs.seq @bridge def --(xs: TraversableOnce[A]): This = --(xs: GenTraversableOnce[A]) |