Index: /trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java	(revision 1859)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java	(revision 1860)
@@ -28,4 +28,5 @@
 import org.openstreetmap.josm.actions.AboutAction;
 import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.OptionPaneUtil;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
 import org.xml.sax.SAXException;
@@ -49,14 +50,26 @@
 
         @Override protected void finish() {
-            if (errors.length() > 0)
-                JOptionPane.showMessageDialog(Main.parent, tr("There were problems with the following plugins:\n\n {0}",errors));
-            else
-                JOptionPane.showMessageDialog(Main.parent, trn("{0} Plugin successfully downloaded. Please restart JOSM.", "{0} Plugins successfully downloaded. Please restart JOSM.", count, count));
+            if (errors.length() > 0) {
+                OptionPaneUtil.showMessageDialog(
+                        Main.parent,
+                        tr("There were problems with the following plugins:\n\n {0}",errors),
+                        tr("Error"),
+                        JOptionPane.ERROR_MESSAGE
+                );
+            } else {
+                OptionPaneUtil.showMessageDialog(
+                        Main.parent,
+                        trn("{0} Plugin successfully downloaded. Please restart JOSM.", "{0} Plugins successfully downloaded. Please restart JOSM.", count, count),
+                        tr("Information"),
+                        JOptionPane.INFORMATION_MESSAGE
+                );
+            }
         }
 
         @Override protected void realRun() throws SAXException, IOException {
             File pluginDir = Main.pref.getPluginsDirFile();
-            if (!pluginDir.exists())
+            if (!pluginDir.exists()) {
                 pluginDir.mkdirs();
+            }
             progressMonitor.setTicksCount(toUpdate.size());
             for (PluginInformation d : toUpdate) {
@@ -64,7 +77,7 @@
                 progressMonitor.worked(1);
                 File pluginFile = new File(pluginDir, d.name + ".jar.new");
-                if(download(d, pluginFile))
+                if(download(d, pluginFile)) {
                     count++;
-                else
+                } else
                 {
                     errors += d.name + "\n";
@@ -88,13 +101,14 @@
         int count = 0;
         for (String site : getSites()) {
-        /* TODO: remove old site files (everything except .jar) */
+            /* TODO: remove old site files (everything except .jar) */
             try {
                 BufferedReader r = new BufferedReader(new InputStreamReader(new URL(site).openStream(), "utf-8"));
                 new File(Main.pref.getPreferencesDir()+"plugins").mkdir();
                 BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
-                new FileOutputStream(new File(Main.pref.getPluginsDirFile(),
-                count + "-site-" + site.replaceAll("[/:\\\\ <>|]", "_") + ".txt")), "utf-8"));
-                for (String line = r.readLine(); line != null; line = r.readLine())
+                        new FileOutputStream(new File(Main.pref.getPluginsDirFile(),
+                                count + "-site-" + site.replaceAll("[/:\\\\ <>|]", "_") + ".txt")), "utf-8"));
+                for (String line = r.readLine(); line != null; line = r.readLine()) {
                     out.append(line+"\n");
+                }
                 r.close();
                 out.close();
@@ -110,8 +124,8 @@
         {
             int answer = new ExtendedDialog(Main.parent,
-                        tr("Skip download"),
-                        tr("JOSM version {0} required for plugin {1}.", pd.mainversion, pd.name),
-                        new String[] {tr("Download Plugin"), tr("Skip Download")},
-                        new String[] {"download.png", "cancel.png"}).getValue();
+                    tr("Skip download"),
+                    tr("JOSM version {0} required for plugin {1}.", pd.mainversion, pd.name),
+                    new String[] {tr("Download Plugin"), tr("Skip Download")},
+                    new String[] {"download.png", "cancel.png"}).getValue();
             if (answer != 1)
                 return false;
@@ -122,6 +136,7 @@
             OutputStream out = new FileOutputStream(file);
             byte[] buffer = new byte[8192];
-            for (int read = in.read(buffer); read != -1; read = in.read(buffer))
+            for (int read = in.read(buffer); read != -1; read = in.read(buffer)) {
                 out.write(buffer, 0, read);
+            }
             out.close();
             in.close();
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 1859)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 1860)
@@ -34,4 +34,5 @@
 import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.OptionPaneUtil;
 import org.openstreetmap.josm.gui.download.DownloadSelection;
 import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
@@ -51,18 +52,25 @@
         List<String> plugins = new LinkedList<String>();
         Collection<String> cp = Main.pref.getCollection("plugins", null);
-        if (cp != null)
+        if (cp != null) {
             plugins.addAll(cp);
-        if (System.getProperty("josm.plugins") != null)
+        }
+        if (System.getProperty("josm.plugins") != null) {
             plugins.addAll(Arrays.asList(System.getProperty("josm.plugins").split(",")));
+        }
 
         String [] oldplugins = new String[] {"mappaint", "unglueplugin",
-        "lang-de", "lang-en_GB", "lang-fr", "lang-it", "lang-pl", "lang-ro",
-        "lang-ru", "ewmsplugin", "ywms", "tways-0.2", "geotagged", "landsat",
-        "namefinder", "waypoints", "slippy_map_chooser", "tcx-support"};
+                "lang-de", "lang-en_GB", "lang-fr", "lang-it", "lang-pl", "lang-ro",
+                "lang-ru", "ewmsplugin", "ywms", "tways-0.2", "geotagged", "landsat",
+                "namefinder", "waypoints", "slippy_map_chooser", "tcx-support"};
         for (String p : oldplugins) {
             if (plugins.contains(p)) {
                 plugins.remove(p);
                 Main.pref.removeFromCollection("plugins", p);
-                JOptionPane.showMessageDialog(Main.parent, tr("Warning - loading of {0} plugin was requested. This plugin is no longer required.", p));
+                OptionPaneUtil.showMessageDialog(
+                        Main.parent,
+                        tr("Loading of {0} plugin was requested. This plugin is no longer required.", p),
+                        tr("Warning"),
+                        JOptionPane.WARNING_MESSAGE
+                );
             }
         }
@@ -75,9 +83,15 @@
             PluginInformation info = PluginInformation.findPlugin(pluginName);
             if (info != null) {
-                if (info.early != early)
+                if (info.early != early) {
                     continue;
+                }
                 if (info.mainversion > AboutAction.getVersionNumber()) {
-                    JOptionPane.showMessageDialog(Main.parent, tr("Plugin {0} requires JOSM update to version {1}.", pluginName,
-                    info.mainversion));
+                    OptionPaneUtil.showMessageDialog(
+                            Main.parent,
+                            tr("Plugin {0} requires JOSM update to version {1}.", pluginName,
+                                    info.mainversion),
+                                    tr("Warning"),
+                                    JOptionPane.WARNING_MESSAGE
+                    );
                     continue;
                 }
@@ -92,15 +106,24 @@
                     if(warn != null)
                     {
-                        JOptionPane.showMessageDialog(Main.parent,
-                        tr("Plugin {0} is required by plugin {1} but was not found.",
-                        warn, pluginName));
+                        OptionPaneUtil.showMessageDialog(Main.parent,
+                                tr("Plugin {0} is required by plugin {1} but was not found.",
+                                        warn, pluginName),
+                                        tr("Error"),
+                                        JOptionPane.ERROR_MESSAGE
+                        );
                         continue;
                     }
                 }
-                if (!p.containsKey(info.stage))
+                if (!p.containsKey(info.stage)) {
                     p.put(info.stage, new LinkedList<PluginInformation>());
+                }
                 p.get(info.stage).add(info);
             } else if(early) {
-                JOptionPane.showMessageDialog(Main.parent, tr("Plugin not found: {0}.", pluginName));
+                OptionPaneUtil.showMessageDialog(
+                        Main.parent,
+                        tr("Plugin not found: {0}.", pluginName),
+                        tr("Error"),
+                        JOptionPane.ERROR_MESSAGE
+                );
             }
         }
@@ -114,10 +137,13 @@
                 Main.pref.put("pluginmanager.lastupdate",Long.toString(tim));
             } else if (d > maxTime) {
-                JOptionPane.showMessageDialog(Main.parent,
-                   "<html>" +
-                   tr("Last plugin update more than {0} days ago.", d) +
-                   "<br><em>" +
-                   tr("(You can change the number of days after which this warning appears<br>by setting the config option 'pluginmanager.warntime'.)") +
-                   "</html>");
+                OptionPaneUtil.showMessageDialog(Main.parent,
+                        "<html>" +
+                        tr("Last plugin update more than {0} days ago.", d) +
+                        "<br><em>" +
+                        tr("(You can change the number of days after which this warning appears<br>by setting the config option 'pluginmanager.warntime'.)") +
+                        "</html>",
+                        tr("Warning"),
+                        JOptionPane.WARNING_MESSAGE
+                );
             }
         }
@@ -125,7 +151,9 @@
         // iterate all plugins and collect all libraries of all plugins:
         List<URL> allPluginLibraries = new ArrayList<URL>();
-        for (Collection<PluginInformation> c : p.values())
-            for (PluginInformation info : c)
+        for (Collection<PluginInformation> c : p.values()) {
+            for (PluginInformation info : c) {
                 allPluginLibraries.addAll(info.libraries);
+            }
+        }
         // create a classloader for all plugins:
         URL[] jarUrls = new URL[allPluginLibraries.size()];
@@ -146,8 +174,8 @@
 
                     int result = new ExtendedDialog(Main.parent,
-                        tr("Disable plugin"),
-                        tr("Could not load plugin {0}. Delete from preferences?", info.name),
-                        new String[] {tr("Disable plugin"), tr("Keep plugin")},
-                        new String[] {"dialogs/delete.png", "cancel.png"}).getValue();
+                            tr("Disable plugin"),
+                            tr("Could not load plugin {0}. Delete from preferences?", info.name),
+                            new String[] {tr("Disable plugin"), tr("Keep plugin")},
+                            new String[] {"dialogs/delete.png", "cancel.png"}).getValue();
 
                     if(result == 1)
@@ -161,6 +189,7 @@
     }
     public static void setMapFrame(MapFrame old, MapFrame map) {
-        for (PluginProxy plugin : pluginList)
+        for (PluginProxy plugin : pluginList) {
             plugin.mapFrameInitialized(old, map);
+        }
     }
 
@@ -174,6 +203,7 @@
     public static void addDownloadSelection(List<DownloadSelection> downloadSelections)
     {
-        for (PluginProxy p : pluginList)
+        for (PluginProxy p : pluginList) {
             p.addDownloadSelection(downloadSelections);
+        }
     }
     public static void getPreferenceSetting(Collection<PreferenceSettingFactory> settings)
