Skip to content

Commit

Permalink
LDEV-5103 - fix NPE and add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Oct 11, 2024
1 parent 60224ea commit 56cd864
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,16 @@ public String[] getArguments() {
public Class[] getArgumentClasses() {
if (argClasses == null) {
ClassLoader cl = Clazz.getClassLoader(this.declaringClass);
argClasses = new Class[argTypes.length];
Class[] tmp = new Class[argTypes.length];
for (int i = 0; i < argTypes.length; i++) {
try {

argClasses[i] = Clazz.toClass(cl, argTypes[i]);
tmp[i] = Clazz.toClass(cl, argTypes[i]);
}
catch (ClassException e) {
throw new PageRuntimeException(e);
}
}
argClasses = tmp;
}
return argClasses;
}
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="6.2.0.98-SNAPSHOT"/>
<property name="version" value="6.2.0.99-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>6.2.0.98-SNAPSHOT</version>
<version>6.2.0.99-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Lucee Loader Build</name>
Expand Down
25 changes: 25 additions & 0 deletions test/tickets/LDEV5103.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
component extends="org.lucee.cfml.test.LuceeTestCase" skip="true" {

function run( testResults , testBox ) {
describe( title='LDEV-5103', body=function(){

it( title='concurrency issue in Clazz.getArgumentClasses', body=function() {
var names=[];
loop from=1 to=100 index="local.i" {
var name="t5103-#i#";
arrayAppend(names, name);
thread name="#name#" {
variables.dateParser = createObject("java", "java.text.SimpleDateFormat").init("yyyy-MM-dd'T'HH:mm:ssX");
}
}

thread action="join" name=names.toList();
loop array=names item="name" {
if(structKeyExists(cfthread[name],"ERROR")) throw cfthread[name].error;
}
});

});
}

}

0 comments on commit 56cd864

Please sign in to comment.