Ignore:
Timestamp:
2014-02-25T01:31:24+01:00 (11 years ago)
Author:
Don-vip
Message:

fix some Sonar issues

Location:
trunk/src/org/openstreetmap/josm/plugins
Files:
3 edited

Legend:

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

    r6867 r6883  
    9090    }
    9191
    92     @Override protected void cancel() {
     92    @Override
     93    protected void cancel() {
    9394        this.canceled = true;
    9495        synchronized(this) {
     
    99100    }
    100101
    101     @Override protected void finish() {}
     102    @Override
     103    protected void finish() {}
    102104
    103105    protected void download(PluginInformation pi, File file) throws PluginDownloadException{
     
    152154    }
    153155
    154     @Override protected void realRun() throws SAXException, IOException {
     156    @Override
     157    protected void realRun() throws SAXException, IOException {
    155158        File pluginDir = Main.pref.getPluginsDirectory();
    156         if (!pluginDir.exists()) {
    157             if (!pluginDir.mkdirs()) {
    158                 lastException = new PluginDownloadException(tr("Failed to create plugin directory ''{0}''", pluginDir.toString()));
    159                 failed.addAll(toUpdate);
    160                 return;
    161             }
     159        if (!pluginDir.exists() && !pluginDir.mkdirs()) {
     160            lastException = new PluginDownloadException(tr("Failed to create plugin directory ''{0}''", pluginDir.toString()));
     161            failed.addAll(toUpdate);
     162            return;
    162163        }
    163164        getProgressMonitor().setTicksCount(toUpdate.size());
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r6839 r6883  
    7878     * Deprecated plugins that are removed on start
    7979     */
    80     public final static Collection<DeprecatedPlugin> DEPRECATED_PLUGINS;
     80    public static final Collection<DeprecatedPlugin> DEPRECATED_PLUGINS;
    8181    static {
    8282        String IN_CORE = tr("integrated into main program");
     
    195195     * All installed and loaded plugins (resp. their main classes)
    196196     */
    197     public final static Collection<PluginProxy> pluginList = new LinkedList<PluginProxy>();
     197    public static final Collection<PluginProxy> pluginList = new LinkedList<PluginProxy>();
    198198
    199199    /**
     
    10351035            File plugin = new File(filePath.substring(0, filePath.length() - 4));
    10361036            String pluginName = updatedPlugin.getName().substring(0, updatedPlugin.getName().length() - 8);
    1037             if (plugin.exists()) {
    1038                 if (!plugin.delete() && dowarn) {
    1039                     Main.warn(tr("Failed to delete outdated plugin ''{0}''.", plugin.toString()));
    1040                     Main.warn(tr("Failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName));
    1041                     continue;
    1042                 }
     1037            if (plugin.exists() && !plugin.delete() && dowarn) {
     1038                Main.warn(tr("Failed to delete outdated plugin ''{0}''.", plugin.toString()));
     1039                Main.warn(tr("Failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName));
     1040                continue;
    10431041            }
    10441042            try {
     
    13241322    }
    13251323
    1326     static private class UpdatePluginsMessagePanel extends JPanel {
     1324    private static class UpdatePluginsMessagePanel extends JPanel {
    13271325        private JMultilineLabel lblMessage;
    13281326        private JCheckBox cbDontShowAgain;
  • trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java

    r6839 r6883  
    325325        try {
    326326            File pluginDir = Main.pref.getPluginsDirectory();
    327             if (!pluginDir.exists()) {
    328                 if (! pluginDir.mkdirs()) {
    329                     Main.warn(tr("Failed to create plugin directory ''{0}''. Cannot cache plugin list from plugin site ''{1}''.", pluginDir.toString(), site));
    330                 }
     327            if (!pluginDir.exists() && !pluginDir.mkdirs()) {
     328                Main.warn(tr("Failed to create plugin directory ''{0}''. Cannot cache plugin list from plugin site ''{1}''.", pluginDir.toString(), site));
    331329            }
    332330            File cacheFile = createSiteCacheFile(pluginDir, site, CacheType.PLUGIN_LIST);
Note: See TracChangeset for help on using the changeset viewer.