summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/os
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2015-02-05 00:19:22 +0100
committerSven Gothel <[email protected]>2015-02-05 00:19:22 +0100
commitdd2440cbadc642a561d8f92c502fe822b2f11762 (patch)
tree1e47c7c25d70050c70f047636b453a535d7355fa /src/java/com/jogamp/common/os
parent2328173804f78f536b161f31d7c73be16823c7f3 (diff)
Refine commit 12feaa7d3b1544098f684d851e3caff1ec88cbc8: Add 'throws SecurityException' decl., remove dead code, remove redundant check.
Diffstat (limited to 'src/java/com/jogamp/common/os')
-rw-r--r--src/java/com/jogamp/common/os/DynamicLibraryBundle.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
index 06cef6f..c578565 100644
--- a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
+++ b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
@@ -231,7 +231,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
public final DynamicLibraryBundleInfo getBundleInfo() { return info; }
- protected final long getToolGetProcAddressHandle() {
+ protected final long getToolGetProcAddressHandle() throws SecurityException {
if(!isToolLibLoaded()) {
return 0;
}
@@ -246,7 +246,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
return aptr;
}
- protected static final NativeLibrary loadFirstAvailable(final List<String> libNames, final ClassLoader loader, final boolean global) {
+ protected static final NativeLibrary loadFirstAvailable(final List<String> libNames, final ClassLoader loader, final boolean global) throws SecurityException {
for (int i=0; i < libNames.size(); i++) {
final NativeLibrary lib = NativeLibrary.open(libNames.get(i), loader, global);
if (lib != null) {
@@ -256,7 +256,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
return null;
}
- final DynamicLinker loadLibraries() {
+ final DynamicLinker loadLibraries() throws SecurityException {
int i;
toolLibLoadedNumber = 0;
final ClassLoader cl = info.getClass().getClassLoader();
@@ -317,7 +317,12 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
return dynLinkGlobal;
}
- private final long dynamicLookupFunctionOnLibs(final String funcName) {
+ /**
+ * @param funcName
+ * @return
+ * @throws SecurityException if user is not granted access for the library set.
+ */
+ private final long dynamicLookupFunctionOnLibs(final String funcName) throws SecurityException {
if(!isToolLibLoaded() || null==funcName) {
if(DEBUG_LOOKUP && !isToolLibLoaded()) {
System.err.println("Lookup-Native: <" + funcName + "> ** FAILED ** Tool native library not loaded");
@@ -364,7 +369,6 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
@Override
public final void claimAllLinkPermission() throws SecurityException {
for (int i=0; i < nativeLibraries.size(); i++) {
- final NativeLibrary lib = nativeLibraries.get(i);
nativeLibraries.get(i).claimAllLinkPermission();
}
}
@@ -376,7 +380,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
@Override
- public final long dynamicLookupFunction(final String funcName) {
+ public final long dynamicLookupFunction(final String funcName) throws SecurityException {
if(!isToolLibLoaded() || null==funcName) {
if(DEBUG_LOOKUP && !isToolLibLoaded()) {
System.err.println("Lookup: <" + funcName + "> ** FAILED ** Tool native library not loaded");
@@ -404,7 +408,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
@Override
- public final boolean isFunctionAvailable(final String funcName) {
+ public final boolean isFunctionAvailable(final String funcName) throws SecurityException {
return 0 != dynamicLookupFunction(funcName);
}