Skip to content

Commit 9c5475c

Browse files
committed
throw LinkageError instead of RuntimeException to wrap UnsatisfiedLinkError
1 parent 3b7fe18 commit 9c5475c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

objectbox-java/src/main/java/io/objectbox/internal/NativeLibraryLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public class NativeLibraryLoader {
8282
System.err.println("File not available: " + file.getAbsolutePath());
8383
}
8484
try {
85-
if (!android || !loadLibraryAndroid(libname)) {
85+
if (!android || !loadLibraryAndroid(libname)) { // if android && loadLibraryAndroid OK: done
8686
System.loadLibrary(libname);
8787
}
8888
} catch (UnsatisfiedLinkError e) {
@@ -101,7 +101,7 @@ public class NativeLibraryLoader {
101101
"Loading ObjectBox native library failed: vendor=%s,os=%s,arch=%s,android=%s,linux=%s",
102102
vendor, osName, sunArch, android, isLinux
103103
);
104-
throw new RuntimeException(message, e);
104+
throw new LinkageError(message, e); // UnsatisfiedLinkError does not allow a cause; use its super class
105105
}
106106
}
107107

0 commit comments

Comments
 (0)