Skip to content

Commit

Permalink
LDEV-4905 - add a lock so only one thread can access at time for a ce…
Browse files Browse the repository at this point in the history
…rtain class
  • Loading branch information
michaeloffner committed Jun 28, 2024
1 parent 1bb6ddc commit 0a27f40
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
22 changes: 12 additions & 10 deletions core/src/main/java/lucee/commons/lang/ClassUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -917,19 +917,21 @@ public Class<?> loadClass(String className, Class defaultValue) {

@Override
public Class<?> loadClass(String className, Class defaultValue, Set<Throwable> exceptions) {
className = className.trim();
try {
return cl.loadClass(className);
}
catch (Exception e) {
synchronized (SystemUtil.createToken("clbcl", className)) {
className = className.trim();
try {
return Class.forName(className, false, cl);
return cl.loadClass(className);
}
catch (Exception e2) {
if (exceptions != null) {
exceptions.add(e2);
catch (Exception e) {
try {
return Class.forName(className, false, cl);
}
catch (Exception e2) {
if (exceptions != null) {
exceptions.add(e2);
}
return defaultValue;
}
return defaultValue;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion loader/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project default="core" basedir="." name="Lucee"
xmlns:resolver="antlib:org.apache.maven.resolver.ant">

<property name="version" value="5.4.7.0-SNAPSHOT"/>
<property name="version" value="5.4.7.1-SNAPSHOT"/>

<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
<classpath>
Expand Down
2 changes: 1 addition & 1 deletion loader/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.lucee</groupId>
<artifactId>lucee</artifactId>
<version>5.4.7.0-SNAPSHOT</version>
<version>5.4.7.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down

0 comments on commit 0a27f40

Please sign in to comment.