diff --git a/pom.xml b/pom.xml index e195965..7ebc1d5 100755 --- a/pom.xml +++ b/pom.xml @@ -63,8 +63,8 @@ maven-compiler-plugin 2.0.2 - 1.6 - 1.6 + 1.5 + 1.5 diff --git a/src/main/java/org/xerial/snappy/SnappyLoader.java b/src/main/java/org/xerial/snappy/SnappyLoader.java index 91961bd..4775437 100755 --- a/src/main/java/org/xerial/snappy/SnappyLoader.java +++ b/src/main/java/org/xerial/snappy/SnappyLoader.java @@ -51,7 +51,7 @@ import java.util.Properties; * In default, no configuration is required to use snappy-java, but you can load * your own native library created by 'make native' command. * - * LoadSnappy searches for native libraries (snappyjava.dll, libsnappy.so, etc.) + * This SnappyLoader searches for native libraries (snappyjava.dll, libsnappy.so, etc.) * in the following order: *
    *
  1. (System property: org.xerial.snappy.lib.path)/(System property: @@ -132,7 +132,7 @@ public class SnappyLoader /** * Load SnappyNative and its JNI native implementation in the root class - * loader. This is necessary to avoid the JNI multi-loading issue when the + * loader. This process is necessary to avoid the JNI multi-loading issue when the * same JNI library is loaded by different class loaders in the same JVM. * * In order to load native code in the root class loader, this method first @@ -171,13 +171,14 @@ public class SnappyLoader try { if (!hasInjectedNativeLoader()) { - // Prepare SnappyNativeLoader or LocalSnappyNativeLoader + // Inject SnappyNativeLoader (src/main/resources/org/xerial/snappy/SnappyNativeLoader.bytecode) to the root class loader Class< ? > nativeLoader = injectSnappyNativeLoader(); - // Load the JNI code + // Load the JNI code using the injected loader loadNativeLibrary(nativeLoader); } isLoaded = true; + // Look up SnappyNative, injected to the root classloder, using reflection to order to avoid the initialization of SnappyNative class in this context class loader. api = (SnappyNativeAPI) Class.forName("org.xerial.snappy.SnappyNative").newInstance(); } catch (Exception e) {