Revision: 10392
Author:   [email protected]
Date:     Fri Jun 24 09:10:50 2011
Log:      Ignore invalid types in heirarchy.

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.
http://gwt-code-reviews.appspot.com/1466806/

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

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java Tue Jun 14 15:18:26 2011 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ReferenceMapper.java Fri Jun 24 09:10:50 2011
@@ -141,14 +141,16 @@
       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

Reply via email to