Reviewers: zundel,
Please review this at http://gwt-code-reviews.appspot.com/1461804/
Affected files:
M dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
Index: dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
b/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
index
017fe78aff705ab437e6f206435d183bac124206..e8d863b6e6790ab3b0193ccf6515589ebaf52ae5
100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java
@@ -41,6 +41,7 @@ import
org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
import org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.eclipse.jdt.internal.compiler.lookup.SyntheticArgumentBinding;
import org.eclipse.jdt.internal.compiler.lookup.TypeBinding;
+import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import java.util.ArrayList;
import java.util.HashMap;
@@ -139,19 +140,30 @@ public class ReferenceMapper {
} else {
ReferenceBinding refBinding = (ReferenceBinding) binding;
JDeclaredType declType = createType(refBinding);
- if (declType instanceof JClassType) {
- ReferenceBinding superclass = refBinding.superclass();
- if (superclass != null && superclass.isValidBinding()) {
- ((JClassType) declType).setSuperClass((JClassType)
get(superclass));
+ try {
+ if (declType instanceof JClassType) {
+ ReferenceBinding superclass = refBinding.superclass();
+ if (superclass != null && superclass.isValidBinding()) {
+ ((JClassType) declType).setSuperClass((JClassType)
get(superclass));
+ }
}
- }
- ReferenceBinding[] superInterfaces = refBinding.superInterfaces();
- if (superInterfaces != null) {
- for (ReferenceBinding intf : superInterfaces) {
- if (intf.isValidBinding()) {
- declType.addImplements((JInterfaceType) get(intf));
+ ReferenceBinding[] superInterfaces = refBinding.superInterfaces();
+ if (superInterfaces != null) {
+ for (ReferenceBinding intf : superInterfaces) {
+ if (intf.isValidBinding()) {
+ declType.addImplements((JInterfaceType) get(intf));
+ }
}
}
+ } catch (AbortCompilation ignored) {
+ /*
+ * The currently-compiling unit has no errors; however, we're
running
+ * into a case where it references something with a bad hierarchy.
This
+ * doesn't cause an error in the current unit, but it does mean we
run
+ * into a wall here trying to construct the hierarchy. Catch the
error
+ * so that compilation can proceed; the error units themselves will
+ * eventually cause the full compile to error out.
+ */
}
// Emulate clinit method for super clinit calls.
JMethod clinit =
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors