Index: /trunk/src/org/openstreetmap/josm/actions/AboutAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AboutAction.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/actions/AboutAction.java	(revision 10055)
@@ -31,9 +31,9 @@
 import org.openstreetmap.josm.gui.widgets.UrlLabel;
 import org.openstreetmap.josm.plugins.PluginHandler;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
 /**
Index: /trunk/src/org/openstreetmap/josm/actions/ReportBugAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ReportBugAction.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/actions/ReportBugAction.java	(revision 10055)
@@ -7,8 +7,6 @@
 import java.awt.event.KeyEvent;
 
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
-import org.openstreetmap.josm.tools.OpenBrowser;
 import org.openstreetmap.josm.tools.Shortcut;
-import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.bugreport.BugReportSender;
 
 /**
@@ -18,32 +16,27 @@
 public class ReportBugAction extends JosmAction {
 
+    private final String text;
+
     /**
-     * Constructs a new {@code ReportBugAction}.
+     * Constructs a new {@code ReportBugAction} that reports the normal status report.
      */
     public ReportBugAction() {
+        this(ShowStatusReportAction.getReportHeader());
+    }
+
+    /**
+     * Constructs a new {@link ReportBugAction} for the given debug text.
+     * @param text The text to send
+     */
+    public ReportBugAction(String text) {
         super(tr("Report bug"), "bug", tr("Report a ticket to JOSM bugtracker"),
                 Shortcut.registerShortcut("reportbug", tr("Report a ticket to JOSM bugtracker"),
                         KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true);
+        this.text = text;
     }
 
     @Override
     public void actionPerformed(ActionEvent e) {
-        reportBug();
-    }
-
-    /**
-     * Reports a ticket to JOSM bugtracker.
-     */
-    public static void reportBug() {
-        reportBug(ShowStatusReportAction.getReportHeader());
-    }
-
-    /**
-     * Reports a ticket to JOSM bugtracker with given status report.
-     * @param report Status report header containing technical, non-personal information
-     */
-    public static void reportBug(String report) {
-        OpenBrowser.displayUrl(BugReportExceptionHandler.getBugReportUrl(
-                Utils.strip(report)).toExternalForm());
+        BugReportSender.reportBug(text);
     }
 }
Index: /trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 10055)
@@ -20,6 +20,4 @@
 import java.util.Set;
 
-import javax.swing.JScrollPane;
-
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Version;
@@ -28,9 +26,9 @@
 import org.openstreetmap.josm.data.preferences.Setting;
 import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.gui.widgets.JosmTextArea;
 import org.openstreetmap.josm.plugins.PluginHandler;
 import org.openstreetmap.josm.tools.PlatformHookUnixoid;
 import org.openstreetmap.josm.tools.Shortcut;
