summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorChristoffer Sawicki <christoffer.sawicki@gmail.com>2013-12-29 18:25:36 +0100
committerChristoffer Sawicki <christoffer.sawicki@gmail.com>2013-12-29 18:25:36 +0100
commit2fe767806b44aea3f6f53735301b11fd2ffae08b (patch)
tree849db5839282a03b332f738b4501e3e824e188f2 /src/library
parent780ceca6a39ddb2d9ba632cc8153c737707a75eb (diff)
downloadscala-2fe767806b44aea3f6f53735301b11fd2ffae08b.tar.gz
scala-2fe767806b44aea3f6f53735301b11fd2ffae08b.tar.bz2
scala-2fe767806b44aea3f6f53735301b11fd2ffae08b.zip
SI-8107: Use Regex.quote
Diffstat (limited to 'src/library')
-rw-r--r--src/library/scala/Enumeration.scala4
-rw-r--r--src/library/scala/collection/immutable/StringLike.scala4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/library/scala/Enumeration.scala b/src/library/scala/Enumeration.scala
index 59be0cdfa3..d4b9c17eab 100644
--- a/src/library/scala/Enumeration.scala
+++ b/src/library/scala/Enumeration.scala
@@ -11,7 +11,7 @@ package scala
import scala.collection.{ mutable, immutable, generic, SortedSetLike, AbstractSet }
import java.lang.reflect.{ Modifier, Method => JMethod, Field => JField }
import scala.reflect.NameTransformer._
-import java.util.regex.Pattern
+import scala.util.matching.Regex
/** Defines a finite set of values specific to the enumeration. Typically
* these values enumerate all possible forms something can take and provide
@@ -64,7 +64,7 @@ abstract class Enumeration (initial: Int) extends Serializable {
*/
override def toString =
((getClass.getName stripSuffix MODULE_SUFFIX_STRING split '.').last split
- Pattern.quote(NAME_JOIN_STRING)).last
+ Regex.quote(NAME_JOIN_STRING)).last
/** The mapping from the integer used to identify values to the actual
* values. */
diff --git a/src/library/scala/collection/immutable/StringLike.scala b/src/library/scala/collection/immutable/StringLike.scala
index 5a0d24ddd2..43d46cf4d0 100644
--- a/src/library/scala/collection/immutable/StringLike.scala
+++ b/src/library/scala/collection/immutable/StringLike.scala
@@ -164,8 +164,8 @@ self =>
* @return the resulting string
*/
def replaceAllLiterally(literal: String, replacement: String): String = {
- val arg1 = java.util.regex.Pattern.quote(literal)
- val arg2 = java.util.regex.Matcher.quoteReplacement(replacement)
+ val arg1 = Regex.quote(literal)
+ val arg2 = Regex.quoteReplacement(replacement)
toString.replaceAll(arg1, arg2)
}