From abbe6ce0973fbd82971ace1866515beefcc41817 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 25 Oct 2012 11:35:05 +0200
Subject: Fix Bug 608: Push down TempJarCache.findLibrary(..) from
 JNILibLoaderBase.loadLibraryInternal() to NativeLibrary.findLibrary(..)

This allows using TempJarCache (if used/initialized) for native 'tool' libraries as well.
This is the case of JOAL's attempt to load the provided 'libopenal.so'
---
 src/java/com/jogamp/common/jvm/JNILibLoaderBase.java | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

(limited to 'src/java/com/jogamp/common/jvm')

diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
index 827b361..94f451e 100644
--- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
+++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
@@ -425,20 +425,8 @@ public class JNILibLoaderBase {
           throw (UnsatisfiedLinkError) new UnsatisfiedLinkError("can not load library "+libraryName).initCause(e);
         }
     } else {
-      if(TempJarCache.isInitialized()) {
-          final String libraryPath = TempJarCache.findLibrary(libraryName);
-          if(null != libraryPath) {
-            if(DEBUG) {
-              System.err.println("JNILibLoaderBase: loadLibraryInternal("+libraryName+") -> System.load("+libraryPath+") (TempJarCache)");
-            }
-            System.load(libraryPath);
-            return; // done
-          } else if(DEBUG) {
-            System.err.println("JNILibLoaderBase: loadLibraryInternal("+libraryName+") -> TempJarCache not mapped");
-          }
-      }
       // System.err.println("sun.boot.library.path=" + Debug.getProperty("sun.boot.library.path", false));
-      final String libraryPath = NativeLibrary.findLibrary(libraryName, cl);
+      final String libraryPath = NativeLibrary.findLibrary(libraryName, cl); // implicit TempJarCache usage if used/initialized
       if(DEBUG) {
           System.err.print("JNILibLoaderBase: loadLibraryInternal("+libraryName+"): CL: "+libraryPath);
       }
-- 
cgit v1.2.3