Fix for NETTY-150 CompactObjectInputStream web start (applet) Class.forName issue

This commit is contained in:
Trustin Lee 2009-05-12 14:09:55 +00:00
parent 3c79744064
commit 23d922fab2

View File

@ -90,7 +90,13 @@ class CompactObjectInputStream extends ObjectInputStream {
protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException {
String name = desc.getName(); String name = desc.getName();
try { try {
return Class.forName(name, false, classLoader); if (classLoader == null) {
return Class.forName(
name, false,
Thread.currentThread().getContextClassLoader());
} else {
return Class.forName(name, false, classLoader);
}
} catch (ClassNotFoundException ex) { } catch (ClassNotFoundException ex) {
return super.resolveClass(desc); return super.resolveClass(desc);
} }