Changeset 19106 in josm for trunk/src/org/openstreetmap/josm/plugins/PluginClassLoader.java
- Timestamp:
- 2024-06-13T21:18:45+02:00 (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginClassLoader.java
r17664 r19106 59 59 Class<?> result = findLoadedClass(name); 60 60 if (result == null) { 61 for (PluginClassLoader dep : dependencies) { 62 try { 63 result = dep.loadClass(name, resolve); 64 if (result != null) { 65 return result; 66 } 67 } catch (ClassNotFoundException e) { 68 Logging.trace("Plugin class not found in dep {0}: {1}", dep, e.getMessage()); 69 Logging.trace(e); 70 } 71 } 61 result = findClassInDependencies(name, resolve); 72 62 try { 73 63 // Will delegate to parent.loadClass(name, resolve) if needed … … 93 83 } 94 84 85 /** 86 * Try to find the specified class in this classes dependencies 87 * @param name The name of the class to find 88 * @param resolve {@code true} to resolve the class 89 * @return the class, if found, otherwise {@code null} 90 */ 91 @SuppressWarnings("PMD.CloseResource") // NOSONAR We do *not* want to close class loaders in this method... 92 private Class<?> findClassInDependencies(String name, boolean resolve) { 93 for (PluginClassLoader dep : dependencies) { 94 try { 95 Class<?> result = dep.loadClass(name, resolve); 96 if (result != null) { 97 return result; 98 } 99 } catch (ClassNotFoundException e) { 100 Logging.trace("Plugin class not found in dep {0}: {1}", dep, e.getMessage()); 101 Logging.trace(e); 102 } 103 } 104 return null; 105 } 106 95 107 @Override 108 @SuppressWarnings("PMD.CloseResource") // NOSONAR We do *not* want to close class loaders in this method... 96 109 public URL findResource(String name) { 97 110 URL resource = super.findResource(name);
Note:
See TracChangeset
for help on using the changeset viewer.