Allowing null clinit.
Review at http://gwt-code-reviews.appspot.com/310803
Review by: spoon@google.com
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7900 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/ast/JDeclaredType.java b/dev/core/src/com/google/gwt/dev/jjs/ast/JDeclaredType.java
index 8913b09..f118c81 100755
--- a/dev/core/src/com/google/gwt/dev/jjs/ast/JDeclaredType.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/ast/JDeclaredType.java
@@ -16,6 +16,7 @@
package com.google.gwt.dev.jjs.ast;
import com.google.gwt.dev.jjs.SourceInfo;
+import com.google.gwt.dev.util.Preconditions;
import com.google.gwt.dev.util.collect.Lists;
import java.io.IOException;
@@ -287,10 +288,15 @@
if (clinitTarget == newClinitTarget) {
return;
}
- if (getClass().desiredAssertionStatus()) {
+ if (newClinitTarget != null && getClass().desiredAssertionStatus()) {
// Make sure this is a pure upgrade to a superclass or null.
for (JDeclaredType current = clinitTarget; current != newClinitTarget; current = current.getSuperClass()) {
- assert current.getSuperClass() != null;
+ Preconditions.checkNotNull(current.getSuperClass(),
+ "Null super class for: %s (currentTarget: %s; newTarget: %s) in %s",
+ current,
+ clinitTarget,
+ newClinitTarget,
+ this);
}
}
clinitTarget = newClinitTarget;