Revision: 8848
Author: [email protected]
Date: Wed Sep 22 14:10:47 2010
Log: Rolls back r8845, "Reduce DevMode memory footprint by using a WeakInterner
for potentially duplicated strings," due to NullPointerExceptions in gwtc

Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=8848

Deleted:
 /trunk/dev/core/src/com/google/gwt/dev/util/StringInterner.java
Modified:
 /trunk/dev/build.xml
 /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JAbstractMethod.java
 /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JArrayType.java
 /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JField.java
 /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JParameter.java
 /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java
 /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JTypeParameter.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/CompiledClass.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/Dependencies.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/MethodArgNamesLookup.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java
 /trunk/dev/core/src/com/google/gwt/dev/javac/asm/CollectClassData.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JParameter.java
 /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsName.java
 /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsNameRef.java
 /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsScope.java
 /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsStringLiteral.java
 /trunk/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefixSet.java
 /trunk/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java
 /trunk/dev/core/src/com/google/gwt/dev/shell/DispatchClassInfo.java
 /trunk/eclipse/dev/.classpath

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/util/StringInterner.java Wed Sep 22 11:03:58 2010
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.google.gwt.dev.util;
-
-import com.google.gwt.thirdparty.guava.common.collect.Interner;
-import com.google.gwt.thirdparty.guava.common.collect.Interners;
-
-/**
- * A utility class for reducing String memory waste. Note that this does not use - * the String.intern() method which would prevent GC and fill the PermGen space.
- * Instead, we use a Google Collections WeakInterner.
- */
-public class StringInterner {
-  private static final StringInterner instance = new StringInterner();
-
-  public static StringInterner get() {
-    return instance;
-  }
-
-  private final Interner<String> stringPool = Interners.newWeakInterner();
-
-  protected StringInterner() {
-  }
-
-  public String intern(String s) {
-    return stringPool.intern(s);
-  }
-
-}
=======================================
--- /trunk/dev/build.xml        Wed Sep 22 11:03:58 2010
+++ /trunk/dev/build.xml        Wed Sep 22 14:10:47 2010
@@ -108,7 +108,6 @@
           <include name="w3c/sac/sac-1.3.jar" />
           <!-- htmlunit dependencies not already included: END -->
           <include name="sun/swingworker/swing-worker-1.1.jar" />
-          <include name="guava/guava-r06/guava-r06-rebased.jar" />
         </fileset>
         <fileset file="build.xml"/>
       </sourcefiles>
@@ -171,7 +170,6 @@
           <zipfileset src="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
           <!-- htmlunit dependencies not already included: END -->
<zipfileset src="${gwt.tools.lib}/sun/swingworker/swing-worker-1.1.jar" /> - <zipfileset src="${gwt.tools.lib}/guava/guava-r06/guava-r06-rebased.jar" />
         </gwt.jar>
       </sequential>
     </outofdate>
@@ -209,7 +207,6 @@
           <pathelement location="${gwt.tools.lib}/eclipse/jdt-3.4.2.jar" />
<pathelement location="${gwt.tools.lib}/tomcat/commons-collections-3.1.jar" />
           <pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
- <pathelement location="${gwt.tools.lib}/guava/guava-r06/guava-r06-rebased.jar" />
       </classpath>
     </gwt.javac>

=======================================
--- /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JAbstractMethod.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JAbstractMethod.java Wed Sep 22 14:10:47 2010
@@ -15,7 +15,6 @@
  */
 package com.google.gwt.core.ext.typeinfo;

-import com.google.gwt.dev.util.StringInterner;
 import com.google.gwt.dev.util.collect.Lists;

 import java.lang.annotation.Annotation;
@@ -56,7 +55,7 @@
   JAbstractMethod(String name,
       Map<Class<? extends Annotation>, Annotation> declaredAnnotations,
       JTypeParameter[] jtypeParameters) {
-    this.name = StringInterner.get().intern(name);
+    this.name = name;
     annotations = new Annotations(declaredAnnotations);

     if (jtypeParameters != null) {
@@ -240,13 +239,7 @@
     for (int i = 0; i < n; ++i) {
       // Identity tests are ok since identity is durable within an oracle.
       if (params.get(i) == parameter) {
-        String realParameterName;
-        if (realParameterNames == null) {
-          realParameterName = StringInterner.get().intern("arg" + i);
-        } else {
- realParameterName = StringInterner.get().intern(realParameterNames[i]);
-        }
-        return realParameterName;
+ return realParameterNames == null ? "arg" + i : realParameterNames[i];
       }
     }
     // TODO: report error if we are asked for an unknown JParameter?
=======================================
--- /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JArrayType.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JArrayType.java Wed Sep 22 14:10:47 2010
@@ -15,8 +15,6 @@
  */
 package com.google.gwt.core.ext.typeinfo;

-import com.google.gwt.dev.util.StringInterner;
-
 import java.lang.annotation.Annotation;
 import java.util.Map;

@@ -207,8 +205,7 @@
   @Override
   public String getSimpleSourceName() {
     if (lazySimpleName == null) {
-      lazySimpleName = StringInterner.get().intern(
-          getComponentType().getSimpleSourceName() + "[]");
+      lazySimpleName = getComponentType().getSimpleSourceName() + "[]";
     }
     return lazySimpleName;
   }
=======================================
--- /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JField.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JField.java Wed Sep 22 14:10:47 2010
@@ -15,8 +15,6 @@
  */
 package com.google.gwt.core.ext.typeinfo;

-import com.google.gwt.dev.util.StringInterner;
-
 import java.lang.annotation.Annotation;
 import java.util.Map;

@@ -52,7 +50,7 @@
       Map<Class<? extends Annotation>, Annotation> declaredAnnotations) {
     assert (enclosingType != null);
     this.enclosingType = enclosingType;
-    this.name = StringInterner.get().intern(name);
+    this.name = name;
     this.enclosingType.addField(this);
     annotations = new Annotations(declaredAnnotations);
   }
=======================================
--- /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JParameter.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JParameter.java Wed Sep 22 14:10:47 2010
@@ -15,8 +15,6 @@
  */
 package com.google.gwt.core.ext.typeinfo;

-import com.google.gwt.dev.util.StringInterner;
-
 import java.lang.annotation.Annotation;
 import java.util.Map;

@@ -39,7 +37,7 @@
   JParameter(JAbstractMethod enclosingMethod, JParameter srcParam) {
     this.enclosingMethod = enclosingMethod;
     this.type = srcParam.type;
-    this.name = StringInterner.get().intern(srcParam.name);
+    this.name = srcParam.name;
     this.annotations = new Annotations(srcParam.annotations);
   }

@@ -58,7 +56,7 @@
       boolean argNameIsReal) {
     this.enclosingMethod = enclosingMethod;
     this.type = type;
-    this.name = StringInterner.get().intern(name);
+    this.name = name;
     this.argNameIsReal = argNameIsReal;

     enclosingMethod.addParameter(this);
@@ -125,7 +123,7 @@

   // Only called by JAbstractMethod after real parameter names are fetched.
   void setName(String name) {
-    this.name = StringInterner.get().intern(name);
+    this.name = name;
   }

   // Called when parameter types are found to be parameterized
=======================================
--- /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JRealClassType.java Wed Sep 22 14:10:47 2010
@@ -15,7 +15,6 @@
  */
 package com.google.gwt.core.ext.typeinfo;

-import com.google.gwt.dev.util.StringInterner;
 import com.google.gwt.dev.util.collect.IdentitySets;
 import com.google.gwt.dev.util.collect.Lists;

@@ -76,7 +75,7 @@
       String enclosingTypeName, String name, boolean isInterface) {
     this.oracle = oracle;
     this.declaringPackage = declaringPackage;
-    this.name = StringInterner.get().intern(name);
+    this.name = name;
     this.isInterface = isInterface;
     if (enclosingTypeName == null) {
       // Add myself to my package.
@@ -245,7 +244,6 @@
       } else {
         lazyQualifiedName = nestedName;
       }
-      lazyQualifiedName = StringInterner.get().intern(lazyQualifiedName);
     }
     return lazyQualifiedName;
   }
