Changeset 10982 in josm


Ignore:
Timestamp:
2016-09-09T02:34:36+02:00 (3 years ago)
Author:
Don-vip
Message:

sonar - squid:S2386 - Mutable fields should not be "public static"

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r10763 r10982  
    6161import org.openstreetmap.josm.plugins.PluginHandler;
    6262import org.openstreetmap.josm.plugins.PluginInformation;
    63 import org.openstreetmap.josm.plugins.PluginProxy;
    6463import org.openstreetmap.josm.tools.CheckParameterUtil;
    6564import org.openstreetmap.josm.tools.GBC;
     
    155154                // check if plugin dependences can also be loaded
    156155                Collection<PluginInformation> allPlugins = new HashSet<>(toLoad);
    157                 for (PluginProxy proxy : PluginHandler.pluginList) {
    158                     allPlugins.add(proxy.getPluginInformation());
    159                 }
     156                allPlugins.addAll(PluginHandler.getPlugins());
    160157                boolean removed;
    161158                do {
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r10963 r10982  
    3838import java.util.concurrent.FutureTask;
    3939import java.util.jar.JarFile;
     40import java.util.stream.Collectors;
    4041
    4142import javax.swing.AbstractAction;
     
    238239     * All installed and loaded plugins (resp. their main classes)
    239240     */
    240     public static final Collection<PluginProxy> pluginList = new LinkedList<>();
     241    protected static final Collection<PluginProxy> pluginList = new LinkedList<>();
    241242
    242243    /**
    243244     * All exceptions that occured during plugin loading
    244      * @since 8938
    245      */
    246     public static final Map<String, Exception> pluginLoadingExceptions = new HashMap<>();
     245     */
     246    protected static final Map<String, Exception> pluginLoadingExceptions = new HashMap<>();
    247247
    248248    /**
     
    266266
    267267    private static PluginDownloadTask pluginDownloadTask;
     268
     269    /**
     270     * Returns the list of currently installed and loaded plugins.
     271     * @return the list of currently installed and loaded plugins
     272     * @since 10982
     273     */
     274    public static List<PluginInformation> getPlugins() {
     275        return pluginList.stream().map(PluginProxy::getPluginInformation).collect(Collectors.toList());
     276    }
    268277
    269278    public static Collection<ClassLoader> getResourceClassLoaders() {
Note: See TracChangeset for help on using the changeset viewer.