Changeset 14978 in josm for trunk/src/org
- Timestamp:
- 2019-04-09T19:37:28+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r14977 r14978 228 228 229 229 protected void firePreferenceChanged(String key, Setting<?> oldValue, Setting<?> newValue) { 230 final Class<?> source = ReflectionUtils.findCallerClass(preferencesClasses); 230 231 final PreferenceChangeEvent evt = 231 new DefaultPreferenceChangeEvent( ReflectionUtils.findCallerClass(preferencesClasses), key, oldValue, newValue);232 new DefaultPreferenceChangeEvent(source != null ? source : getClass(), key, oldValue, newValue); 232 233 listeners.fireEvent(listener -> listener.preferenceChanged(evt)); 233 234 -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r14962 r14978 300 300 } 301 301 302 /** 303 * Plugin class loaders. 304 */ 305 private static final Map<PluginInformation, PluginClassLoader> classLoaders = new HashMap<>(); 306 302 307 private static PluginDownloadTask pluginDownloadTask; 303 308 … … 317 322 public static Collection<ClassLoader> getResourceClassLoaders() { 318 323 return Collections.unmodifiableCollection(sources); 324 } 325 326 /** 327 * Returns all plugin classloaders. 328 * @return all plugin classloaders 329 * @since 14978 330 */ 331 public static Collection<PluginClassLoader> getPluginClassLoaders() { 332 return Collections.unmodifiableCollection(classLoaders.values()); 319 333 } 320 334 … … 837 851 return; 838 852 839 Map<PluginInformation, PluginClassLoader> classLoaders = new HashMap<>();853 classLoaders.clear(); 840 854 for (PluginInformation info : toLoad) { 841 855 PluginClassLoader cl = AccessController.doPrivileged((PrivilegedAction<PluginClassLoader>) -
trunk/src/org/openstreetmap/josm/tools/ReflectionUtils.java
r14977 r14978 7 7 import java.util.Collection; 8 8 import java.util.function.Function; 9 10 import org.openstreetmap.josm.plugins.PluginHandler; 9 11 10 12 /** … … 46 48 return Class.forName(x.getClassName()); 47 49 } catch (ClassNotFoundException e) { 50 for (ClassLoader cl : PluginHandler.getPluginClassLoaders()) { 51 try { 52 return Class.forName(x.getClassName(), true, cl); 53 } catch (ClassNotFoundException ex) { 54 Logging.trace(ex); 55 } 56 } 48 57 Logging.error(e); 49 58 return null;
Note:
See TracChangeset
for help on using the changeset viewer.