Reviewers: zundel, jbrosenberg,
Message:
Fixes a bug where invalid types in the chain can break assumptions.
This is a problem in a case like this:
Good unit:
Foo.init();
Bad unit:
public class Foo implements UnknownType { ... }
The good unit itself doesn't have errors, but trying to construct the
heirarchy Foo blows things up. This fix just heads it off at the pass
to allow the compile to fail with proper error reporting.
Please review this at http://gwt-code-reviews.appspot.com/1466806/
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
2d9976395d87bd2e34c2f5324ce74ad2a1d13b22..017fe78aff705ab437e6f206435d183bac124206
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
@@ -141,14 +141,16 @@ public class ReferenceMapper {
JDeclaredType declType = createType(refBinding);
if (declType instanceof JClassType) {
ReferenceBinding superclass = refBinding.superclass();
- if (superclass != null) {
+ if (superclass != null && superclass.isValidBinding()) {
((JClassType) declType).setSuperClass((JClassType)
get(superclass));
}
}
ReferenceBinding[] superInterfaces = refBinding.superInterfaces();
if (superInterfaces != null) {
for (ReferenceBinding intf : superInterfaces) {
- declType.addImplements((JInterfaceType) get(intf));
+ if (intf.isValidBinding()) {
+ declType.addImplements((JInterfaceType) get(intf));
+ }
}
}
// Emulate clinit method for super clinit calls.
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors