GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — NativeLibraryLoader: unfold loading code for easier reading. · mimoccc/objectbox-java@77a2b0b

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • objectbox-java/src/main/java/io/objectbox/internal
    • NativeLibraryLoader.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/internal/NativeLibraryLoader.java
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,21 @@ public class NativeLibraryLoader {
7878
if (file.exists()) {
7979
System.load(file.getAbsolutePath());
8080
} else {
81-
if (!android) {
82-
System.err.println("File not available: " + file.getAbsolutePath());
83-
}
8481
try {
85-
if (!android || !loadLibraryAndroid()) { // if android && loadLibraryAndroid OK: done
82+
if (android) {
83+
boolean success = loadLibraryAndroid();
84+
if (!success) {
85+
System.loadLibrary(libname);
86+
}
87+
} else {
88+
System.err.println("File not available: " + file.getAbsolutePath());
8689
System.loadLibrary(libname);
8790
}
8891
} catch (UnsatisfiedLinkError e) {
8992
if (!android && isLinux) {
9093
// maybe is Android, but check failed: try loading Android lib
91-
if (!loadLibraryAndroid()) {
94+
boolean success = loadLibraryAndroid();
95+
if (!success) {
9296
System.loadLibrary(OBJECTBOX_JNI);
9397
}
9498
} else {
@@ -138,7 +142,6 @@ private static void checkUnpackLib(String filename) {
138142
}
139143
}
140144

141-
@SuppressWarnings("BooleanMethodIsAlwaysInverted") // more readable
142145
private static boolean loadLibraryAndroid() {
143146
if (BoxStore.context == null) {
144147
return false;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.