=======================================
--- /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JTypeParameter.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/core/ext/typeinfo/JTypeParameter.java Wed Sep 22 14:10:47 2010
@@ -15,8 +15,6 @@
  */
 package com.google.gwt.core.ext.typeinfo;

-import com.google.gwt.dev.util.StringInterner;
-
 import java.util.ArrayList;
 import java.util.List;

@@ -30,7 +28,7 @@
   private final String typeName;

   public JTypeParameter(String typeName, int ordinal) {
-    this.typeName = StringInterner.get().intern(typeName);
+    this.typeName = typeName;
     this.ordinal = ordinal;
   }

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java Wed Sep 22 14:10:47 2010
@@ -22,7 +22,6 @@
 import com.google.gwt.dev.javac.JdtCompiler.UnitProcessor;
 import com.google.gwt.dev.js.ast.JsProgram;
 import com.google.gwt.dev.resource.Resource;
-import com.google.gwt.dev.util.StringInterner;
 import com.google.gwt.dev.util.log.speedtracer.DevModeEventType;
 import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger;
 import com.google.gwt.dev.util.log.speedtracer.SpeedTracerLogger.Event;
@@ -82,25 +81,21 @@

MethodArgNamesLookup methodArgs = MethodParamCollector.collect(cud);

-        StringInterner interner = StringInterner.get();
-        String packageName = interner.intern(
-            Shared.getPackageName(builder.getTypeName()));
+        String packageName = Shared.getPackageName(builder.getTypeName());
         List<String> unresolvedQualified = new ArrayList<String>();
         List<String> unresolvedSimple = new ArrayList<String>();
for (char[] simpleRef : cud.compilationResult().simpleNameReferences) {
-          unresolvedSimple.add(interner.intern(String.valueOf(simpleRef)));
-        }
-        for (char[][] qualifiedRef :
-            cud.compilationResult().qualifiedReferences) {
-          unresolvedQualified.add(
-              interner.intern(CharOperation.toString(qualifiedRef)));
+          unresolvedSimple.add(canonical(String.valueOf(simpleRef)));
+        }
+ for (char[][] qualifiedRef : cud.compilationResult().qualifiedReferences) { + unresolvedQualified.add(canonical(CharOperation.toString(qualifiedRef)));
         }
         for (String jsniDep : jsniDeps) {
-          unresolvedQualified.add(interner.intern(jsniDep));
+          unresolvedQualified.add(canonical(jsniDep));
         }
         ArrayList<String> apiRefs = compiler.collectApiRefs(cud);
         for (int i = 0; i < apiRefs.size(); ++i) {
-          apiRefs.set(i, interner.intern(apiRefs.get(i)));
+          apiRefs.set(i, canonical(apiRefs.get(i)));
         }
         Dependencies dependencies = new Dependencies(packageName,
             unresolvedQualified, unresolvedSimple, apiRefs);
@@ -123,6 +118,15 @@
         }
         newlyBuiltUnits.add(unit);
       }
+
+      private String canonical(String str) {
+        String result = internedTypeNames.get(str);
+        if (result != null) {
+          return result;
+        }
+        internedTypeNames.put(str, str);
+        return str;
+      }
     }

     /**
@@ -138,6 +142,14 @@
     private final JdtCompiler compiler = new JdtCompiler(
         new UnitProcessorImpl());

+    /**
+     * Memory efficiency only. Stores canonical versions of dependency type
+ * names so that String instances can be shared among many units. Otherwise, + * we'd get many duplicate String objects since we have to build them from
+     * JDT's char arrays.
+     */
+ private final Map<String, String> internedTypeNames = new HashMap<String, String>();
+
     /**
      * Continuation state for JSNI checking.
      */
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/CompiledClass.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/CompiledClass.java Wed Sep 22 14:10:47 2010
@@ -17,7 +17,6 @@

 import com.google.gwt.dev.util.DiskCache;
 import com.google.gwt.dev.util.Name.InternalName;
-import com.google.gwt.dev.util.StringInterner;

 import org.eclipse.jdt.core.compiler.CharOperation;
 import org.eclipse.jdt.internal.compiler.ClassFile;
