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: zundel@google.com git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@10329 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsChecker.java b/dev/core/src/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsChecker.java index 3a36580..569de81 100644 --- a/dev/core/src/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsChecker.java +++ b/dev/core/src/com/google/gwt/dev/javac/BinaryTypeReferenceRestrictionsChecker.java
@@ -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)); }