Skip to content

Commit

Permalink
[DROOLS-890] prevent to use the TypesClassLoader without having acqui…
Browse files Browse the repository at this point in the history
…red a lock on the enclosing ProjectClassLoader
  • Loading branch information
mariofusco committed Aug 31, 2015
1 parent fa1db09 commit 1835185
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -147,7 +147,7 @@ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundE
return cls;
}

Class<?> internalLoadClass(String name, boolean resolve) throws ClassNotFoundException {
private Class<?> internalLoadClass(String name, boolean resolve) throws ClassNotFoundException {
if (CACHE_NON_EXISTING_CLASSES && nonExistingClasses.contains(name)) {
throw dummyCFNE;
}
Expand Down Expand Up @@ -176,7 +176,7 @@ private Class<?> loadType(String name, boolean resolve) throws ClassNotFoundExce
return tryDefineType(name, cnfe);
}

Class<?> tryDefineType(String name, ClassNotFoundException cnfe) throws ClassNotFoundException {
private Class<?> tryDefineType(String name, ClassNotFoundException cnfe) throws ClassNotFoundException {
byte[] bytecode = getBytecode(convertClassToResourcePath(name));
if (bytecode == null) {
if (CACHE_NON_EXISTING_CLASSES) {
Expand Down Expand Up @@ -209,7 +209,7 @@ public Class<?> defineClass(String name, byte[] bytecode) {
return defineClass(name, convertClassToResourcePath(name), bytecode);
}

public Class<?> defineClass(String name, String resourceName, byte[] bytecode) {
public synchronized Class<?> defineClass(String name, String resourceName, byte[] bytecode) {
storeClass(name, resourceName, bytecode);
return defineType(name, bytecode);
}
Expand Down

1 comment on commit 1835185

@psiroky
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.