@@ -187,5 +217,6 @@
     {
         if (!PluginDownloader.moveUpdatedPlugins()) {
-            JOptionPane.showMessageDialog(null,
+            OptionPaneUtil.showMessageDialog(
+                    Main.parent,
                     tr("Activating the updated plugins failed. Check if JOSM has the permission to overwrite the existing ones."),
                     tr("Plugins"), JOptionPane.ERROR_MESSAGE);
@@ -197,6 +228,7 @@
 
         // Check for an explicit problem when calling a plugin function
-        if (e instanceof PluginException)
+        if (e instanceof PluginException) {
             plugin = ((PluginException)e).plugin;
+        }
 
         if (plugin == null)
@@ -204,22 +236,25 @@
             String name = null;
             /**
-            * Analyze the stack of the argument and find a name of a plugin, if
-            * some known problem pattern has been found.
-            *
-            * Note: This heuristic is not meant as discrimination against specific
-            * plugins, but only to stop the flood of similar bug reports about plugins.
-            * Of course, plugin writers are free to install their own version of
-            * an exception handler with their email address listed to receive
-            * bug reports ;-).
-            */
+             * Analyze the stack of the argument and find a name of a plugin, if
+             * some known problem pattern has been found.
+             *
+             * Note: This heuristic is not meant as discrimination against specific
+             * plugins, but only to stop the flood of similar bug reports about plugins.
+             * Of course, plugin writers are free to install their own version of
+             * an exception handler with their email address listed to receive
+             * bug reports ;-).
+             */
             for (StackTraceElement element : e.getStackTrace()) {
                 String c = element.getClassName();
 
-                if (c.contains("wmsplugin.") || c.contains(".WMSLayer"))
+                if (c.contains("wmsplugin.") || c.contains(".WMSLayer")) {
                     name = "wmsplugin";
-                if (c.contains("livegps."))
+                }
+                if (c.contains("livegps.")) {
                     name = "livegps";
-                if (c.startsWith("UtilsPlugin."))
+                }
+                if (c.startsWith("UtilsPlugin.")) {
                     name = "UtilsPlugin";
+                }
 
                 if (c.startsWith("org.openstreetmap.josm.plugins.")) {
@@ -229,6 +264,7 @@
                     }
                 }
-                if(name != null)
-                  break;
+                if(name != null) {
+                    break;
+                }
             }
             for (PluginProxy p : pluginList)
@@ -244,16 +280,16 @@
         if (plugin != null) {
             int answer = new ExtendedDialog(Main.parent,
-                tr("Disable plugin"),
-                tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.", plugin.info.name)
+                    tr("Disable plugin"),
+                    tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.", plugin.info.name)
                     + "\n"
                     + (plugin.info.author != null
-                        ? tr("According to the information within the plugin, the author is {0}.", plugin.info.author)
-                        : "")
-                    + "\n"
-                    + tr("Try updating to the newest version of this plugin before reporting a bug.")
-                    + "\n"
-                    + tr("Should the plugin be disabled?"),
-                new String[] {tr("Disable plugin"), tr("Cancel")},
-                new String[] {"dialogs/delete.png", "cancel.png"}).getValue();
+                            ? tr("According to the information within the plugin, the author is {0}.", plugin.info.author)
+                                    : "")
+                                    + "\n"
+                                    + tr("Try updating to the newest version of this plugin before reporting a bug.")
+                                    + "\n"
+                                    + tr("Should the plugin be disabled?"),
+                                    new String[] {tr("Disable plugin"), tr("Cancel")},
+                                    new String[] {"dialogs/delete.png", "cancel.png"}).getValue();
             if (answer == 1) {
                 List<String> plugins = new ArrayList<String>(Main.pref.getCollection("plugins", Collections.<String>emptyList()));
@@ -261,9 +297,15 @@
                     while (plugins.remove(plugin.info.name)) {}
                     Main.pref.putCollection("plugins", plugins);
-                    JOptionPane.showMessageDialog(Main.parent,
-                    tr("The plugin has been removed from the configuration. Please restart JOSM to unload the plugin."));
+                    OptionPaneUtil.showMessageDialog(Main.parent,
+                            tr("The plugin has been removed from the configuration. Please restart JOSM to unload the plugin."),
+                            tr("Information"),
+                            JOptionPane.INFORMATION_MESSAGE);
                 } else {
-                    JOptionPane.showMessageDialog(Main.parent,
-                    tr("The plugin could not be removed. Probably it was already disabled"));
+                    OptionPaneUtil.showMessageDialog(
+                            Main.parent,
+                            tr("The plugin could not be removed. Probably it was already disabled"),
+                            tr("Error"),
+                            JOptionPane.ERROR_MESSAGE
+                    );
                 }
                 return true;
@@ -276,6 +318,7 @@
         String text = "";
         String pl = Main.pref.get("plugins");
