Revision: 9359
Author: gwt.mirror...@gmail.com
Date: Mon Dec 6 07:55:08 2010
Log: Rolling back r9354 due to some GWTTestCase breakages
Review at http://gwt-code-reviews.appspot.com/1188801
http://code.google.com/p/google-web-toolkit/source/detail?r=9359
Modified:
/trunk/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
Fri Dec 3 05:03:49 2010
+++ /trunk/dev/core/src/com/google/gwt/dev/shell/CompilingClassLoader.java
Fri Dec 3 13:02:53 2010
@@ -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;
}
}
}
@@ -1201,10 +1199,6 @@
}
classBytes = newBytes;
}
-
- if (classBytes == null) {
- throw new ClassNotFoundException(className);
- }
return classBytes;
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors