Fix build break by removing newly added String method
replace(CharSequence,CharSequence) and its associated tests, since they are
failing on Safari2.
Patch by: jat
Commited without review.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@2188 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/super/com/google/gwt/emul/java/lang/String.java b/user/super/com/google/gwt/emul/java/lang/String.java
index 197e5cb..e404e09 100644
--- a/user/super/com/google/gwt/emul/java/lang/String.java
+++ b/user/super/com/google/gwt/emul/java/lang/String.java
@@ -516,12 +516,13 @@
return this.replace(RegExp(regex, "g"), String.fromCharCode(to));
}-*/;
- public String replace(CharSequence from, CharSequence to) {
- // Escape regex special characters from literal replacement string.
- String regex = from.toString().replaceAll("([/\\\\\\.\\*\\+\\?\\|\\(\\)\\[\\]\\{\\}])",
- "\\\\$1");
- return replaceAll(regex, to.toString());
- }
+ // TODO(jat): fails on Safari 2 -- to be fixed for 1.5RC1
+// public String replace(CharSequence from, CharSequence to) {
+// // Escape regex special characters from literal replacement string.
+// String regex = from.toString().replaceAll("([/\\\\\\.\\*\\+\\?\\|\\(\\)\\[\\]\\{\\}])",
+// "\\\\$1");
+// return replaceAll(regex, to.toString());
+// }
/**
* Regular expressions vary from the standard implementation. The
diff --git a/user/test/com/google/gwt/emultest/java/lang/StringTest.java b/user/test/com/google/gwt/emultest/java/lang/StringTest.java
index 53fc23a..48dcb5c 100644
--- a/user/test/com/google/gwt/emultest/java/lang/StringTest.java
+++ b/user/test/com/google/gwt/emultest/java/lang/StringTest.java
@@ -326,9 +326,9 @@
assertEquals("dog food", dogFood.replace('\u0120', ' '));
String testStr = String.valueOf(new char[] {'\u1111', 'B', '\u1111', 'B', '\u1111', 'B'});
assertEquals("ABABAB", testStr.replace('\u1111', 'A'));
- assertEquals("foobar", hideFromCompiler("bazbar").replace("baz", "foo"));
- assertEquals("$0bar", hideFromCompiler("foobar").replace("foo", "$0"));
- assertEquals("+1", hideFromCompiler("*[)1").replace("*[)", "+"));
+// assertEquals("foobar", hideFromCompiler("bazbar").replace("baz", "foo"));
+// assertEquals("$0bar", hideFromCompiler("foobar").replace("foo", "$0"));
+// assertEquals("+1", hideFromCompiler("*[)1").replace("*[)", "+"));
}
public void testReplaceAll() {