Index: /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 2858)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 2859)
@@ -706,5 +706,5 @@
     }
 
-    private static boolean confirmDisablingPluginAfterException(PluginProxy plugin) {
+    private static boolean confirmDeactivatingPluginAfterException(PluginProxy plugin) {
         ButtonSpec [] options = new ButtonSpec[] {
                 new ButtonSpec(
@@ -748,4 +748,10 @@
     }
 
+    /**
+     * Replies the plugin which most likely threw the exception <code>ex</code>.
+     * 
+     * @param ex the exception
+     * @return the plugin; null, if the exception proably wasn't thrown from a plugin
+     */
     private static PluginProxy getPluginCausingException(Throwable ex) {
         for (PluginProxy p : pluginList) {
@@ -762,36 +768,45 @@
     }
 
-    public static boolean checkException(Throwable e) {
+    /**
+     * Checks whether the exception <code>e</code> was thrown by a plugin. If so,
+     * conditionally deactivates the plugin, but asks the user first.
+     * 
+     * @param e the exception
+     */
+    public static void disablePluginAfterException(Throwable e) {
         PluginProxy plugin = null;
-
         // Check for an explicit problem when calling a plugin function
         if (e instanceof PluginException) {
             plugin = ((PluginException) e).plugin;
         }
-
         if (plugin == null) {
             plugin = getPluginCausingException(e);
         }
-
-        if (plugin != null && confirmDisablingPluginAfterException(plugin)) {
-            List<String> plugins = new ArrayList<String>(Main.pref.getCollection("plugins", Collections
-                    .<String> emptyList()));
-            if (plugins.contains(plugin.getPluginInformation().name)) {
-                while (plugins.remove(plugin.getPluginInformation().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."),
-                        tr("Information"), JOptionPane.INFORMATION_MESSAGE);
-            } else {
-                JOptionPane.showMessageDialog(Main.parent,
-                        tr("The plugin could not be removed. Probably it was already disabled"), tr("Error"),
-                        JOptionPane.ERROR_MESSAGE);
-            }
-            return true;
-        }
-        return false;
+        if (plugin == null)
+            // don't know what plugin threw the exception
+            return;
+
+        Set<String> plugins = new HashSet<String>(
+                Main.pref.getCollection("plugins",Collections.<String> emptySet())
+        );
+        if (! plugins.contains(plugin.getPluginInformation().name))
+            // plugin not activated ? strange in this context but anyway, don't bother
+            // the user with dialogs, skip condiational deactivation
+            return;
+
+        if (!confirmDeactivatingPluginAfterException(plugin))
+            // user doesn't want to deactivate the plugin
+            return;
+
+        // deactivate the plugin
+        plugins.remove(plugin.getPluginInformation().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."),
+                tr("Information"),
+                JOptionPane.INFORMATION_MESSAGE
+        );
+        return;
     }
 
Index: /trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java	(revision 2858)
+++ /trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java	(revision 2859)
@@ -51,92 +51,105 @@
             }
 
-            if(PluginHandler.checkException(e))
-                return;
+            // Give the user a chance to deactivate the plugin which threw the exception (if it
+            // was thrown from a plugin)
+            //
+            PluginHandler.disablePluginAfterException(e);
 
+            // Then ask for submitting a bug report, for exceptions thrown from a plugin too
+            //
             Object[] options = new String[]{tr("Do nothing"), tr("Report Bug")};
-            int answer = JOptionPane.showOptionDialog(Main.parent, tr("An unexpected exception occurred.\n\n" +
-                    "This is always a coding error. If you are running the latest\n" +
-            "version of JOSM, please consider being kind and file a bug report."),
-            tr("Unexpected Exception"), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE,null,
-            options, options[0]);
-            if (answer == 1) {
+            int answer = JOptionPane.showOptionDialog(
+                    Main.parent,
+                    "<html>"
+                    + tr("An unexpected exception occurred.<br>" +
+                            "This is always a coding error. If you are running the latest<br>" +
+                            "version of JOSM, please consider being kind and file a bug report."
+                    )
+                    + "</html>",
+                    tr("Unexpected Exception"),
+                    JOptionPane.YES_NO_OPTION,
+                    JOptionPane.ERROR_MESSAGE,
+                    null,
+                    options, options[0]
+            );
+            if (answer != 1)  return;
+
+            try {
+                final int maxlen = 7000;
+                StringWriter stack = new StringWriter();
+                e.printStackTrace(new PrintWriter(stack));
+
+                String text = ShowStatusReportAction.getReportHeader()
+                + stack.getBuffer().toString();
+                String urltext = text.replaceAll("\r",""); /* strip useless return chars */
+                if(urltext.length() > maxlen)
+                {
+                    urltext = urltext.substring(0,maxlen);
+                    int idx = urltext.lastIndexOf("\n");
+                    /* cut whole line when not loosing too much */
+                    if(maxlen-idx < 200) {
+                        urltext = urltext.substring(0,idx+1);
+                    }
+                    urltext += "...<snip>...\n";
+                }
+
+                URL url = new URL("http://josm.openstreetmap.de/josmticket?" +
+                        "data="+
+                        Base64.encode(
+                                // To note that it came from this code
+                                "keywords=template_report&" +
+                                "description=" + java.net.URLEncoder.encode(
+                                        // Note: This doesn't use tr() intentionally, we want bug reports in English
+                                        "What steps will reproduce the problem?\n"
+                                        + " 1. \n"
+                                        + " 2. \n"
+                                        + " 3. \n"
+                                        + "\n"
+                                        + "What is the expected result?\n\n"
+                                        + "What happens instead?\n\n"
+                                        + "Please provide any additional information below. Attach a screenshot if\n"
+                                        + "possible.\n\n"
+                                        + "{{{\n" + urltext + "\n}}}\n",
+                                "UTF-8")));
+
+                JPanel p = new JPanel(new GridBagLayout());
+                p.add(new JMultilineLabel(
+                        tr("You have encountered an error in JOSM. Before you file a bug report" +
+                        "make sure you have updated to the latest version of JOSM here:")), GBC.eol());
+                p.add(new UrlLabel("http://josm.openstreetmap.de/#Download"), GBC.eop().insets(8,0,0,0));
+                p.add(new JMultilineLabel(
+                        tr("You should also update your plugins. If neither of those help please" +
+                        "file a bug report in our bugtracker using this link:")), GBC.eol());
+                p.add(new UrlLabel(url.toString(), "http://josm.openstreetmap.de/josmticket?..."), GBC.eop().insets(8,0,0,0));
+                p.add(new JMultilineLabel(
+                        tr("There the error information provided below should already be" +
+                                "filled in for you. Please include information on how to reproduce" +
+                        "the error and try to supply as much detail as possible.")), GBC.eop());
+                p.add(new JMultilineLabel(
+                        tr("Alternatively, if that does not work you can manually fill in the information" +
+                        "below at this URL:")), GBC.eol());
+                p.add(new UrlLabel("http://josm.openstreetmap.de/newticket"), GBC.eop().insets(8,0,0,0));
                 try {
-                    final int maxlen = 7000;
-                    StringWriter stack = new StringWriter();
-                    e.printStackTrace(new PrintWriter(stack));
+                    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(text), new ClipboardOwner(){
+                        public void lostOwnership(Clipboard clipboard, Transferable contents) {}
+                    });
+                    p.add(new JLabel(tr("(The text has already been copied to your clipboard.)")), GBC.eop());
+                }
+                catch (RuntimeException x) {}
 
-                    String text = ShowStatusReportAction.getReportHeader()
-                    + stack.getBuffer().toString();
-                    String urltext = text.replaceAll("\r",""); /* strip useless return chars */
-                    if(urltext.length() > maxlen)
-                    {
-                        urltext = urltext.substring(0,maxlen);
-                        int idx = urltext.lastIndexOf("\n");
-                        /* cut whole line when not loosing too much */
-                        if(maxlen-idx < 200) {
-                            urltext = urltext.substring(0,idx+1);
-                        }
-                        urltext += "...<snip>...\n";
+                JTextArea info = new JTextArea(text, 20, 60);
+                info.setCaretPosition(0);
+                info.setEditable(false);
+                p.add(new JScrollPane(info), GBC.eop());
+
+                for (Component c: p.getComponents()) {
+                    if (c instanceof JMultilineLabel) {
+                        ((JMultilineLabel)c).setMaxWidth(400);
                     }
+                }
 
-                    URL url = new URL("http://josm.openstreetmap.de/josmticket?" +
-                            "data="+
-                            Base64.encode(
-                                    // To note that it came from this code
-                                    "keywords=template_report&" +
-                                    "description=" + java.net.URLEncoder.encode(
-                                            // Note: This doesn't use tr() intentionally, we want bug reports in English
-                                            "What steps will reproduce the problem?\n"
-                                            + " 1. \n"
-                                            + " 2. \n"
-                                            + " 3. \n"
-                                            + "\n"
-                                            + "What is the expected result?\n\n"
-                                            + "What happens instead?\n\n"
-                                            + "Please provide any additional information below. Attach a screenshot if\n"
-                                            + "possible.\n\n"
-                                            + "{{{\n" + urltext + "\n}}}\n",
-                                    "UTF-8")));
-
-                    JPanel p = new JPanel(new GridBagLayout());
-                    p.add(new JMultilineLabel(
-                            tr("You have encountered an error in JOSM. Before you file a bug report" +
-                            "make sure you have updated to the latest version of JOSM here:")), GBC.eol());
-                    p.add(new UrlLabel("http://josm.openstreetmap.de/#Download"), GBC.eop().insets(8,0,0,0));
-                    p.add(new JMultilineLabel(
-                            tr("You should also update your plugins. If neither of those help please" +
-                            "file a bug report in our bugtracker using this link:")), GBC.eol());
-                    p.add(new UrlLabel(url.toString(), "http://josm.openstreetmap.de/josmticket?..."), GBC.eop().insets(8,0,0,0));
-                    p.add(new JMultilineLabel(
-                            tr("There the error information provided below should already be" +
-                                    "filled in for you. Please include information on how to reproduce" +
-                            "the error and try to supply as much detail as possible.")), GBC.eop());
-                    p.add(new JMultilineLabel(
-                            tr("Alternatively, if that does not work you can manually fill in the information" +
-                            "below at this URL:")), GBC.eol());
-                    p.add(new UrlLabel("http://josm.openstreetmap.de/newticket"), GBC.eop().insets(8,0,0,0));
-                    try {
-                        Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(text), new ClipboardOwner(){
-                            public void lostOwnership(Clipboard clipboard, Transferable contents) {}
-                        });
-                        p.add(new JLabel(tr("(The text has already been copied to your clipboard.)")), GBC.eop());
-                    }
-                    catch (RuntimeException x) {}
-
-                    JTextArea info = new JTextArea(text, 20, 60);
-                    info.setCaretPosition(0);
-                    info.setEditable(false);
-                    p.add(new JScrollPane(info), GBC.eop());
-
-                    for (Component c: p.getComponents()) {
-                        if (c instanceof JMultilineLabel) {
-                            ((JMultilineLabel)c).setMaxWidth(400);
-                        }
-                    }
-
-                    JOptionPane.showMessageDialog(Main.parent, p, tr("You have encountered a bug in JOSM"), JOptionPane.ERROR_MESSAGE);
-                } catch (Exception e1) {
-                    e1.printStackTrace();
-                }
+                JOptionPane.showMessageDialog(Main.parent, p, tr("You have encountered a bug in JOSM"), JOptionPane.ERROR_MESSAGE);
+            } catch (Exception e1) {
+                e1.printStackTrace();
             }
         }
