Reviewers: scottb, rjrjr,
Description:
Rolling back r9354 due to some GWTTestCase breakages
Please review this at http://gwt-code-reviews.appspot.com/1188801/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 9356)
+++ dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
(working copy)
@@ -1018,7 +1018,10 @@
// Get the bytes, compiling if necessary.
byte[] classBytes = findClassBytes(className);
-
+ if (classBytes == null) {
+ throw new ClassNotFoundException(className);
+ }
+
if (HasAnnotation.hasAnnotation(classBytes, GwtScriptOnly.class)) {
scriptOnlyClasses.add(className);
maybeInitializeScriptOnlyClassLoader();
@@ -1110,7 +1113,7 @@
}
@SuppressWarnings("deprecation")
- private byte[] findClassBytes(String className) throws
ClassNotFoundException {
+ private byte[] findClassBytes(String className) {
if (JavaScriptHost.class.getName().equals(className)) {
// No need to rewrite.
return javaScriptHostBytes;
@@ -1133,12 +1136,6 @@
CompilationUnit unit = (compiledClass == null)
? getUnitForClassName(lookupClassName) : compiledClass.getUnit();
-
- if (unit != null && unit.isError()) {
- throw new ClassNotFoundException("Cannot load class " + className
- + " because it has errors.");
- }
-
if (emmaAvailable) {
/*
* build the map for anonymous classes. Do so only if unit has
anonymous
@@ -1151,10 +1148,11 @@
&& unit.hasAnonymousClasses() && jsniMethods != null
&& jsniMethods.size() > 0 && !unit.createdClassMapping()) {
if (!unit.constructAnonymousClassMappings(logger)) {
- throw new ClassNotFoundException(
+ logger.log(TreeLogger.ERROR,
"Our heuristic for mapping anonymous classes between
compilers "
+ "failed. Unsafe to continue because the wrong jsni
code "
+ "could end up running. className = " + className);
+ return null;
}
}
}
@@ -1200,10 +1198,6 @@
}
}
classBytes = newBytes;
- }
-
- if (classBytes == null) {
- throw new ClassNotFoundException(className);
}
return classBytes;
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors