diff options
Diffstat (limited to 'make/joal-common-CustomJavaCode.java')
-rw-r--r-- | make/joal-common-CustomJavaCode.java | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/make/joal-common-CustomJavaCode.java b/make/joal-common-CustomJavaCode.java index be6b8a7..5df6cfd 100644 --- a/make/joal-common-CustomJavaCode.java +++ b/make/joal-common-CustomJavaCode.java @@ -7,22 +7,21 @@ static { throw new RuntimeException("Couldn't instantiate ALProcAddressTable"); } - alDynamicLookupHelper = (DynamicLibraryBundle) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - return new DynamicLibraryBundle(new ALDynamicLibraryBundleInfo()); - } - }); - if(null==alDynamicLookupHelper) { - throw new RuntimeException("Null ALDynamicLookupHelper"); - } - if(!alDynamicLookupHelper.isToolLibLoaded()) { - throw new RuntimeException("Couln't load native AL library"); - } - if(!alDynamicLookupHelper.isLibComplete()) { - throw new RuntimeException("Couln't load native AL/JNI glue library"); - } - alProcAddressTable.reset(alDynamicLookupHelper); + alDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() { + public DynamicLibraryBundle run() { + final DynamicLibraryBundle bundle = new DynamicLibraryBundle(new ALDynamicLibraryBundleInfo()); + if(null==bundle) { + throw new RuntimeException("Null ALDynamicLookupHelper"); + } + if(!bundle.isToolLibLoaded()) { + throw new RuntimeException("Couln't load native AL library"); + } + if(!bundle.isLibComplete()) { + throw new RuntimeException("Couln't load native AL/JNI glue library"); + } + alProcAddressTable.reset(bundle); + return bundle; + } } ); } public static ALProcAddressTable getALProcAddressTable() { return alProcAddressTable; } |