GeezerVison is showing github.com — fix public static native methods: ensure native lib is loaded first · Night-Kang/objectbox-java@3387d3e
File tree
Expand file treeCollapse file tree
Open diff view settings
objectbox-java/src/main/java/io/objectbox
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: objectbox-java/src/main/java/io/objectbox/BoxStore.java +13-3Lines changed: 13 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
59 | 59 | @ThreadSafe |
60 | 60 | public class BoxStore implements Closeable { |
61 | 61 |
|
62 | | - private static final String VERSION = "1.4.4-2018-03-08"; |
| 62 | + private static final String VERSION = "1.4.5-2018-03-11"; |
63 | 63 | private static BoxStore defaultStore; |
64 | 64 |
|
65 | 65 | private static final Set<String> openFiles = new HashSet<>(); |
@@ -97,7 +97,12 @@ public static synchronized boolean clearDefaultStore() { |
97 | 97 | return existedBefore; |
98 | 98 | } |
99 | 99 |
|
100 | | - public static native String getVersionNative(); |
| 100 | + static native String nativeGetVersion(); |
| 101 | + |
| 102 | + public static String getVersionNative() { |
| 103 | + NativeLibraryLoader.ensureLoaded(); |
| 104 | + return nativeGetVersion(); |
| 105 | + } |
101 | 106 |
|
102 | 107 | /** |
103 | 108 | * Diagnostics: If this method crashes on a device, please send us the logcat output. |
@@ -132,7 +137,12 @@ static native void nativeRegisterCustomType(long store, int entityId, int proper |
132 | 137 |
|
133 | 138 | static native String nativeStartObjectBrowser(long store, @Nullable String urlPath, int port); |
134 | 139 |
|
135 | | - public static native boolean isObjectBrowserAvailable(); |
| 140 | + static native boolean nativeIsObjectBrowserAvailable(); |
| 141 | + |
| 142 | + public static boolean isObjectBrowserAvailable() { |
| 143 | + NativeLibraryLoader.ensureLoaded(); |
| 144 | + return nativeIsObjectBrowserAvailable(); |
| 145 | + } |
136 | 146 |
|
137 | 147 | public static String getVersion() { |
138 | 148 | return VERSION; |
|