Class BugReportSender
java.lang.Object
java.lang.Thread
org.openstreetmap.josm.tools.bugreport.BugReportSender
- All Implemented Interfaces:
Runnable
This class handles sending the bug report to JOSM website.
Currently, we try to open a browser window for the user that displays the bug report.
- Since:
- 10055
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classstatic interfaceCalled during bug submission to JOSM bugtracker.Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringstatic final BugReportSender.BugReportSendingHandlerThe fallback bug report sending handler if none is set.private static BugReportSender.BugReportSendingHandlerprivate final StringFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringReturns the error message that could have occurred during bug sending.private static Stringprivate StringSends the debug text to the server.static BugReportSenderOpens the bug report window on the JOSM server.private static StringretrieveDebugToken(Document document) voidrun()static voidsetBugReportSendingHandler(BugReportSender.BugReportSendingHandler bugReportSendingHandler) Sets theBugReportSender.BugReportSendingHandlerfor bug report sender.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
FALLBACK_BUGREPORT_SENDING_HANDLER
The fallback bug report sending handler if none is set.- Since:
- 12790
-
handler
-
statusText
-
errorMessage
-
-
Constructor Details
-
BugReportSender
Creates a new sender.- Parameters:
statusText- The status text to send.
-
-
Method Details
-
run
-
pasteDebugText
Sends the debug text to the server.- Returns:
- The token which was returned by the server. We need to pass this on to the ticket system.
- Throws:
BugReportSender.BugReportSenderException- if sending the report failed.
-
getJOSMTicketURL
-
retrieveDebugToken
private static String retrieveDebugToken(Document document) throws XPathExpressionException, BugReportSender.BugReportSenderException -
getErrorMessage
Returns the error message that could have occurred during bug sending.- Returns:
- the error message, or
nullif successful
-
reportBug
Opens the bug report window on the JOSM server.- Parameters:
statusText- The status text to send along to the server.- Returns:
- bug report sender started thread
-
setBugReportSendingHandler
public static void setBugReportSendingHandler(BugReportSender.BugReportSendingHandler bugReportSendingHandler) Sets theBugReportSender.BugReportSendingHandlerfor bug report sender.- Parameters:
bugReportSendingHandler- the handler in charge of completing the bug report submission and handle errors. Must not be null- Since:
- 12790
-