Changeset 14234 in josm for trunk


Ignore:
Timestamp:
2018-09-09T18:47:15+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16047, see #16682 - make PluginClassLoader extend DynamicURLClassLoader so that plugins can add URLs to it

Location:
trunk/src/org/openstreetmap/josm/plugins
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginClassLoader.java

    r14232 r14234  
    33
    44import java.net.URL;
    5 import java.net.URLClassLoader;
    65import java.util.ArrayList;
    76import java.util.Arrays;
     
    1817 * @since 12322
    1918 */
    20 public class PluginClassLoader extends URLClassLoader {
     19public class PluginClassLoader extends DynamicURLClassLoader {
    2120
    2221    private final Collection<PluginClassLoader> dependencies;
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r14186 r14234  
    1818import java.net.MalformedURLException;
    1919import java.net.URL;
    20 import java.net.URLClassLoader;
    2120import java.security.AccessController;
    2221import java.security.PrivilegedAction;
     
    249248
    250249    /**
    251      * ClassLoader that makes the addURL method of URLClassLoader public.
    252      *
    253      * Like URLClassLoader, but allows to add more URLs after construction.
    254      */
    255     public static class DynamicURLClassLoader extends URLClassLoader {
    256 
    257         /**
    258          * Constructs a new {@code DynamicURLClassLoader}.
    259          * @param urls the URLs from which to load classes and resources
    260          * @param parent the parent class loader for delegation
    261          */
    262         public DynamicURLClassLoader(URL[] urls, ClassLoader parent) {
    263             super(urls, parent);
    264         }
    265 
    266         @Override
    267         public void addURL(URL url) {
    268             super.addURL(url);
    269         }
    270     }
    271 
    272     /**
    273250     * List of unmaintained plugins. Not really up-to-date as the vast majority of plugins are not maintained after a few months, sadly...
    274251     */
Note: See TracChangeset for help on using the changeset viewer.