-import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.bugreport.BugReportSender;
+import org.openstreetmap.josm.tools.bugreport.DebugTextDisplay;
 
 /**
@@ -184,9 +182,5 @@
         }
 
-        JosmTextArea ta = new JosmTextArea(text.toString());
-        ta.setWrapStyleWord(true);
-        ta.setLineWrap(true);
-        ta.setEditable(false);
-        JScrollPane sp = new JScrollPane(ta);
+        DebugTextDisplay ta = new DebugTextDisplay(text.toString());
 
         ExtendedDialog ed = new ExtendedDialog(Main.parent,
@@ -194,11 +188,11 @@
                 new String[] {tr("Copy to clipboard and close"), tr("Report bug"), tr("Close") });
         ed.setButtonIcons(new String[] {"copy", "bug", "cancel" });
-        ed.setContent(sp, false);
+        ed.setContent(ta, false);
         ed.setMinimumSize(new Dimension(380, 200));
         ed.setPreferredSize(new Dimension(700, Main.parent.getHeight()-50));
 
         switch (ed.showDialog().getValue()) {
-            case 1: Utils.copyToClipboard(text.toString()); break;
-            case 2: ReportBugAction.reportBug(reportHeader); break;
+            case 1: ta.copyToClippboard(); break;
+            case 2: BugReportSender.reportBug(reportHeader); break;
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java	(revision 10055)
@@ -25,6 +25,6 @@
 import org.openstreetmap.josm.io.OsmApiInitializationException;
 import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.ExceptionUtil;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
 /**
Index: /trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 10055)
@@ -65,5 +65,4 @@
 import org.openstreetmap.josm.plugins.PluginHandler;
 import org.openstreetmap.josm.plugins.PluginInformation;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.FontsManager;
 import org.openstreetmap.josm.tools.HttpClient;
@@ -73,4 +72,5 @@
 import org.openstreetmap.josm.tools.PlatformHookWindows;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
 import gnu.getopt.Getopt;
Index: /trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10055)
@@ -70,7 +70,7 @@
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.tools.AudioPlayer;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
 /**
Index: /trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/PleaseWaitRunnable.java	(revision 10055)
@@ -13,6 +13,6 @@
 import org.openstreetmap.josm.gui.progress.ProgressTaskId;
 import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 import org.xml.sax.SAXException;
 
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java	(revision 10055)
@@ -56,7 +56,7 @@
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.io.OnlineResource;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.OpenBrowser;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
 /**
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java	(revision 10055)
@@ -51,7 +51,7 @@
 import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Utils;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
 /**
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetHeaderDownloadTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetHeaderDownloadTask.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetHeaderDownloadTask.java	(revision 10055)
@@ -21,7 +21,7 @@
 import org.openstreetmap.josm.io.OsmServerChangesetReader;
 import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.ExceptionUtil;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 import org.xml.sax.SAXException;
 
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryTask.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryTask.java	(revision 10055)
@@ -26,7 +26,7 @@
 import org.openstreetmap.josm.io.OsmTransferCanceledException;
 import org.openstreetmap.josm.io.OsmTransferException;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.ExceptionUtil;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 import org.xml.sax.SAXException;
 
Index: /trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java	(revision 10055)
@@ -282,5 +282,5 @@
 
         /**
-         * Constrcuts a new {@code LatLonViewer}.
+         * Constructs a new {@code LatLonViewer}.
          * @param model a model
          * @param role the role for this viewer.
Index: /trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java	(revision 10055)
@@ -24,8 +24,8 @@
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.Predicate;
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.WindowGeometry;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
 /**
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 10055)
@@ -63,8 +63,8 @@
 import org.openstreetmap.josm.plugins.PluginInformation;
 import org.openstreetmap.josm.plugins.PluginProxy;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
 /**
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginProxy.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginProxy.java	(revision 10054)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginProxy.java	(revision 10055)
@@ -8,5 +8,5 @@
 import org.openstreetmap.josm.gui.download.DownloadSelection;
 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
-import org.openstreetmap.josm.tools.BugReportExceptionHandler;
+import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
 
 /**
Index: unk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java	(revision 10054)
+++ 	(revision )
@@ -1,301 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.tools;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
-
-import java.awt.Component;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.URL;
-import java.nio.ByteBuffer;
-import java.nio.charset.StandardCharsets;
-import java.util.zip.GZIPOutputStream;
-
-import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.SwingUtilities;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.ShowStatusReportAction;
-import org.openstreetmap.josm.data.Version;
-import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.gui.preferences.plugin.PluginPreference;
-import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
-import org.openstreetmap.josm.gui.widgets.JosmTextArea;
-import org.openstreetmap.josm.gui.widgets.UrlLabel;
-import org.openstreetmap.josm.plugins.PluginDownloadTask;
-import org.openstreetmap.josm.plugins.PluginHandler;
-
-/**
- * An exception handler that asks the user to send a bug report.
- *
- * @author imi
- */
-public final class BugReportExceptionHandler implements Thread.UncaughtExceptionHandler {
-
-    private static boolean handlingInProgress;
-    private static volatile BugReporterThread bugReporterThread;
-    private static int exceptionCounter;
-    private static boolean suppressExceptionDialogs;
-
-    private static class BugReporterThread extends Thread {
-
-        private final class BugReporterWorker implements Runnable {
-            private final PluginDownloadTask pluginDownloadTask;
-
-            private BugReporterWorker(PluginDownloadTask pluginDownloadTask) {
-                this.pluginDownloadTask = pluginDownloadTask;
-            }
-
-            @Override
-            public void run() {
-                // Then ask for submitting a bug report, for exceptions thrown from a plugin too, unless updated to a new version
-                if (pluginDownloadTask == null) {
-                    String[] buttonTexts = new String[] {tr("Do nothing"), tr("Report Bug")};
-                    String[] buttonIcons = new String[] {"cancel", "bug"};
-                    int defaultButtonIdx = 1;
-                    String message = 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."
-                            );
-                    // Check user is running current tested version, the error may already be fixed
-                    int josmVersion = Version.getInstance().getVersion();
-                    if (josmVersion != Version.JOSM_UNKNOWN_VERSION) {
-                        try {
-                            int latestVersion = Integer.parseInt(new WikiReader().
-                                    read(Main.getJOSMWebsite()+"/wiki/TestedVersion?format=txt").trim());
-                            if (latestVersion > josmVersion) {
-                                buttonTexts = new String[] {tr("Do nothing"), tr("Update JOSM"), tr("Report Bug")};
-                                buttonIcons = new String[] {"cancel", "download", "bug"};
-                                defaultButtonIdx = 2;
-                                message = tr("An unexpected exception occurred. This is always a coding error.<br><br>" +
-                                        "However, you are running an old version of JOSM ({0}),<br>" +
-                                        "instead of using the current tested version (<b>{1}</b>).<br><br>"+
-                                        "<b>Please update JOSM</b> before considering to file a bug report.",
-                                        String.valueOf(josmVersion), String.valueOf(latestVersion));
-                            }
-                        } catch (IOException | NumberFormatException e) {
-                            Main.warn("Unable to detect latest version of JOSM: "+e.getMessage());
-                        }
-                    }
-                    // Show dialog
-                    ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Unexpected Exception"), buttonTexts);
-                    ed.setButtonIcons(buttonIcons);
-                    ed.setIcon(JOptionPane.ERROR_MESSAGE);
-                    ed.setCancelButton(1);
-                    ed.setDefaultButton(defaultButtonIdx);
-                    JPanel pnl = new JPanel(new GridBagLayout());
-                    pnl.add(new JLabel("<html>" + message + "</html>"), GBC.eol());
-                    JCheckBox cbSuppress = null;
-                    if (exceptionCounter > 1) {
-                        cbSuppress = new JCheckBox(tr("Suppress further error dialogs for this session."));
-                        pnl.add(cbSuppress, GBC.eol());
-                    }
-                    ed.setContent(pnl);
-                    ed.setFocusOnDefaultButton(true);
-                    ed.showDialog();
-                    if (cbSuppress != null && cbSuppress.isSelected()) {
-                        suppressExceptionDialogs = true;
-                    }
-                    if (ed.getValue() <= 1) {
-                        // "Do nothing"
-                        return;
-                    } else if (ed.getValue() < buttonTexts.length) {
-                        // "Update JOSM"
-                        try {
-                            Main.platform.openUrl(Main.getJOSMWebsite());
-                        } catch (IOException e) {
-                            Main.warn("Unable to access JOSM website: "+e.getMessage());
-                        }
-                    } else {
-                        // "Report bug"
-                        askForBugReport(e);
-                    }
-                } else {
-                    // Ask for restart to install new plugin
-                    PluginPreference.notifyDownloadResults(
-                            Main.parent, pluginDownloadTask, !pluginDownloadTask.getDownloadedPlugins().isEmpty());
-                }
-            }
-        }
-
-        private final Throwable e;
-
-        /**
-         * Constructs a new {@code BugReporterThread}.
-         * @param t the exception
-         */
-        BugReporterThread(Throwable t) {
-            super("Bug Reporter");
-            this.e = t;
-        }
-
-        @Override
-        public void run() {
-            // Give the user a chance to deactivate the plugin which threw the exception (if it was thrown from a plugin)
-            SwingUtilities.invokeLater(new BugReporterWorker(PluginHandler.updateOrdisablePluginAfterException(e)));
-        }
-    }
-
-    @Override
-    public void uncaughtException(Thread t, Throwable e) {
-        handleException(e);
-    }
-
-    /**
-     * Handles the given throwable object
-     * @param t The throwable object
-     */
-    public void handle(Throwable t) {
-        handleException(t);
-    }
-
-    /**
-     * Handles the given exception
-     * @param e the exception
-     */
-    public static void handleException(final Throwable e) {
-        if (handlingInProgress || suppressExceptionDialogs)
-            return;                  // we do not handle secondary exceptions, this gets too messy
-        if (bugReporterThread != null && bugReporterThread.isAlive())
-            return;
-        handlingInProgress = true;
-        exceptionCounter++;
-        try {
-            Main.error(e);
-            if (Main.parent != null) {
-                if (e instanceof OutOfMemoryError) {
-                    // do not translate the string, as translation may raise an exception
-                    JOptionPane.showMessageDialog(Main.parent, "JOSM is out of memory. " +
-                            "Strange things may happen.\nPlease restart JOSM with the -Xmx###M option,\n" +
-                            "where ### is the number of MB assigned to JOSM (e.g. 256).\n" +
-                            "Currently, " + Runtime.getRuntime().maxMemory()/1024/1024 + " MB are available to JOSM.",
-                            "Error",
-                            JOptionPane.ERROR_MESSAGE
-                            );
-                    return;
-                }
-
-                bugReporterThread = new BugReporterThread(e);
-                bugReporterThread.start();
-            }
-        } finally {
-            handlingInProgress = false;
-        }
-    }
-
-    private static void askForBugReport(final Throwable e) {
-        try {
-            final int maxlen = 6000;
-            StringWriter stack = new StringWriter();
-            e.printStackTrace(new PrintWriter(stack));
-
-            String text = ShowStatusReportAction.getReportHeader() + stack.getBuffer().toString();
-            String urltext = text.replaceAll("\r", "");
-            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";
-            }
-
-            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().fill(GridBagConstraints.HORIZONTAL));
-            p.add(new UrlLabel(Main.getJOSMWebsite(), 2), 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().fill(GridBagConstraints.HORIZONTAL));
-            p.add(getBugReportUrlLabel(urltext), 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().fill(GridBagConstraints.HORIZONTAL));
-            p.add(new JMultilineLabel(
-                    tr("Alternatively, if that does not work you can manually fill in the information " +
-                            "below at this URL:")), GBC.eol().fill(GridBagConstraints.HORIZONTAL));
-            p.add(new UrlLabel(Main.getJOSMWebsite()+"/newticket", 2), GBC.eop().insets(8, 0, 0, 0));
-
-            // Wiki formatting for manual copy-paste
-            text = "{{{\n"+text+"}}}";
-
-            if (Utils.copyToClipboard(text)) {
-                p.add(new JLabel(tr("(The text has already been copied to your clipboard.)")),
-                        GBC.eop().fill(GridBagConstraints.HORIZONTAL));
-            }
-
-            JosmTextArea info = new JosmTextArea(text, 18, 60);
-            info.setCaretPosition(0);
-            info.setEditable(false);
-            p.add(new JScrollPane(info), GBC.eop().fill());
-
-            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) {
-            Main.error(e1);
-        }
-    }
-
-    /**
-     * Determines if an exception is currently being handled
-     * @return {@code true} if an exception is currently being handled, {@code false} otherwise
-     */
-    public static boolean exceptionHandlingInProgress() {
-        return handlingInProgress;
-    }
-
-    /**
-     * Replies the URL to create a JOSM bug report with the given debug text
-     * @param debugText The debug text to provide us
-     * @return The URL to create a JOSM bug report with the given debug text
-     * @since 5849
-     */
-    public static URL getBugReportUrl(String debugText) {
-        try (
-            ByteArrayOutputStream out = new ByteArrayOutputStream();
-            GZIPOutputStream gzip = new GZIPOutputStream(out)
-        ) {
-            gzip.write(debugText.getBytes(StandardCharsets.UTF_8));
-            gzip.finish();
-
-            return new URL(Main.getJOSMWebsite()+"/josmticket?" +
-                    "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true));
-        } catch (IOException e) {
-            Main.error(e);
-            return null;
-        }
-    }
-
-    /**
-     * Replies the URL label to create a JOSM bug report with the given debug text
-     * @param debugText The debug text to provide us
-     * @return The URL label to create a JOSM bug report with the given debug text
-     * @since 5849
-     */
-    public static UrlLabel getBugReportUrlLabel(String debugText) {
-        URL url = getBugReportUrl(debugText);
-        if (url != null) {
-            return new UrlLabel(url.toString(), Main.getJOSMWebsite()+"/josmticket?...", 2);
-        }
-        return null;
-    }
-}
Index: /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandler.java	(revision 10055)
+++ /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandler.java	(revision 10055)
@@ -0,0 +1,292 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools.bugreport;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URL;
+import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
+import java.util.zip.GZIPOutputStream;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.ReportBugAction;
+import org.openstreetmap.josm.actions.ShowStatusReportAction;
+import org.openstreetmap.josm.data.Version;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.preferences.plugin.PluginPreference;
+import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
+import org.openstreetmap.josm.gui.widgets.UrlLabel;
+import org.openstreetmap.josm.plugins.PluginDownloadTask;
+import org.openstreetmap.josm.plugins.PluginHandler;
+import org.openstreetmap.josm.tools.Base64;
+import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.WikiReader;
+
+/**
+ * An exception handler that asks the user to send a bug report.
+ *
+ * @author imi
+ */
+public final class BugReportExceptionHandler implements Thread.UncaughtExceptionHandler {
+
+    private static boolean handlingInProgress;
+    private static volatile BugReporterThread bugReporterThread;
+    private static int exceptionCounter;
+    private static boolean suppressExceptionDialogs;
+
+    private static class BugReporterThread extends Thread {
+
+        private final class BugReporterWorker implements Runnable {
+            private final PluginDownloadTask pluginDownloadTask;
+
+            private BugReporterWorker(PluginDownloadTask pluginDownloadTask) {
+                this.pluginDownloadTask = pluginDownloadTask;
+            }
+
+            @Override
+            public void run() {
+                // Then ask for submitting a bug report, for exceptions thrown from a plugin too, unless updated to a new version
+                if (pluginDownloadTask == null) {
+                    String[] buttonTexts = new String[] {tr("Do nothing"), tr("Report Bug")};
+                    String[] buttonIcons = new String[] {"cancel", "bug"};
+                    int defaultButtonIdx = 1;
+                    String message = 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."
+                            );
+                    // Check user is running current tested version, the error may already be fixed
+                    int josmVersion = Version.getInstance().getVersion();
+                    if (josmVersion != Version.JOSM_UNKNOWN_VERSION) {
+                        try {
+                            int latestVersion = Integer.parseInt(new WikiReader().
+                                    read(Main.getJOSMWebsite()+"/wiki/TestedVersion?format=txt").trim());
+                            if (latestVersion > josmVersion) {
+                                buttonTexts = new String[] {tr("Do nothing"), tr("Update JOSM"), tr("Report Bug")};
+                                buttonIcons = new String[] {"cancel", "download", "bug"};
+                                defaultButtonIdx = 2;
+                                message = tr("An unexpected exception occurred. This is always a coding error.<br><br>" +
+                                        "However, you are running an old version of JOSM ({0}),<br>" +
+                                        "instead of using the current tested version (<b>{1}</b>).<br><br>"+
+                                        "<b>Please update JOSM</b> before considering to file a bug report.",
+                                        String.valueOf(josmVersion), String.valueOf(latestVersion));
+                            }
+                        } catch (IOException | NumberFormatException e) {
+                            Main.warn("Unable to detect latest version of JOSM: "+e.getMessage());
+                        }
+                    }
+                    // Show dialog
+                    ExtendedDialog ed = new ExtendedDialog(Main.parent, tr("Unexpected Exception"), buttonTexts);
+                    ed.setButtonIcons(buttonIcons);
+                    ed.setIcon(JOptionPane.ERROR_MESSAGE);
+                    ed.setCancelButton(1);
+                    ed.setDefaultButton(defaultButtonIdx);
+                    JPanel pnl = new JPanel(new GridBagLayout());
+                    pnl.add(new JLabel("<html>" + message + "</html>"), GBC.eol());
+                    JCheckBox cbSuppress = null;
+                    if (exceptionCounter > 1) {
+                        cbSuppress = new JCheckBox(tr("Suppress further error dialogs for this session."));
+                        pnl.add(cbSuppress, GBC.eol());
+                    }
+                    ed.setContent(pnl);
+                    ed.setFocusOnDefaultButton(true);
+                    ed.showDialog();
+                    if (cbSuppress != null && cbSuppress.isSelected()) {
+                        suppressExceptionDialogs = true;
+                    }
+                    if (ed.getValue() <= 1) {
+                        // "Do nothing"
+                        return;
+                    } else if (ed.getValue() < buttonTexts.length) {
+                        // "Update JOSM"
+                        try {
+                            Main.platform.openUrl(Main.getJOSMWebsite());
+                        } catch (IOException e) {
+                            Main.warn("Unable to access JOSM website: "+e.getMessage());
+                        }
+                    } else {
+                        // "Report bug"
+                        askForBugReport(e);
+                    }
+                } else {
+                    // Ask for restart to install new plugin
+                    PluginPreference.notifyDownloadResults(
+                            Main.parent, pluginDownloadTask, !pluginDownloadTask.getDownloadedPlugins().isEmpty());
+                }
+            }
+        }
+
+        private final Throwable e;
+
+        /**
+         * Constructs a new {@code BugReporterThread}.
+         * @param t the exception
+         */
+        BugReporterThread(Throwable t) {
+            super("Bug Reporter");
+            this.e = t;
+        }
+
+        @Override
+        public void run() {
+            // Give the user a chance to deactivate the plugin which threw the exception (if it was thrown from a plugin)
+            SwingUtilities.invokeLater(new BugReporterWorker(PluginHandler.updateOrdisablePluginAfterException(e)));
+        }
+    }
+
+    @Override
+    public void uncaughtException(Thread t, Throwable e) {
+        handleException(e);
+    }
+
+    /**
+     * Handles the given throwable object
+     * @param t The throwable object
+     */
+    public void handle(Throwable t) {
+        handleException(t);
+    }
+
+    /**
+     * Handles the given exception
+     * @param e the exception
+     */
+    public static void handleException(final Throwable e) {
+        if (handlingInProgress || suppressExceptionDialogs)
+            return;                  // we do not handle secondary exceptions, this gets too messy
+        if (bugReporterThread != null && bugReporterThread.isAlive())
+            return;
+        handlingInProgress = true;
+        exceptionCounter++;
+        try {
+            Main.error(e);
+            if (Main.parent != null) {
+                if (e instanceof OutOfMemoryError) {
+                    // do not translate the string, as translation may raise an exception
+                    JOptionPane.showMessageDialog(Main.parent, "JOSM is out of memory. " +
+                            "Strange things may happen.\nPlease restart JOSM with the -Xmx###M option,\n" +
+                            "where ### is the number of MB assigned to JOSM (e.g. 256).\n" +
+                            "Currently, " + Runtime.getRuntime().maxMemory()/1024/1024 + " MB are available to JOSM.",
+                            "Error",
+                            JOptionPane.ERROR_MESSAGE
+                            );
+                    return;
+                }
+
+                bugReporterThread = new BugReporterThread(e);
+                bugReporterThread.start();
+            }
+        } finally {
+            handlingInProgress = false;
+        }
+    }
+
+    private static void askForBugReport(final Throwable e) {
+        try {
+            StringWriter stack = new StringWriter();
+            e.printStackTrace(new PrintWriter(stack));
+
+            String text = ShowStatusReportAction.getReportHeader() + stack.getBuffer().toString();
+            text = text.replaceAll("\r", "");
+
+            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().fill(GridBagConstraints.HORIZONTAL));
+            p.add(new UrlLabel(Main.getJOSMWebsite(), 2), 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().fill(GridBagConstraints.HORIZONTAL));
+            p.add(new JButton(new ReportBugAction(text)), 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().fill(GridBagConstraints.HORIZONTAL));
+            p.add(new JMultilineLabel(
+                    tr("Alternatively, if that does not work you can manually fill in the information " +
+                            "below at this URL:")), GBC.eol().fill(GridBagConstraints.HORIZONTAL));
+            p.add(new UrlLabel(Main.getJOSMWebsite()+"/newticket", 2), GBC.eop().insets(8, 0, 0, 0));
+
+            // Wiki formatting for manual copy-paste
+            DebugTextDisplay textarea = new DebugTextDisplay(text);
+
+            if (textarea.copyToClippboard()) {
+                p.add(new JLabel(tr("(The text has already been copied to your clipboard.)")),
+                        GBC.eop().fill(GridBagConstraints.HORIZONTAL));
+            }
+
+            p.add(textarea, GBC.eop().fill());
+
+            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) {
+            Main.error(e1);
+        }
+    }
+
+    /**
+     * Determines if an exception is currently being handled
+     * @return {@code true} if an exception is currently being handled, {@code false} otherwise
+     */
+    public static boolean exceptionHandlingInProgress() {
+        return handlingInProgress;
+    }
+
+    /**
+     * Replies the URL to create a JOSM bug report with the given debug text. GZip is used to reduce the length of the parameter.
+     * @param debugText The debug text to provide us
+     * @return The URL to create a JOSM bug report with the given debug text
+     * @see BugReportSender#reportBug(String) if you want to send long debug texts along.
+     * @since 5849
+     */
+    public static URL getBugReportUrl(String debugText) {
+        try (
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            GZIPOutputStream gzip = new GZIPOutputStream(out)
+        ) {
+            gzip.write(debugText.getBytes(StandardCharsets.UTF_8));
+            gzip.finish();
+
+            return new URL(Main.getJOSMWebsite()+"/josmticket?" +
+                    "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true));
+        } catch (IOException e) {
+            Main.error(e);
+            return null;
+        }
+    }
+
+    /**
+     * Replies the URL label to create a JOSM bug report with the given debug text
+     * @param debugText The debug text to provide us
+     * @return The URL label to create a JOSM bug report with the given debug text
+     * @since 5849
+     */
+    public static UrlLabel getBugReportUrlLabel(String debugText) {
+        URL url = getBugReportUrl(debugText);
+        if (url != null) {
+            return new UrlLabel(url.toString(), Main.getJOSMWebsite()+"/josmticket?...", 2);
+        }
+        return null;
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportSender.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportSender.java	(revision 10055)
+++ /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportSender.java	(revision 10055)
@@ -0,0 +1,170 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools.bugreport;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
+import org.openstreetmap.josm.gui.widgets.UrlLabel;
+import org.openstreetmap.josm.tools.Base64;
+import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.HttpClient;
+import org.openstreetmap.josm.tools.HttpClient.Response;
+import org.openstreetmap.josm.tools.OpenBrowser;
+import org.openstreetmap.josm.tools.Utils;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/**
+ * This class handles sending the bug report to JOSM website.
+ * <p>
+ * Currently, we try to open a browser window for the user that displays the bug report.
+ *
+ * @author Michael Zangl
+ * @since 10055
+ */
+public class BugReportSender extends Thread {
+
+    private final String statusText;
+
+    /**
+     * Creates a new sender.
+     * @param statusText The status text to send.
+     */
+    public BugReportSender(String statusText) {
+        super("Bug report sender");
+        this.statusText = statusText;
+    }
+
+    @Override
+    public void run() {
+        try {
+            // first, send the debug text using post.
+            String debugTextPasteId = pasteDebugText();
+
+            // then open a browser to display the pasted text.
+            String openBrowserError = OpenBrowser.displayUrl(getJOSMTicketURL() + "?pdata_stored=" + debugTextPasteId);
+            if (openBrowserError != null) {
+                Main.warn(openBrowserError);
+                failed(openBrowserError);
+            }
+        } catch (BugReportSenderException e) {
+            Main.warn(e);
+            failed(e.getMessage());
+        }
+    }
+
+    /**
+     * Sends the debug text to the server.
+     * @return The token which was returned by the server. We need to pass this on to the ticket system.
+     * @throws BugReportSenderException if sending the report failed.
+     */
+    private String pasteDebugText() throws BugReportSenderException {
+        try {
+            String text = Utils.strip(statusText);
+            ByteBuffer buffer = Charset.forName("UTF-8").encode(CharBuffer.wrap(text));
+            String pdata = Base64.encode(buffer, false);
+            String postQuery = "pdata=" + URLEncoder.encode(pdata, "UTF-8");
+            HttpClient client = HttpClient.create(new URL(getJOSMTicketURL()), "POST")
+                    .setHeader("Content-Type", "application/x-www-form-urlencoded")
+                    .setRequestBody(postQuery.getBytes(StandardCharsets.UTF_8));
+
+            Response connection = client.connect();
+
+            if (connection.getResponseCode() >= 500) {
+                throw new BugReportSenderException("Internal server error.");
+            }
+
+            try (InputStream in = connection.getContent()) {
+                DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+                Document document = builder.parse(in);
+                return retriveDebugToken(document);
+            }
+        } catch (IOException | SAXException | ParserConfigurationException | XPathExpressionException t) {
+            throw new BugReportSenderException(t);
+        }
+    }
+
+    private String getJOSMTicketURL() {
+        return Main.getJOSMWebsite() + "/josmticket";
+    }
+
+    private String retriveDebugToken(Document document) throws XPathExpressionException, BugReportSenderException {
+        XPathFactory factory = XPathFactory.newInstance();
+        XPath xpath = factory.newXPath();
+        String status = (String) xpath.compile("/josmticket/@status").evaluate(document, XPathConstants.STRING);
+        if (!"ok".equals(status)) {
+            String message = (String) xpath.compile("/josmticket/error/text()").evaluate(document,
+                    XPathConstants.STRING);
+            if (message.isEmpty()) {
+                message = "Error in server response but server did not tell us what happened.";
+            }
+            throw new BugReportSenderException(message);
+        }
+
+        String token = (String) xpath.compile("/josmticket/preparedid/text()")
+                .evaluate(document, XPathConstants.STRING);
+        if (token.isEmpty()) {
+            throw new BugReportSenderException("Server did not respond with a prepared id.");
+        }
+        return token;
+    }
+
+    private void failed(String string) {
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                JPanel errorPanel = new JPanel();
+                errorPanel.setLayout(new GridBagLayout());
+                errorPanel.add(new JMultilineLabel(
+                        tr("Opening the bug report failed. Please report manually using this website:")),
+                        GBC.eol().fill(GridBagConstraints.HORIZONTAL));
+                errorPanel.add(new UrlLabel(Main.getJOSMWebsite() + "/newticket", 2), GBC.eop().insets(8, 0, 0, 0));
+                errorPanel.add(new DebugTextDisplay(statusText));
+
+                JOptionPane.showMessageDialog(Main.parent, errorPanel, tr("You have encountered a bug in JOSM"),
+                        JOptionPane.ERROR_MESSAGE);
+            }
+        });
+    }
+
+    private static class BugReportSenderException extends Exception {
+        BugReportSenderException(String message) {
+            super(message);
+        }
+
+        BugReportSenderException(Throwable cause) {
+            super(cause);
+        }
+    }
+
+    /**
+     * Opens the bug report window on the JOSM server.
+     * @param statusText The status text to send along to the server.
+     */
+    public static void reportBug(String statusText) {
+        new BugReportSender(statusText).start();
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/tools/bugreport/DebugTextDisplay.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/bugreport/DebugTextDisplay.java	(revision 10055)
+++ /trunk/src/org/openstreetmap/josm/tools/bugreport/DebugTextDisplay.java	(revision 10055)
@@ -0,0 +1,39 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools.bugreport;
+
+import java.awt.Dimension;
+
+import javax.swing.JScrollPane;
+
+import org.openstreetmap.josm.gui.widgets.JosmTextArea;
+import org.openstreetmap.josm.tools.Utils;
+
+/**
+ * This is a text area that displays the debug text with scroll bars.
+ * @author Michael Zangl
+ * @since 10055
+ */
+public class DebugTextDisplay extends JScrollPane {
+    private String text;
+
+    /**
+     * Creates a new text are with the fixed text
+     * @param textToDisplay The text to display.
+     */
+    public DebugTextDisplay(String textToDisplay) {
+        text = "{{{\n" + Utils.strip(textToDisplay) + "\n}}}";
+        JosmTextArea textArea = new JosmTextArea(text);
+        textArea.setCaretPosition(0);
+        textArea.setEditable(false);
+        setViewportView(textArea);
+        setPreferredSize(new Dimension(600, 300));
+    }
+
+    /**
+     * Copies the debug text to the clippboard.
+     * @return <code>true</code> if copy was successful
+     */
+    public boolean copyToClippboard() {
+        return Utils.copyToClipboard(text);
+    }
+}
Index: unk/test/unit/org/openstreetmap/josm/tools/BugReportExceptionHandlerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/BugReportExceptionHandlerTest.java	(revision 10054)
+++ 	(revision )
@@ -1,56 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.tools;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.zip.GZIPInputStream;
-
-import javax.xml.bind.DatatypeConverter;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.actions.ShowStatusReportAction;
-
-/**
- * Bug report unit tests.
- */
-public class BugReportExceptionHandlerTest {
-
-    /**
-     * Setup tests.
-     */
-    @Before
-    public void setUp() {
-        JOSMFixture.createUnitTestFixture().init();
-    }
-
-    /**
-     * Test method for {@link org.openstreetmap.josm.tools.BugReportExceptionHandler#getBugReportUrl(java.lang.String)}.
-     * @throws IOException if any I/O error occurs
-     */
-    @Test
-    public void testGetBugReportUrl() throws IOException {
-        String report = ShowStatusReportAction.getReportHeader();
-        String url = BugReportExceptionHandler.getBugReportUrl(report).toExternalForm();
-        String prefix = Main.getJOSMWebsite()+"/josmticket?gdata=";
-        assertTrue(url.startsWith(prefix));
-
-        String gdata = url.substring(prefix.length());
-        // JAXB only provides support for "base64" decoding while we encode url in "base64url", so switch encoding, only for test purpose
-        byte[] data = DatatypeConverter.parseBase64Binary(gdata.replace('-', '+').replace('_', '/'));
-        byte[] buff = new byte[8192];
-        try (GZIPInputStream is = new GZIPInputStream(new ByteArrayInputStream(data))) {
-            StringBuilder sb = new StringBuilder();
-            for (int n = is.read(buff); n > 0; n = is.read(buff)) {
-                sb.append(new String(buff, 0, n, StandardCharsets.UTF_8));
-            }
-            assertEquals(report, sb.toString());
-        }
-    }
-}
Index: /trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java	(revision 10055)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java	(revision 10055)
@@ -0,0 +1,56 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools.bugreport;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.zip.GZIPInputStream;
+
+import javax.xml.bind.DatatypeConverter;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.ShowStatusReportAction;
+
+/**
+ * Bug report unit tests.
+ */
+public class BugReportExceptionHandlerTest {
+
+    /**
+     * Setup tests.
+     */
+    @Before
+    public void setUp() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Test method for {@link org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler#getBugReportUrl(java.lang.String)}.
+     * @throws IOException if any I/O error occurs
+     */
+    @Test
+    public void testGetBugReportUrl() throws IOException {
+        String report = ShowStatusReportAction.getReportHeader();
+        String url = BugReportExceptionHandler.getBugReportUrl(report).toExternalForm();
+        String prefix = Main.getJOSMWebsite()+"/josmticket?gdata=";
+        assertTrue(url.startsWith(prefix));
+
+        String gdata = url.substring(prefix.length());
+        // JAXB only provides support for "base64" decoding while we encode url in "base64url", so switch encoding, only for test purpose
+        byte[] data = DatatypeConverter.parseBase64Binary(gdata.replace('-', '+').replace('_', '/'));
+        byte[] buff = new byte[8192];
+        try (GZIPInputStream is = new GZIPInputStream(new ByteArrayInputStream(data))) {
+            StringBuilder sb = new StringBuilder();
+            for (int n = is.read(buff); n > 0; n = is.read(buff)) {
+                sb.append(new String(buff, 0, n, StandardCharsets.UTF_8));
+            }
+            assertEquals(report, sb.toString());
+        }
+    }
+}
