Skip to content

Commit

Permalink
0002163: Configured extension with a node group id of ALL is not working
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Jan 27, 2015
1 parent a053743 commit 7aad13f
Showing 1 changed file with 13 additions and 4 deletions.
Expand Up @@ -107,8 +107,13 @@ public Object getCompiledClass(String javaCode) throws Exception {

if (success) {
log.debug("Compilation has succeeded");
javaObject = fileManager.getClassLoader(null).loadClass(className).newInstance();
objectMap.put(id, javaObject);
Class<?> clazz = fileManager.getClassLoader(null).loadClass(className);
if (clazz != null) {
javaObject = clazz.newInstance();
objectMap.put(id, javaObject);
} else {
throw new SimpleClassCompilerException("The '"+className+"' class could not be located");
}
} else {
log.error("Compilation of '" + origClassName + "' failed");
for (Diagnostic diagnostic : diag.getDiagnostics()) {
Expand Down Expand Up @@ -173,8 +178,12 @@ public ClassLoader getClassLoader(Location location) {
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
JavaClassObject jclassObject = jclassObjects.get(name);
byte[] bytes = jclassObject.getBytes();
return super.defineClass(name, bytes, 0, bytes.length);
if (jclassObject != null) {
byte[] bytes = jclassObject.getBytes();
return super.defineClass(name, bytes, 0, bytes.length);
} else {
return null;
}
}
};
}
Expand Down

0 comments on commit 7aad13f

Please sign in to comment.