Skip to content

Commit

Permalink
Merge branch '6.2' of https://github.com/lucee/Lucee into 6.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	loader/build.xml
#	loader/pom.xml
  • Loading branch information
michaeloffner committed Dec 20, 2024
2 parents a29534a + 91a71fe commit d2f116e
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,21 @@ public Resource getCanonicalResource() throws IOException {
return new FileResource(provider, getCanonicalPath());
}

public String getCanonicalPath() {
try {
// java 12 performance regression LDEV-5218
if (SystemUtil.JAVA_VERSION > SystemUtil.JAVA_VERSION_11 )
return Path.of(getPath()).toAbsolutePath().normalize().toString();
return super.getCanonicalPath();
}
catch (IOException e) {
return getAbsolutePath();
}
catch (java.nio.file.InvalidPathException ipe) {
return getPath();
}
}

@Override
public Resource getParentResource() {
String p = getParent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@ public static Resource getCanonicalResourceEL(Resource res) {
public static File getCanonicalFileEL(File file) {
if (file == null) return file;
try {
if (SystemUtil.JAVA_VERSION > SystemUtil.JAVA_VERSION_11 )
return file.getAbsoluteFile();
return file.getCanonicalFile();
}
catch (IOException e) {
Expand Down
23 changes: 13 additions & 10 deletions core/src/main/java/lucee/commons/lang/ClassUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,17 @@ public static Class toClass(PageContext pc, String className) throws ClassExcept
}

private static Class checkPrimaryTypesBytecodeDef(String className, Class defaultValue) {
if (className.charAt(0) == '[') {
if (className.equals("[V")) return void.class;
if (className.equals("[Z")) return boolean.class;
if (className.equals("[B")) return byte.class;
if (className.equals("[I")) return int.class;
if (className.equals("[J")) return long.class;
if (className.equals("[F")) return float.class;
if (className.equals("[D")) return double.class;
if (className.equals("[C")) return char.class;
if (className.equals("[S")) return short.class;
if (className.length() == 2 && className.charAt(0) == '[') {
char pt = className.charAt(1);
if (pt == 'V') return void.class;
if (pt == 'Z') return boolean.class;
if (pt == 'B') return byte.class;
if (pt == 'I') return int.class;
if (pt == 'J') return long.class;
if (pt == 'F') return float.class;
if (pt == 'D') return double.class;
if (pt == 'C') return char.class;
if (pt == 'S') return short.class;
}
return defaultValue;
}
Expand All @@ -98,6 +99,8 @@ private static Class checkPrimaryTypes(String className, Class defaultValue) {
isRef = true;
}

if (lcClassName.length() > 9) return defaultValue; // short circuit longest below match is "character"

if (lcClassName.equals("void")) {
return void.class;
}
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/resource/setting/sysprop-envvar.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@
"sysprop": "lucee.dump.threads",
"envvar": "LUCEE_DUMP_THREADS",
"desc": "Used for debugging, when enabled, it will dump out running threads to the console via the background controller thread"
},
{
"sysprop": "lucee.scope.local.capacity",
"envvar": "LUCEE_SCOPE_LOCAL_CAPACITY",
"desc": "Sets the initial capacity (size) for the local scope hashmap"
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.231-SNAPSHOT"/>
<property name="version" value="6.2.0.234-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.231-SNAPSHOT</version>
<version>6.2.0.234-SNAPSHOT</version>
<packaging>jar</packaging>

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

0 comments on commit d2f116e

Please sign in to comment.