修复JDK9+以上RedkaleClassLoader的getAllURLS方法中的BUG

This commit is contained in:
Redkale
2019-02-12 11:52:23 +08:00
parent a321b41699
commit 87e7c43032

View File

@@ -39,9 +39,9 @@ public class RedkaleClassLoader extends URLClassLoader {
HashSet<URL> set = new HashSet<>();
String appPath = System.getProperty("java.class.path");
if (appPath != null && !appPath.isEmpty()) {
for (String path : appPath.replace(":/", "&&").replace(":\\", "##").replace(':', ';').split(";")) {
for (String path : appPath.replace("://", "&&").replace(":\\", "##").replace(':', ';').split(";")) {
try {
set.add(Paths.get(path.replace("&&", ":/").replace("##", ":\\")).toRealPath().toFile().toURI().toURL());
set.add(Paths.get(path.replace("&&", "://").replace("##", ":\\")).toRealPath().toFile().toURI().toURL());
} catch (Exception e) {
}
}