From c06c5ab6dc8a8aa1b41af190188d1de99345810f Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Wed, 30 Jan 2013 16:51:08 +0100 Subject: Splashscreen error report made more detailed by stored LaunchErrors * netx/net/sourceforge/jnlp/LaunchException.java: (LaunchExceptionWithStamp) new inner class for storing timestamp togetehr with error. (launchExceptionChain) new static list to capture LaunchErrors during runtime. * /netx/net/sourceforge/jnlp/resources/Messages.properties: * netx/net/sourceforge/jnlp/resources/Messages_cs_CZ.properties: Added explanation string * netx/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialog.java: Is now displaying launchExceptionChain in its error report and is copying it to clipboard. * tests/unit/net/sourceforge/jnlp/splashscreen/parts/JEditorPaneBasedExceptionDialogTest.java: (getTextTest) adapted calls of getText for new Date. --- netx/net/sourceforge/jnlp/LaunchException.java | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'netx/net/sourceforge/jnlp/LaunchException.java') diff --git a/netx/net/sourceforge/jnlp/LaunchException.java b/netx/net/sourceforge/jnlp/LaunchException.java index 6c194ed..818df1e 100644 --- a/netx/net/sourceforge/jnlp/LaunchException.java +++ b/netx/net/sourceforge/jnlp/LaunchException.java @@ -16,6 +16,11 @@ package net.sourceforge.jnlp; +import java.util.Collections; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + /** * Thrown when a JNLP application, applet, or installer could not * be created. @@ -25,6 +30,29 @@ package net.sourceforge.jnlp; */ public class LaunchException extends Exception { + + public static class LaunchExceptionWithStamp{ + private final LaunchException ex; + private final Date stamp; + + private LaunchExceptionWithStamp(LaunchException ex) { + this.ex=ex; + this.stamp=new Date(); + } + + public LaunchException getEx() { + return ex; + } + + public Date getStamp() { + return stamp; + } + + + + } + private static final List launchExceptionChain = Collections.synchronizedList(new LinkedList()); + private static final long serialVersionUID = 7283827853612357423L; /** the file being launched */ @@ -54,6 +82,7 @@ public class LaunchException extends Exception { this.summary = summary; this.description = description; this.severity = severity; + saveLaunchException(this); } /** @@ -61,6 +90,7 @@ public class LaunchException extends Exception { */ public LaunchException(Throwable cause) { super(cause); + saveLaunchException(this); } /** @@ -68,6 +98,7 @@ public class LaunchException extends Exception { */ public LaunchException(String message, Throwable cause) { super(message, cause); + saveLaunchException(this); } /** @@ -78,6 +109,7 @@ public class LaunchException extends Exception { */ public LaunchException(String message) { super(message); + saveLaunchException(this); } /** @@ -117,4 +149,15 @@ public class LaunchException extends Exception { return severity; } + private synchronized void saveLaunchException(LaunchException ex) { + launchExceptionChain.add(new LaunchExceptionWithStamp(ex)); + + } + + public synchronized static List getLaunchExceptionChain() { + return launchExceptionChain; + } + + + } -- cgit v1.2.3