diff --git a/core/src/main/java/lucee/commons/io/res/type/file/FileResource.java b/core/src/main/java/lucee/commons/io/res/type/file/FileResource.java index 7dd7ba36b3..449f4e4064 100644 --- a/core/src/main/java/lucee/commons/io/res/type/file/FileResource.java +++ b/core/src/main/java/lucee/commons/io/res/type/file/FileResource.java @@ -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(); diff --git a/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java b/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java index cb9b533acf..945168c78e 100755 --- a/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java +++ b/core/src/main/java/lucee/commons/io/res/util/ResourceUtil.java @@ -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) { diff --git a/core/src/main/java/lucee/commons/lang/ClassUtil.java b/core/src/main/java/lucee/commons/lang/ClassUtil.java index 8e4354f6f4..bc1cf1b71c 100644 --- a/core/src/main/java/lucee/commons/lang/ClassUtil.java +++ b/core/src/main/java/lucee/commons/lang/ClassUtil.java @@ -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; } @@ -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; } diff --git a/core/src/main/java/resource/setting/sysprop-envvar.json b/core/src/main/java/resource/setting/sysprop-envvar.json index c1369ccb4a..fe31d2867f 100644 --- a/core/src/main/java/resource/setting/sysprop-envvar.json +++ b/core/src/main/java/resource/setting/sysprop-envvar.json @@ -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" diff --git a/loader/build.xml b/loader/build.xml index 7f9f99779e..aaa6de1a61 100644 --- a/loader/build.xml +++ b/loader/build.xml @@ -2,7 +2,7 @@ - + diff --git a/loader/pom.xml b/loader/pom.xml index e7214df3b6..93f282213f 100644 --- a/loader/pom.xml +++ b/loader/pom.xml @@ -3,7 +3,7 @@ org.lucee lucee - 6.2.0.231-SNAPSHOT + 6.2.0.234-SNAPSHOT jar Lucee Loader Build