aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl/NativeLibLoader.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-07-21 00:06:04 +0000
committerKenneth Russel <[email protected]>2007-07-21 00:06:04 +0000
commit5fb4d8ff3289ab5905f53edebd7ced396c6860d6 (patch)
tree65c34e74b4a1567f3a976ed28df51cc70b0c4b8f /src/classes/com/sun/opengl/impl/NativeLibLoader.java
parent5b2803ebb3ac8957f7b33f9bfd74c085e9ab720a (diff)
Synced loadLibraryInternal implementation with JNLPAppletLauncher's
recommended code git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1307 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/NativeLibLoader.java')
-rw-r--r--src/classes/com/sun/opengl/impl/NativeLibLoader.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/impl/NativeLibLoader.java b/src/classes/com/sun/opengl/impl/NativeLibLoader.java
index 91745d561..522b81a03 100644
--- a/src/classes/com/sun/opengl/impl/NativeLibLoader.java
+++ b/src/classes/com/sun/opengl/impl/NativeLibLoader.java
@@ -40,6 +40,7 @@
package com.sun.opengl.impl;
import java.awt.Toolkit;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -172,7 +173,17 @@ public class NativeLibLoader {
}
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);