-        if(pl != null && pl.length() != 0)
+        if(pl != null && pl.length() != 0) {
             text += "Plugins: "+pl+"\n";
+        }
         for (final PluginProxy pp : pluginList) {
             text += "Plugin " + pp.info.name + (pp.info.version != null && !pp.info.version.equals("") ? " Version: "+pp.info.version+"\n" : "\n");
@@ -302,5 +345,10 @@
                     a.setEditable(false);
                     a.setText(b.toString());
-                    JOptionPane.showMessageDialog(Main.parent, new JScrollPane(a));
+                    OptionPaneUtil.showMessageDialog(
+                            Main.parent,
+                            new JScrollPane(a),
+                            tr("Plugin information"),
+                            JOptionPane.INFORMATION_MESSAGE
+                    );
                 }
             }), GBC.eol());
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 1859)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 1860)
@@ -8,6 +8,6 @@
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.net.URL;
-import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -15,5 +15,4 @@
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.TreeMap;
 import java.util.jar.Attributes;
@@ -86,6 +85,7 @@
             Manifest manifest = new Manifest();
             manifest.read(manifestStream);
-            if(url != null)
+            if(url != null) {
                 downloadlink = url;
+            }
             scanManifest(manifest, url != null);
         } catch (IOException e) {
@@ -100,6 +100,7 @@
         className = attr.getValue("Plugin-Class");
         String s = attr.getValue(lang+"Plugin-Link");
-        if(s == null)
+        if(s == null) {
             s = attr.getValue("Plugin-Link");
+        }
         link = s;
         requires = attr.getValue("Plugin-Requires");
@@ -108,6 +109,7 @@
         {
             s = attr.getValue("Plugin-Description");
-            if(s != null)
+            if(s != null) {
                 s = tr(s);
+            }
         }
         description = s;
@@ -151,14 +153,16 @@
             for (String entry : classPath.split(" ")) {
                 File entryFile;
-                if (new File(entry).isAbsolute())
+                if (new File(entry).isAbsolute()) {
                     entryFile = new File(entry);
-                else
+                } else {
                     entryFile = new File(file.getParent(), entry);
+                }
 
                 libraries.add(fileToURL(entryFile));
             }
         }
-        for (Object o : attr.keySet())
+        for (Object o : attr.keySet()) {
             this.attr.put(o.toString(), attr.getValue(o.toString()));
+        }
     }
 
@@ -166,6 +170,7 @@
     {
         String d = description == null ? tr("no description available") : description;
-        if(link != null)
+        if(link != null) {
             d += " <A HREF=\""+link+"\">"+tr("More details")+"</A>";
+        }
         return d;
     }
@@ -262,6 +267,7 @@
         Collection<String> locations = Main.pref.getAllPossiblePreferenceDirs();
         Collection<String> all = new ArrayList<String>(locations.size());
-        for (String s : locations)
+        for (String s : locations) {
             all.add(s+"plugins");
+        }
         return all;
     }
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java	(revision 1859)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java	(revision 1860)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.OptionPaneUtil;
 import org.openstreetmap.josm.tools.OpenBrowser;
 
@@ -48,10 +49,19 @@
     public void updateDescription(JPanel pluginPanel) {
         int count = PluginDownloader.downloadDescription();
-        if (count > 0)
-            JOptionPane.showMessageDialog(Main.parent,
-                trn("Downloaded plugin information from {0} site",
-                    "Downloaded plugin information from {0} sites", count, count));
-        else
-            JOptionPane.showMessageDialog(Main.parent, tr("No plugin information found."));
+        if (count > 0) {
+            OptionPaneUtil.showMessageDialog(Main.parent,
+                    trn("Downloaded plugin information from {0} site",
+                            "Downloaded plugin information from {0} sites", count, count),
+                            tr("Information"),
+                            JOptionPane.INFORMATION_MESSAGE
+            );
+        } else {
+            OptionPaneUtil.showMessageDialog(
+                    Main.parent,
+                    tr("No plugin information found."),
+                    tr("Error"),
+                    JOptionPane.ERROR_MESSAGE
+            );
+        }
         drawPanel(pluginPanel);
     }
