Index: compiler/java/com/google/dart/compiler/util/StringInterner.java |
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/html/parser/TestAll.java b/compiler/java/com/google/dart/compiler/util/StringInterner.java |
similarity index 61% |
copy from editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/html/parser/TestAll.java |
copy to compiler/java/com/google/dart/compiler/util/StringInterner.java |
index 59291181a3b19caabb2e19e756b35f7a303ff950..e33118e9266818403dc362a5eca75928d273beab 100644 |
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/html/parser/TestAll.java |
+++ b/compiler/java/com/google/dart/compiler/util/StringInterner.java |
@@ -11,17 +11,21 @@ |
* or implied. See the License for the specific language governing permissions and limitations under |
* the License. |
*/ |
-package com.google.dart.engine.html.parser; |
-import com.google.dart.engine.ExtendedTestSuite; |
+package com.google.dart.compiler.util; |
-import junit.framework.Test; |
-import junit.framework.TestSuite; |
+import com.google.common.collect.Interner; |
+import com.google.common.collect.Interners; |
-public class TestAll { |
- public static Test suite() { |
- TestSuite suite = new ExtendedTestSuite("Tests in " + TestAll.class.getPackage().getName()); |
- suite.addTestSuite(HtmlParserTest.class); |
- return suite; |
+public class StringInterner { |
+ private static Interner<String> INTERNER = Interners.newStrongInterner(); |
+ |
+ public static String intern(String s) { |
+ if (s == null) { |
+ return null; |
+ } |
+ s = new String(s); |
+ return INTERNER.intern(s); |
+// return s; |
} |
} |