Revision: 9633
Author: [email protected]
Date: Wed Jan 26 16:52:13 2011
Log: Adds accessibility to certain GWT AST nodes.

http://code.google.com/p/google-web-toolkit/source/detail?r=9633

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JClassLiteral.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JConstructor.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JInterfaceType.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JStringLiteral.java
 /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java
 /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JClassLiteral.java Mon Oct 18 12:52:42 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JClassLiteral.java Wed Jan 26 16:52:13 2011
@@ -169,10 +169,7 @@
   private final JField field;
   private final JType refType;

-  /**
-   * This constructor is only used by {@link JProgram}.
-   */
-  JClassLiteral(SourceInfo sourceInfo, JType type, JField field) {
+  public JClassLiteral(SourceInfo sourceInfo, JType type, JField field) {
     super(sourceInfo);
     refType = type;
     this.field = field;
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JConstructor.java Thu Mar 11 17:23:20 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JConstructor.java Wed Jan 26 16:52:13 2011
@@ -30,15 +30,9 @@
    */
   private boolean isEmpty = false;

-  private JNonNullType newType;
-
-  /**
-   * These are only supposed to be constructed by JProgram.
-   */
- JConstructor(SourceInfo info, JClassType enclosingType, JNonNullType newType) {
+  public JConstructor(SourceInfo info, JClassType enclosingType) {
     super(info, enclosingType.getShortName(), enclosingType,
         JPrimitiveType.VOID, false, false, true, false);
-    this.newType = newType;
   }

   @Override
@@ -57,7 +51,7 @@
   }

   public JNonNullType getNewType() {
-    return newType;
+    return getEnclosingType().getNonNull();
   }

   /**
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java Mon Aug 16 15:00:16 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java Wed Jan 26 16:52:13 2011
@@ -50,7 +50,7 @@
   private boolean isThisRef;
   private boolean isVolatile;

- JField(SourceInfo info, String name, JDeclaredType enclosingType, JType type, + public JField(SourceInfo info, String name, JDeclaredType enclosingType, JType type,
       boolean isStatic, Disposition disposition) {
     super(info, name, type, disposition.isFinal());
     this.enclosingType = enclosingType;
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JInterfaceType.java Sat Jan 22 17:19:44 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JInterfaceType.java Wed Jan 26 16:52:13 2011
@@ -22,7 +22,7 @@
  */
 public class JInterfaceType extends JDeclaredType {

-  JInterfaceType(SourceInfo info, String name) {
+  public JInterfaceType(SourceInfo info, String name) {
     super(info, name);
   }

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java Sat Jan 22 17:19:44 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java Wed Jan 26 16:52:13 2011
@@ -357,8 +357,6 @@

private final Map<String, JDeclaredType> typeNameMap = new HashMap<String, JDeclaredType>();

-  private JNonNullType typeNonNullString;
-
   private JClassType typeSpecialClassLiteralHolder;

   private JClassType typeSpecialJavaScriptObject;
@@ -428,7 +426,6 @@
         typeJavaLangObject = x;
       } else if (name.equals("java.lang.String")) {
         typeString = x;
-        typeNonNullString = x.getNonNull();
       } else if (name.equals("java.lang.Enum")) {
         typeJavaLangEnum = x;
       } else if (name.equals("java.lang.Class")) {
@@ -445,8 +442,7 @@

   public JConstructor createConstructor(SourceInfo info,
       JClassType enclosingType) {
-    JConstructor x = new JConstructor(info, enclosingType,
-        enclosingType.getNonNull());
+    JConstructor x = new JConstructor(info, enclosingType);
     x.setBody(new JMethodBody(info));
     if (indexedTypes.containsValue(enclosingType)) {
       indexedMethods.put(enclosingType.getShortName() + '.'
@@ -938,7 +934,7 @@
     JStringLiteral toReturn = stringLiteralMap.get(s);
     if (toReturn == null) {
       toReturn = new JStringLiteral(stringPoolSourceInfo.makeChild(
-          JProgram.class, "String literal: " + s), s, typeNonNullString);
+          JProgram.class, "String literal: " + s), s, typeString);
       stringLiteralMap.put(s, toReturn);
     }
     toReturn.getSourceInfo().merge(sourceInfo);
@@ -1153,7 +1149,7 @@
   }

   public boolean isJavaLangString(JType type) {
-    return type == typeString || type == typeNonNullString;
+    return type == typeString || type == typeString.getNonNull();
   }

   public boolean isJavaScriptObject(JType type) {
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JStringLiteral.java Wed Aug 11 09:22:23 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JStringLiteral.java Wed Jan 26 16:52:13 2011
@@ -22,13 +22,11 @@
  */
 public class JStringLiteral extends JValueLiteral {

-  private final JNonNullType stringType;
+  private final JClassType stringType;
   private final String value;

-  /**
-   * These are only supposed to be constructed by JProgram.
-   */
- JStringLiteral(SourceInfo sourceInfo, String value, JNonNullType stringType) {
+  public JStringLiteral(SourceInfo sourceInfo, String value,
+      JClassType stringType) {
     super(sourceInfo);
     this.value = value;
     this.stringType = stringType;
@@ -40,7 +38,7 @@
   }

   public JNonNullType getType() {
-    return stringType;
+    return stringType.getNonNull();
   }

   public String getValue() {
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java Fri Jan 21 12:22:33 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java Wed Jan 26 16:52:13 2011
@@ -1654,7 +1654,7 @@
       assert (elementDecl.initializer == null);

       JForStatement result;
-      if (x.collection.resolvedType.isArrayType()) {
+      if (x.collectionVariable != null) {
         /**
          * <pre>
          * for (final T[] i$array = collection,
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java Wed Aug 11 09:22:23 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java Wed Jan 26 16:52:13 2011
@@ -22,7 +22,7 @@
 /**
  * Argument handler for processing the output directory flag.
  */
-public final class ArgHandlerOutDir extends ArgHandlerDir {
+public class ArgHandlerOutDir extends ArgHandlerDir {

   private final OptionOutDir option;

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

Reply via email to