@@ -80,12 +90,17 @@
         }
         if (toUpdate.isEmpty()) {
-            JOptionPane.showMessageDialog(Main.parent, tr("All installed plugins are up to date."));
+            OptionPaneUtil.showMessageDialog(
+                    Main.parent,
+                    tr("All installed plugins are up to date."),
+                    tr("Information"),
+                    JOptionPane.INFORMATION_MESSAGE
+            );
             done = true;
         } else {
             int answer = new ExtendedDialog(Main.parent,
-                        tr("Update"),
-                        tr("Update the following plugins:\n\n{0}", toUpdateStr.toString()),
-                        new String[] {tr("Update Plugins"), tr("Cancel")},
-                        new String[] {"dialogs/refresh.png", "cancel.png"}).getValue();
+                    tr("Update"),
+                    tr("Update the following plugins:\n\n{0}", toUpdateStr.toString()),
+                    new String[] {tr("Update Plugins"), tr("Cancel")},
+                    new String[] {"dialogs/refresh.png", "cancel.png"}).getValue();
             if (answer == 1) {
                 PluginDownloader.update(toUpdate);
@@ -93,6 +108,7 @@
             }
         }
-        if (done && num >= 1)
+        if (done && num >= 1) {
             Main.pref.put("pluginmanager.lastupdate", Long.toString(System.currentTimeMillis()));
+        }
         drawPanel(pluginPanel);
     }
@@ -110,5 +126,5 @@
                 PluginInformation pi = localPlugins.get(name);
                 if(pi == null || (pi.version == null && ap.version != null)
-                || (pi.version != null && !pi.version.equals(ap.version)))
+                        || (pi.version != null && !pi.version.equals(ap.version)))
                 {
                     toDownload.add(ap);
@@ -119,18 +135,20 @@
         if (!toDownload.isEmpty()) {
             int answer = new ExtendedDialog(Main.parent,
-                        tr("Download missing plugins"),
-                        tr("Download the following plugins?\n\n{0}", msg),
-                        new String[] {tr("Download Plugins"), tr("Cancel")},
-                        new String[] {"download.png", "cancel.png"}).getValue();
+                    tr("Download missing plugins"),
+                    tr("Download the following plugins?\n\n{0}", msg),
+                    new String[] {tr("Download Plugins"), tr("Cancel")},
+                    new String[] {"download.png", "cancel.png"}).getValue();
             Collection<PluginInformation> error =
-            (answer != 1 ? toDownload : new PluginDownloader().download(toDownload));
-            for (PluginInformation pd : error)
+                (answer != 1 ? toDownload : new PluginDownloader().download(toDownload));
+            for (PluginInformation pd : error) {
                 pluginMap.put(pd.name, false);
+            }
 
         }
         LinkedList<String> plugins = new LinkedList<String>();
         for (Map.Entry<String, Boolean> d : pluginMap.entrySet()) {
-            if (d.getValue())
+            if (d.getValue()) {
                 plugins.add(d.getKey());
+            }
         }
 
@@ -144,11 +162,13 @@
         Collection<String> enabledPlugins = Main.pref.getCollection("plugins", null);
 
