Reviewers: scottb,
Description:
In CompilingClassLoader, refuse to load a class if its compilation unit
has errors.
Please review this at http://gwt-code-reviews.appspot.com/1167801/show
Affected files:
M dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
Index: dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
===================================================================
--- dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
(revision 9312)
+++ dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
(working copy)
@@ -1070,6 +1070,13 @@
*/
while (toInject.size() > 0) {
CompilationUnit unit = toInject.remove(0);
+ if (unit.isError()) {
+ logger.log(TreeLogger.ERROR,
+ "Cannot inject JSNI code in compilation unit "
+ + unit.getTypeName() + " at " +
unit.getDisplayLocation()
+ + " for class " + className);
+ return null;
+ }
if (!alreadyInjected.contains(unit)) {
injectJsniMethods(unit);
alreadyInjected.add(unit);
@@ -1136,6 +1143,12 @@
CompilationUnit unit = (compiledClass == null)
? getUnitForClassName(lookupClassName) : compiledClass.getUnit();
+
+ if (unit != null && unit.isError()) {
+ logger.log(TreeLogger.ERROR, "Cannot load class " + className + "
because it has errors.");
+ return null;
+ }
+
if (emmaAvailable) {
/*
* build the map for anonymous classes. Do so only if unit has
anonymous
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors