mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed: plugin classes are not found if plugin classpath contains non-canonical paths
This commit is contained in:
@@ -18,6 +18,7 @@ import sun.reflect.Reflection;
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -409,13 +410,17 @@ public class PluginManager {
|
||||
try {
|
||||
final List urls = new ArrayList(classPath.length);
|
||||
for (int idx = 0; idx < classPath.length; idx++) {
|
||||
urls.add(classPath[idx].toURL());
|
||||
final File file = classPath[idx].getCanonicalFile(); // it is critical not to have "." and ".." in classpath elements
|
||||
urls.add(file.toURL());
|
||||
}
|
||||
return new PluginClassLoader(urls, parentLoaders, pluginName, pluginRoot);
|
||||
}
|
||||
catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user