-        if (pluginMap == null)
+        if (pluginMap == null) {
             pluginMap = new HashMap<String, Boolean>();
-        else {
+        } else {
             // Keep the map in bounds; possibly slightly pointless.
             Set<String> pluginsToRemove = new HashSet<String>();
             for (final String pname : pluginMap.keySet()) {
-                if (availablePlugins.get(pname) == null) pluginsToRemove.add(pname);
+                if (availablePlugins.get(pname) == null) {
+                    pluginsToRemove.add(pname);
+                }
             }
 
@@ -167,12 +187,14 @@
         for (final PluginInformation plugin : availablePlugins.values()) {
             boolean enabled = (enabledPlugins != null) && enabledPlugins.contains(plugin.name);
-            if (pluginMap.get(plugin.name) == null)
+            if (pluginMap.get(plugin.name) == null) {
                 pluginMap.put(plugin.name, enabled);
+            }
 
             String remoteversion = plugin.version;
-            if ((remoteversion == null) || remoteversion.equals(""))
+            if ((remoteversion == null) || remoteversion.equals("")) {
                 remoteversion = tr("unknown");
-            else if(plugin.oldmode)
+            } else if(plugin.oldmode) {
                 remoteversion += "*";
+            }
 
             String localversion = "";
@@ -180,8 +202,9 @@
             if(p != null)
             {
-                if (p.version != null && !p.version.equals(""))
+                if (p.version != null && !p.version.equals("")) {
                     localversion = p.version;
-                else
+                } else {
                     localversion = tr("unknown");
+                }
                 localversion = " (" + localversion + ")";
             }
@@ -245,14 +268,17 @@
                 Arrays.sort(pluginFiles);
                 for (File f : pluginFiles) {
-                    if (!f.isFile())
+                    if (!f.isFile()) {
                         continue;
+                    }
                     String fname = f.getName();
                     if (fname.endsWith(".jar")) {
                         try {
                             PluginInformation info = new PluginInformation(f,fname.substring(0,fname.length()-4));
-                            if (!availablePlugins.containsKey(info.name))
+                            if (!availablePlugins.containsKey(info.name)) {
                                 availablePlugins.put(info.name, info);
-                            if (!localPlugins.containsKey(info.name))
+                            }
+                            if (!localPlugins.containsKey(info.name)) {
                                 localPlugins.put(info.name, info);
+                            }
                         } catch (PluginException x) {
                         }
@@ -290,8 +316,9 @@
                                         {
                                             PluginInformation info = new PluginInformation(
-                                            new ByteArrayInputStream(manifest.getBytes("utf-8")),
-                                            name.substring(0,name.length()-4), url);
-                                            if(!availablePlugins.containsKey(info.name))
+                                                    new ByteArrayInputStream(manifest.getBytes("utf-8")),
+                                                    name.substring(0,name.length()-4), url);
+                                            if(!availablePlugins.containsKey(info.name)) {
                                                 availablePlugins.put(info.name, info);
+                                            }
                                         }
                                         catch (Exception e)
@@ -310,8 +337,9 @@
                             {
                                 PluginInformation info = new PluginInformation(
-                                new ByteArrayInputStream(manifest.getBytes("utf-8")),
-                                name.substring(0,name.length()-4), url);
-                                if(!availablePlugins.containsKey(info.name))
+                                        new ByteArrayInputStream(manifest.getBytes("utf-8")),
+                                        name.substring(0,name.length()-4), url);
+                                if(!availablePlugins.containsKey(info.name)) {
                                     availablePlugins.put(info.name, info);
+                                }
                             }
                             r.close();
@@ -322,5 +350,10 @@
                         if(err > 0)
                         {
-                          JOptionPane.showMessageDialog(Main.parent, tr("Error reading plugin information file: {0}", f.getName()));
+                            OptionPaneUtil.showMessageDialog(
+                                    Main.parent,
+                                    tr("Error reading plugin information file: {0}", f.getName()),
+                                    tr("Error"),
+                                    JOptionPane.ERROR_MESSAGE
+                            );
                         }
                     }
@@ -330,8 +363,10 @@
         for (PluginProxy proxy : PluginHandler.pluginList)
         {
-            if (!availablePlugins.containsKey(proxy.info.name))
+            if (!availablePlugins.containsKey(proxy.info.name)) {
                 availablePlugins.put(proxy.info.name, proxy.info);
-            if (!localPlugins.containsKey(proxy.info.name))
+            }
+            if (!localPlugins.containsKey(proxy.info.name)) {
                 localPlugins.put(proxy.info.name, proxy.info);
+            }
         }
     }