@@ -65,8 +64,7 @@
   CompiledClass(ClassFile classFile, CompiledClass enclosingClass) {
     this.enclosingClass = enclosingClass;
     SourceTypeBinding binding = classFile.referenceBinding;
-    this.internalName = StringInterner.get().intern(
-        CharOperation.charToString(binding.constantPoolName()));
+ this.internalName = CharOperation.charToString(binding.constantPoolName());
     byte[] bytes = classFile.getBytes();
     this.cacheToken = diskCache.writeByteArray(bytes);
     this.isLocal = isLocalType(binding);
@@ -101,7 +99,7 @@
    * Returns the qualified source name, e.g. {...@code java.util.Map.Entry}.
    */
   public String getSourceName() {
- return StringInterner.get().intern(InternalName.toSourceName(internalName));
+    return InternalName.toSourceName(internalName);
   }

   public CompilationUnit getUnit() {
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/Dependencies.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/Dependencies.java Wed Sep 22 14:10:47 2010
@@ -15,7 +15,6 @@
  */
 package com.google.gwt.dev.javac;

-import com.google.gwt.dev.util.StringInterner;
 import com.google.gwt.dev.util.collect.HashMap;
 import com.google.gwt.dev.util.collect.Lists;

@@ -50,8 +49,7 @@
    */
   Dependencies(String myPackage, List<String> unresolvedQualified,
       List<String> unresolvedSimple, List<String> apiRefs) {
-    this.myPackage = StringInterner.get().intern(
-        (myPackage.length() == 0) ? "" : (myPackage + '.'));
+    this.myPackage = (myPackage.length() == 0) ? "" : (myPackage + '.');
     this.unresolvedQualified = unresolvedQualified;
     this.unresolvedSimple = unresolvedSimple;
     this.apiRefs = apiRefs;
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/MethodArgNamesLookup.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/MethodArgNamesLookup.java Wed Sep 22 14:10:47 2010
@@ -17,7 +17,6 @@

 import com.google.gwt.core.ext.typeinfo.JAbstractMethod;
 import com.google.gwt.dev.javac.asm.CollectMethodData;
-import com.google.gwt.dev.util.StringInterner;
 import com.google.gwt.dev.util.collect.Maps;

 import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
@@ -85,13 +84,12 @@
     int n = method.arguments.length;
     String[] argNames = new String[n];
     for (int i = 0; i < n; ++i) {
-      argNames[i] = StringInterner.get().intern(
-          String.valueOf(method.arguments[i].name));
+      argNames[i] = String.valueOf(method.arguments[i].name);
     }
     StringBuilder buf = new StringBuilder();
     buf.append(enclosingType).append('.').append(method.selector);
     buf.append(method.binding.signature());
-    String key = StringInterner.get().intern(buf.toString());
+    String key = buf.toString();
     methodArgs.put(key, argNames);
   }
 }
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/asm/CollectAnnotationData.java Wed Sep 22 14:10:47 2010
@@ -17,7 +17,6 @@

 import com.google.gwt.dev.asm.AnnotationVisitor;
 import com.google.gwt.dev.javac.asm.CollectClassData.AnnotationEnum;
-import com.google.gwt.dev.util.StringInterner;

 import java.util.ArrayList;
 import java.util.HashMap;
@@ -38,12 +37,12 @@
     private final boolean visible;

     protected AnnotationData(String desc, boolean visible) {
-      this.desc = StringInterner.get().intern(desc);
+      this.desc = desc;
       this.visible = visible;
     }

     public void addValue(String name, Object value) {
-      values.put(StringInterner.get().intern(name), value);
+      values.put(name, value);
     }

     /**
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/asm/CollectClassData.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/asm/CollectClassData.java Wed Sep 22 14:10:47 2010
@@ -21,7 +21,6 @@
 import com.google.gwt.dev.asm.Opcodes;
 import com.google.gwt.dev.asm.commons.EmptyVisitor;
 import com.google.gwt.dev.util.Name;
-import com.google.gwt.dev.util.StringInterner;

 import java.util.ArrayList;
 import java.util.List;
@@ -115,8 +114,8 @@
      * @param value actual value in this enum
      */
     public AnnotationEnum(String desc, String value) {
-      this.desc = StringInterner.get().intern(desc);
-      this.value = StringInterner.get().intern(value);
+      this.desc = desc;
+      this.value = value;
     }

     /**
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JMethod.java Wed Sep 22 14:10:47 2010
@@ -17,7 +17,6 @@

 import com.google.gwt.dev.jjs.InternalCompilerException;
 import com.google.gwt.dev.jjs.SourceInfo;
-import com.google.gwt.dev.util.StringInterner;
 import com.google.gwt.dev.util.collect.Lists;

 import java.io.IOException;
@@ -79,7 +78,7 @@
JType returnType, boolean isAbstract, boolean isStatic, boolean isFinal,
       boolean isPrivate) {
     super(info);
-    this.name = StringInterner.get().intern(name);
+    this.name = name;
     this.enclosingType = enclosingType;
     this.returnType = returnType;
     this.isAbstract = isAbstract;
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JParameter.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JParameter.java Wed Sep 22 14:10:47 2010
@@ -16,7 +16,6 @@
 package com.google.gwt.dev.jjs.ast;

 import com.google.gwt.dev.jjs.SourceInfo;
-import com.google.gwt.dev.util.StringInterner;

 /**
  * Java method parameter definition.
@@ -29,8 +28,8 @@
     assert (type != null);
     assert (enclosingMethod != null);

- JParameter x = new JParameter(info, StringInterner.get().intern(name), type,
-        isFinal, isThis, enclosingMethod);
+    JParameter x = new JParameter(info, name, type, isFinal, isThis,
+        enclosingMethod);

     enclosingMethod.addParam(x);
     return x;
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsName.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsName.java Wed Sep 22 14:10:47 2010
@@ -16,7 +16,6 @@
 package com.google.gwt.dev.js.ast;

 import com.google.gwt.dev.jjs.SourceInfo;
-import com.google.gwt.dev.util.StringInterner;

 import java.io.Serializable;

@@ -41,8 +40,8 @@
    */
   JsName(JsScope enclosing, String ident, String shortIdent) {
     this.enclosing = enclosing;
-    this.ident = StringInterner.get().intern(ident);
-    this.shortIdent = StringInterner.get().intern(shortIdent);
+    this.ident = ident;
+    this.shortIdent = shortIdent;
     this.isObfuscatable = true;
   }

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsNameRef.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsNameRef.java Wed Sep 22 14:10:47 2010
@@ -16,7 +16,6 @@
 package com.google.gwt.dev.js.ast;

 import com.google.gwt.dev.jjs.SourceInfo;
-import com.google.gwt.dev.util.StringInterner;

 /**
  * Represents a JavaScript expression that references a name.
@@ -37,7 +36,7 @@

   public JsNameRef(SourceInfo sourceInfo, String ident) {
     super(sourceInfo);
-    this.ident = StringInterner.get().intern(ident);
+    this.ident = ident;
   }

   public String getIdent() {
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsScope.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsScope.java Wed Sep 22 14:10:47 2010
@@ -16,7 +16,6 @@
 package com.google.gwt.dev.js.ast;

 import com.google.gwt.dev.js.JsKeywords;
-import com.google.gwt.dev.util.StringInterner;
 import com.google.gwt.dev.util.collect.Lists;
 import com.google.gwt.dev.util.collect.Maps;

@@ -60,7 +59,7 @@
     if (JsKeywords.isKeyword(ident)) {
       ident = ident + "_$";
     }
-    return StringInterner.get().intern(ident);
+    return ident;
   }

   private List<JsScope> children = Collections.emptyList();
@@ -73,7 +72,7 @@
    */
   public JsScope(JsScope parent, String description) {
     assert (parent != null);
-    this.description = StringInterner.get().intern(description);
+    this.description = description;
     this.parent = parent;
     parent.children = Lists.add(parent.children, this);
   }
@@ -82,7 +81,7 @@
    * Subclasses can be parentless.
    */
   protected JsScope(String description) {
-    this.description = StringInterner.get().intern(description);
+    this.description = description;
     this.parent = null;
   }

@@ -201,8 +200,6 @@
    * Creates a new name in this scope.
    */
   protected JsName doCreateName(String ident, String shortIdent) {
-    ident = StringInterner.get().intern(ident);
-    shortIdent = StringInterner.get().intern(shortIdent);
     JsName name = new JsName(this, ident, shortIdent);
     names = Maps.putOrdered(names, ident, name);
     return name;
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsStringLiteral.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/js/ast/JsStringLiteral.java Wed Sep 22 14:10:47 2010
@@ -16,7 +16,6 @@
 package com.google.gwt.dev.js.ast;

 import com.google.gwt.dev.jjs.SourceInfo;
-import com.google.gwt.dev.util.StringInterner;

 /**
  * A JavaScript string literal expression.
@@ -28,7 +27,7 @@
   // These only get created by JsProgram so that they can be interned.
   JsStringLiteral(SourceInfo sourceInfo, String value) {
     super(sourceInfo);
-    this.value = StringInterner.get().intern(value);
+    this.value = value;
   }

   public String getValue() {
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefixSet.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/resource/impl/PathPrefixSet.java Wed Sep 22 14:10:47 2010
@@ -15,7 +15,6 @@
  */
 package com.google.gwt.dev.resource.impl;

-import com.google.gwt.dev.util.StringInterner;
 import com.google.gwt.dev.util.collect.Maps;

 import java.util.ArrayList;
@@ -43,11 +42,10 @@
     private PathPrefix prefix;

     public TrieNode(String part) {
-      this.part = StringInterner.get().intern(part);
+      this.part = part;
     }

     public TrieNode addChild(String part) {
-      part = StringInterner.get().intern(part);
       TrieNode newChild = new TrieNode(part);
       assert !children.containsKey(part);
       children = Maps.put(children, part, newChild);
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/resource/impl/ZipFileResource.java Wed Sep 22 14:10:47 2010
@@ -15,8 +15,6 @@
  */
 package com.google.gwt.dev.resource.impl;

-import com.google.gwt.dev.util.StringInterner;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.zip.ZipEntry;
@@ -33,7 +31,7 @@
   public ZipFileResource(ZipFileClassPathEntry classPathEntry, String path,
       long lastModified) {
     this.classPathEntry = classPathEntry;
-    this.path = StringInterner.get().intern(path);
+    this.path = path;
     this.lastModified = lastModified;
   }

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/shell/DispatchClassInfo.java Wed Sep 22 11:03:58 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/shell/DispatchClassInfo.java Wed Sep 22 14:10:47 2010
@@ -16,7 +16,6 @@
 package com.google.gwt.dev.shell;

 import com.google.gwt.dev.util.JsniRef;
-import com.google.gwt.dev.util.StringInterner;

 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
@@ -83,8 +82,7 @@
private void addMemberIfUnique(String name, List<Member> membersForName) {
     if (membersForName.size() == 1) {
       memberById.add(membersForName.get(0));
-      memberIdByName.put(
-          StringInterner.get().intern(name), memberById.size() - 1);
+      memberIdByName.put(name, memberById.size() - 1);
     }
   }

@@ -184,8 +182,7 @@
     }
     sb.append(")");

-    String mangledName = StringInterner.get().intern(sb.toString());
-
+    String mangledName = sb.toString();
     return mangledName;
   }

=======================================
--- /trunk/eclipse/dev/.classpath       Wed Sep 22 11:03:58 2010
+++ /trunk/eclipse/dev/.classpath       Wed Sep 22 14:10:47 2010
@@ -40,6 +40,5 @@
<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-r5940/htmlunit-core-js-r5940.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5940/htmlunit-core-js-r5940-sources.jar"/> <classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-r5940/htmlunit-r5940.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5940/htmlunit-r5940-sources.jar"/> <classpathentry kind="var" path="GWT_TOOLS/lib/protobuf/protobuf-2.2.0/protobuf-java-rebased-2.2.0.jar"/> - <classpathentry kind="var" path="GWT_TOOLS/lib/guava/guava-r06/guava-r06-rebased.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to