Ignore:
Timestamp:
2016-03-28T00:22:42+02:00 (8 years ago)
Author:
Don-vip
Message:

see #12652 - about dialog: replace old bug report link with new bug report button, remove unused code

File:
1 edited

Legend:

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

    r10055 r10062  
    77import java.awt.GridBagConstraints;
    88import java.awt.GridBagLayout;
    9 import java.io.ByteArrayOutputStream;
    109import java.io.IOException;
    1110import java.io.PrintWriter;
    1211import java.io.StringWriter;
    13 import java.net.URL;
    14 import java.nio.ByteBuffer;
    15 import java.nio.charset.StandardCharsets;
    16 import java.util.zip.GZIPOutputStream;
    1712
    1813import javax.swing.JButton;
     
    3328import org.openstreetmap.josm.plugins.PluginDownloadTask;
    3429import org.openstreetmap.josm.plugins.PluginHandler;
    35 import org.openstreetmap.josm.tools.Base64;
    3630import org.openstreetmap.josm.tools.GBC;
    3731import org.openstreetmap.josm.tools.WikiReader;
     
    154148
    155149    /**
    156      * Handles the given throwable object
    157      * @param t The throwable object
    158      */
    159     public void handle(Throwable t) {
    160         handleException(t);
    161     }
    162 
    163     /**
    164150     * Handles the given exception
    165151     * @param e the exception
     
    253239        return handlingInProgress;
    254240    }
    255 
    256     /**
    257      * Replies the URL to create a JOSM bug report with the given debug text. GZip is used to reduce the length of the parameter.
    258      * @param debugText The debug text to provide us
    259      * @return The URL to create a JOSM bug report with the given debug text
    260      * @see BugReportSender#reportBug(String) if you want to send long debug texts along.
    261      * @since 5849
    262      */
    263     public static URL getBugReportUrl(String debugText) {
    264         try (
    265             ByteArrayOutputStream out = new ByteArrayOutputStream();
    266             GZIPOutputStream gzip = new GZIPOutputStream(out)
    267         ) {
    268             gzip.write(debugText.getBytes(StandardCharsets.UTF_8));
    269             gzip.finish();
    270 
    271             return new URL(Main.getJOSMWebsite()+"/josmticket?" +
    272                     "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true));
    273         } catch (IOException e) {
    274             Main.error(e);
    275             return null;
    276         }
    277     }
    278 
    279     /**
    280      * Replies the URL label to create a JOSM bug report with the given debug text
    281      * @param debugText The debug text to provide us
    282      * @return The URL label to create a JOSM bug report with the given debug text
    283      * @since 5849
    284      */
    285     public static UrlLabel getBugReportUrlLabel(String debugText) {
    286         URL url = getBugReportUrl(debugText);
    287         if (url != null) {
    288             return new UrlLabel(url.toString(), Main.getJOSMWebsite()+"/josmticket?...", 2);
    289         }
    290         return null;
    291     }
    292241}
Note: See TracChangeset for help on using the changeset viewer.