Revision: 10329
Author:   [email protected]
Date:     Mon Jun 13 13:06:50 2011
Log:      Allow binary-only references for compile-time constants.

Like we do for binary-only annotations, this change allows binary-only references for compile-time constants. We don't actually need source in the GWT compiler, JDT embeds the constant value in the unit we do compile.

http://gwt-code-reviews.appspot.com/1447825/

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

Modified:
/trunk/dev/core/src/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsChecker.java

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsChecker.java Tue Nov 10 20:41:18 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsChecker.java Mon Jun 13 13:06:50 2011
@@ -22,6 +22,7 @@
 import org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation;
 import org.eclipse.jdt.internal.compiler.ast.NormalAnnotation;
 import org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation;
+import org.eclipse.jdt.internal.compiler.impl.Constant;
 import org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
 import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
 import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
@@ -93,6 +94,10 @@
     @Override
     protected void onBinaryTypeRef(BinaryTypeBinding binding,
         CompilationUnitDeclaration unitOfReferrer, Expression expression) {
+ if (expression.constant != null && expression.constant != Constant.NotAConstant) {
+        // Const expressions are ok, no source needed.
+        return;
+      }
       binaryTypeReferenceSites.add(new BinaryTypeReferenceSite(expression,
           binding));
     }

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

Reply via email to