diff options
author | Kenneth Russel <[email protected]> | 2007-07-20 23:59:42 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2007-07-20 23:59:42 +0000 |
commit | 1d260119d250f3e53f2fa886b224f3e402ea8d82 (patch) | |
tree | 7968d0a7132c0fbc0fe6da6757ba6f5b3ed8f17f /src | |
parent | 8ef7b6b277d4c527db269b573d20ebd08632a75e (diff) |
Incorporated suggestion from Brian Burkhalter from JAI team to try to
propagate out UnsatisfiedLinkError instead of RuntimeException from
recommended loadLibraryInternal method
Diffstat (limited to 'src')
-rw-r--r-- | src/org/jdesktop/applet/util/JNLPAppletLauncher.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/org/jdesktop/applet/util/JNLPAppletLauncher.java b/src/org/jdesktop/applet/util/JNLPAppletLauncher.java index 6b3b45c..7237f7d 100644 --- a/src/org/jdesktop/applet/util/JNLPAppletLauncher.java +++ b/src/org/jdesktop/applet/util/JNLPAppletLauncher.java @@ -37,8 +37,8 @@ * intended for use in the design, construction, operation or * maintenance of any nuclear facility. * - * $Revision: 1.17 $ - * $Date: 2007/07/20 23:46:40 $ + * $Revision: 1.18 $ + * $Date: 2007/07/20 23:59:42 $ * $State: Exp $ */ @@ -569,6 +569,7 @@ import org.xml.sax.helpers.DefaultHandler; * String sunAppletLauncher = System.getProperty("sun.jnlp.applet.launcher"); * boolean usingJNLPAppletLauncher = * Boolean.valueOf(sunAppletLauncher).booleanValue(); + * * if (usingJNLPAppletLauncher) { * try { * Class jnlpAppletLauncherClass = @@ -578,7 +579,17 @@ import org.xml.sax.helpers.DefaultHandler; * new Class[] { String.class }); * jnlpLoadLibraryMethod.invoke(null, new Object[] { libraryName }); * } catch (Exception e) { - * throw new RuntimeException(e); + * Throwable t = e; + * if (t instanceof InvocationTargetException) { + * t = ((InvocationTargetException) t).getTargetException(); + * } + * if (t instanceof Error) + * throw (Error) t; + * if (t instanceof RuntimeException) { + * throw (RuntimeException) t; + * } + * // Throw UnsatisfiedLinkError for best compatibility with System.loadLibrary() + * throw (UnsatisfiedLinkError) new UnsatisfiedLinkError().initCause(e); * } * } else { * System.loadLibrary(libraryName); |