Skip to content

Commit 554f7ca

Browse files
committed
JNILibLoaderBase.addNativeJarLibsImpl: Enhance DEBUG output
1 parent 5400c3c commit 554f7ca

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/java/com/jogamp/common/jvm/JNILibLoaderBase.java

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,17 @@ private static final boolean addNativeJarLibsImpl(final Class<?> classFromJavaJa
214214
final Uri nativeJarURI = JarUtil.getJarFileUri( jarSubUriRoot.getEncoded().concat(nativeJarBasename) );
215215

216216
if (DEBUG) {
217-
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl: module: %s -> %s%n", nativeJarBasename, nativeJarURI);
217+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-1: module: %s -> %s%n", nativeJarBasename, nativeJarURI);
218218
}
219219

220220
try {
221221
ok = TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURI, nativeLibraryPath);
222+
if (DEBUG) {
223+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-1: OK "+ok+": %s -> %s%n", nativeJarURI, nativeLibraryPath);
224+
}
222225
} catch(final Exception e) {
223226
if(DEBUG) {
224-
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl: Caught %s%n", e.getMessage());
227+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-1: Caught %s%n", e.getMessage());
225228
e.printStackTrace();
226229
}
227230
}
@@ -235,18 +238,18 @@ private static final boolean addNativeJarLibsImpl(final Class<?> classFromJavaJa
235238
if (null != nativeLibraryURI) {
236239
final Uri nativeJarURI = JarUtil.getJarFileUri( jarSubUriRoot.getEncoded().concat(jarBasename) );
237240
try {
238-
if( TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURI, nativeLibraryPath) ) {
239-
ok = true;
240-
if (DEBUG) {
241-
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl: fat: %s -> %s%n", jarBasename, nativeJarURI);
242-
}
241+
ok = TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURI, nativeLibraryPath);
242+
if (DEBUG) {
243+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-2: OK "+ok+", fat: %s -> %s%n", nativeJarURI, nativeLibraryPath);
243244
}
244245
} catch(final Exception e) {
245246
if(DEBUG) {
246-
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl: Caught %s%n", e.getMessage());
247+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-2: Caught %s%n", e.getMessage());
247248
e.printStackTrace();
248249
}
249250
}
251+
} else if (DEBUG) {
252+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-2: CL couldn't locate %s in %s%n", nativeLibraryPath, jarBasename);
250253
}
251254
}
252255
if (!ok) {
@@ -267,17 +270,20 @@ private static final boolean addNativeJarLibsImpl(final Class<?> classFromJavaJa
267270
final String nativeJarTagClassName = nativeJarTagPackage + "." + moduleName + "." + os_and_arch_dot + ".TAG"; // TODO: sync with gluegen-cpptasks-base.xml
268271
try {
269272
if(DEBUG) {
270-
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl: ClassLoader/TAG: Locating module %s, os.and.arch %s: %s%n",
273+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-3: ClassLoader/TAG: Locating module %s, os.and.arch %s: %s%n",
271274
moduleName, os_and_arch_dot, nativeJarTagClassName);
272275
}
273276
final Uri nativeJarTagClassJarURI = JarUtil.getJarUri(nativeJarTagClassName, cl);
274277
if (DEBUG) {
275-
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl: ClassLoader/TAG: %s -> %s%n", nativeJarTagClassName, nativeJarTagClassJarURI);
278+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-3: ClassLoader/TAG: %s -> %s%n", nativeJarTagClassName, nativeJarTagClassJarURI);
276279
}
277280
ok = TempJarCache.addNativeLibs(classFromJavaJar, nativeJarTagClassJarURI, nativeLibraryPath);
281+
if (DEBUG) {
282+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-3: OK "+ok+": %s -> %s%n", nativeJarTagClassJarURI, nativeLibraryPath);
283+
}
278284
} catch (final Exception e ) {
279285
if(DEBUG) {
280-
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl: Caught %s%n", e.getMessage());
286+
System.err.printf("JNILibLoaderBase: addNativeJarLibsImpl-3: Caught %s%n", e.getMessage());
281287
e.printStackTrace();
282288
}
283289
}

0 commit comments

Comments
 (0)