- Timestamp:
- 2013-10-02T00:38:02+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/Plugin.java
r5987 r6282 9 9 import java.net.URL; 10 10 import java.net.URLClassLoader; 11 import java.security.AccessController; 12 import java.security.PrivilegedAction; 11 13 import java.util.List; 12 14 … … 142 144 File pluginDir = Main.pref.getPluginsDirectory(); 143 145 File pluginJar = new File(pluginDir, info.name + ".jar"); 144 URL pluginJarUrl = PluginInformation.fileToURL(pluginJar); 145 URLClassLoader pluginClassLoader = new URLClassLoader(new URL[] { pluginJarUrl } , Main.class.getClassLoader()); 146 return pluginClassLoader; 146 final URL pluginJarUrl = PluginInformation.fileToURL(pluginJar); 147 return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { 148 public ClassLoader run() { 149 return new URLClassLoader(new URL[] {pluginJarUrl}, Main.class.getClassLoader()); 150 } 151 }); 147 152 } 148 153 } -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r6248 r6282 16 16 import java.net.URL; 17 17 import java.net.URLClassLoader; 18 import java.security.AccessController; 19 import java.security.PrivilegedAction; 18 20 import java.util.ArrayList; 19 21 import java.util.Arrays; … … 527 529 528 530 // create a classloader for all plugins: 529 URL[] jarUrls = new URL[allPluginLibraries.size()]; 530 jarUrls = allPluginLibraries.toArray(jarUrls); 531 URLClassLoader pluginClassLoader = new URLClassLoader(jarUrls, Main.class.getClassLoader()); 532 return pluginClassLoader; 531 final URL[] jarUrls = allPluginLibraries.toArray(new URL[allPluginLibraries.size()]); 532 return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { 533 public ClassLoader run() { 534 return new URLClassLoader(jarUrls, Main.class.getClassLoader()); 535 } 536 }); 533 537 } 534 538
Note:
See TracChangeset
for help on using the changeset viewer.