Changeset 12323 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginClassLoader.java
r12322 r12323 50 50 return result; 51 51 } 52 } catch (ClassNotFoundException e) {} 52 } catch (ClassNotFoundException e) { 53 // do nothing 54 } 53 55 } 54 56 Class<?> result = super.loadClass(name, resolve); -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r12322 r12323 827 827 Map<PluginInformation, PluginClassLoader> classLoaders = new HashMap<>(); 828 828 for (PluginInformation info : toLoad) { 829 classLoaders.put(info, new PluginClassLoader( 829 PluginClassLoader cl = AccessController.doPrivileged((PrivilegedAction<PluginClassLoader>) 830 () -> new PluginClassLoader( 830 831 info.libraries.toArray(new URL[0]), 831 832 Main.class.getClassLoader(), 832 833 null)); 834 classLoaders.put(info, cl); 833 835 } 834 836 … … 1213 1215 } 1214 1216 1217 /** 1218 * Returns the plugin class loader for the plugin of the specified name. 1219 * @param name The plugin name 1220 * @return The plugin class loader for the plugin of the specified name, if 1221 * installed and loaded, or {@code null} otherwise. 1222 * @since 12323 1223 */ 1224 public static PluginClassLoader getPluginClassLoader(String name) { 1225 for (PluginProxy plugin : pluginList) { 1226 if (plugin.getPluginInformation().name.equals(name)) 1227 return plugin.getClassLoader(); 1228 } 1229 return null; 1230 } 1231 1215 1232 public static void addDownloadSelection(List<DownloadSelection> downloadSelections) { 1216 1233 for (PluginProxy p : pluginList) { -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java
r10988 r12323 127 127 128 128 private static String findFaultyPlugin(Collection<PluginInformation> plugins, Throwable root) { 129 DynamicURLClassLoader cl = PluginHandler.getPluginClassLoader();130 129 for (PluginInformation p : plugins) { 131 130 try { 131 ClassLoader cl = PluginHandler.getPluginClassLoader(p.getName()); 132 132 String pluginPackage = cl.loadClass(p.className).getPackage().getName(); 133 133 for (StackTraceElement e : root.getStackTrace()) {
Note: See TracChangeset
for help on using the changeset viewer.