001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.plugins;
003
004import java.net.URL;
005import java.net.URLClassLoader;
006
007/**
008 * ClassLoader that makes the {@link #addURL} method of {@link URLClassLoader} public.
009 *
010 * Like URLClassLoader, but allows to add more URLs after construction.
011 * @since 14234 (extracted from PluginHandler)
012 */
013public class DynamicURLClassLoader extends URLClassLoader {
014
015    /**
016     * Constructs a new {@code DynamicURLClassLoader}.
017     * @param urls the URLs from which to load classes and resources
018     * @param parent the parent class loader for delegation
019     */
020    public DynamicURLClassLoader(URL[] urls, ClassLoader parent) {
021        super(urls, parent);
022    }
023
024    @Override
025    public void addURL(URL url) {
026        super.addURL(url);
027    }
028}