Changeset 5827 in josm for trunk/src/org


Ignore:
Timestamp:
2013-04-05T01:24:03+02:00 (12 years ago)
Author:
Don-vip
Message:

see #8571 - Compress bug reports before encoding them to have shorter URLs (to avoid incomplete stacktraces on Windows systems)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java

    r5050 r5827  
    66import java.awt.Component;
    77import java.awt.GridBagLayout;
     8import java.io.ByteArrayOutputStream;
    89import java.io.PrintWriter;
    910import java.io.StringWriter;
    1011import java.net.URL;
    1112import java.nio.ByteBuffer;
     13import java.util.zip.GZIPOutputStream;
    1214
    1315import javax.swing.JCheckBox;
     
    118120                                urltext += "...<snip>...\n";
    119121                            }
     122                           
     123                            ByteArrayOutputStream out = new ByteArrayOutputStream();
     124                            GZIPOutputStream gzip = new GZIPOutputStream(out);
     125                            gzip.write(urltext.getBytes("UTF-8"));
     126                            gzip.close();
    120127
    121128                            URL url = new URL("http://josm.openstreetmap.de/josmticket?" +
    122                                     "tdata="+Base64.encode(ByteBuffer.wrap(urltext.getBytes("UTF8")), true));
     129                                    "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true));
    123130
    124131                            JPanel p = new JPanel(new GridBagLayout());
     
    126133                                    tr("You have encountered an error in JOSM. Before you file a bug report " +
    127134                                            "make sure you have updated to the latest version of JOSM here:")), GBC.eol());
    128                             p.add(new UrlLabel("http://josm.openstreetmap.de/#Download",2), GBC.eop().insets(8,0,0,0));
     135                            p.add(new UrlLabel("http://josm.openstreetmap.de",2), GBC.eop().insets(8,0,0,0));
    129136                            p.add(new JMultilineLabel(
    130137                                    tr("You should also update your plugins. If neither of those help please " +
Note: See TracChangeset for help on using the changeset viewer.