Changeset 10285 in josm


Ignore:
Timestamp:
2016-05-27T19:07:59+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #12875 - Add data to bug report (patch by michael2402)

Location:
trunk
Files:
4 added
2 edited

Legend:

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

    r10282 r10285  
    7575import org.openstreetmap.josm.tools.Shortcut;
    7676import org.openstreetmap.josm.tools.Utils;
     77import org.openstreetmap.josm.tools.bugreport.BugReport;
    7778import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
    7879
     
    750751
    751752    private void paintLayer(Layer layer, Graphics2D g, Bounds box) {
    752         if (layer.getOpacity() < 1) {
    753             g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) layer.getOpacity()));
    754         }
    755         layer.paint(g, this, box);
    756         g.setPaintMode();
     753        try {
     754            if (layer.getOpacity() < 1) {
     755                g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, (float) layer.getOpacity()));
     756            }
     757            layer.paint(g, this, box);
     758            g.setPaintMode();
     759        } catch (RuntimeException t) {
     760            throw BugReport.intercept(t).put("layer", layer).put("bounds", box);
     761        }
    757762    }
    758763
  • trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandler.java

    r10214 r10285  
    198198    static JPanel buildPanel(final Throwable e) {
    199199        StringWriter stack = new StringWriter();
    200         e.printStackTrace(new PrintWriter(stack));
     200        PrintWriter writer = new PrintWriter(stack);
     201        if (e instanceof ReportedException) {
     202            // Temporary!
     203            ((ReportedException) e).printReportDataTo(writer);
     204            ((ReportedException) e).printReportStackTo(writer);
     205        } else {
     206            e.printStackTrace(writer);
     207        }
    201208
    202209        String text = ShowStatusReportAction.getReportHeader() + stack.getBuffer().toString();
Note: See TracChangeset for help on using the changeset viewer.