Changeset 12323 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-06-06T19:43:38+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/plugins
- Files:
-
- 2 edited
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) {
Note:
See TracChangeset
for help on using the changeset viewer.