summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-07-20 23:59:42 +0000
committerKenneth Russel <[email protected]>2007-07-20 23:59:42 +0000
commit1d260119d250f3e53f2fa886b224f3e402ea8d82 (patch)
tree7968d0a7132c0fbc0fe6da6757ba6f5b3ed8f17f
parent8ef7b6b277d4c527db269b573d20ebd08632a75e (diff)
Incorporated suggestion from Brian Burkhalter from JAI team to try to
propagate out UnsatisfiedLinkError instead of RuntimeException from recommended loadLibraryInternal method
-rw-r--r--src/org/jdesktop/applet/util/JNLPAppletLauncher.java17
-rw-r--r--www/index.html13
2 files changed, 26 insertions, 4 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);
diff --git a/www/index.html b/www/index.html
index f5a15ad..c83ea72 100644
--- a/www/index.html
+++ b/www/index.html
@@ -492,6 +492,7 @@
String sunAppletLauncher = System.getProperty("sun.jnlp.applet.launcher");
boolean usingJNLPAppletLauncher =
Boolean.valueOf(sunAppletLauncher).booleanValue();
+
if (usingJNLPAppletLauncher) {
try {
Class jnlpAppletLauncherClass =
@@ -501,7 +502,17 @@
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);