From 492be99787f83e0d82110cad7462d16ddee76077 Mon Sep 17 00:00:00 2001 From: "Taro L. Saito" Date: Thu, 26 Jun 2014 14:33:54 +0900 Subject: [PATCH] Removed unnecessary code --- .gitignore | 2 + Makefile | 19 +++--- README.md | 4 ++ .../xerial/snappy/SnappyNativeLoader.bytecode | Bin 1179 -> 0 bytes .../org/xerial/snappy/SnappyNativeLoader.java | 59 ------------------ 5 files changed, 13 insertions(+), 71 deletions(-) delete mode 100755 src/main/resources/org/xerial/snappy/SnappyNativeLoader.bytecode delete mode 100755 src/main/resources/org/xerial/snappy/SnappyNativeLoader.java diff --git a/.gitignore b/.gitignore index 8a15362..fc37fa8 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,6 @@ project/plugins/project/ # Scala-IDE specific .scala_dependencies +atlassian-ide-plugin.xml + diff --git a/Makefile b/Makefile index de5936a..d626790 100644 --- a/Makefile +++ b/Makefile @@ -51,19 +51,12 @@ $(SNAPPY_GIT_UNPACKED): jni-header: $(SRC)/org/xerial/snappy/SnappyNative.h -$(TARGET)/classes/org/xerial/snappy/SnappyNative.class : $(SRC)/org/xerial/snappy/SnappyNative.java - @mkdir -p $(TARGET)/classes - $(JAVAC) -source 1.6 -target 1.6 -d $(TARGET)/classes -sourcepath $(SRC) $< +$(TARGET)/jni-classes/org/xerial/snappy/SnappyNative.class : $(SRC)/org/xerial/snappy/SnappyNative.java + @mkdir -p $(TARGET)/jni-classes + $(JAVAC) -source 1.6 -target 1.6 -d $(TARGET)/jni-classes -sourcepath $(SRC) $< -$(SRC)/org/xerial/snappy/SnappyNative.h: $(TARGET)/classes/org/xerial/snappy/SnappyNative.class - $(JAVAH) -classpath $(TARGET)/classes -o $@ org.xerial.snappy.SnappyNative - -bytecode: src/main/resources/org/xerial/snappy/SnappyNativeLoader.bytecode - -src/main/resources/org/xerial/snappy/SnappyNativeLoader.bytecode: src/main/resources/org/xerial/snappy/SnappyNativeLoader.java - @mkdir -p $(TARGET)/temp - $(JAVAC) -source 1.5 -target 1.5 -d $(TARGET)/temp $< - cp $(TARGET)/temp/org/xerial/snappy/SnappyNativeLoader.class $@ +$(SRC)/org/xerial/snappy/SnappyNative.h: $(TARGET)/jni-classes/org/xerial/snappy/SnappyNative.class + $(JAVAH) -force -classpath $(TARGET)/classes -o $@ org.xerial.snappy.SnappyNative ifndef USE_GIT $(SNAPPY_SRC): $(SNAPPY_UNPACKED) @@ -110,6 +103,8 @@ $(NATIVE_DLL): $(SNAPPY_OUT)/$(LIBNAME) cp $< $(NATIVE_TARGET_DIR)/$(LIBNAME) +package: $(TARGET)/$(snappy-jar-version).jar + $(TARGET)/$(snappy-jar-version).jar: $(SBT) package diff --git a/README.md b/README.md index 6739c34..83488d6 100755 --- a/README.md +++ b/README.md @@ -136,6 +136,10 @@ If you are using Mac and openjdk7 (or higher), use the following option: $ make native LIBNAME=libsnappyjava.dylib +## Running tests + + $ make test + ## Miscellaneous Notes ### Using snappy-java with Tomcat 6 (or higher) Web Server diff --git a/src/main/resources/org/xerial/snappy/SnappyNativeLoader.bytecode b/src/main/resources/org/xerial/snappy/SnappyNativeLoader.bytecode deleted file mode 100755 index 64c0fe86a245d6ee88b1b8a84c0042c7389da0ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1179 zcma)4TTc@~6#k|xY*|L2V!;bYfeLN8ELD(8D-Rlti4`77F!DBC#=5xd*6o(SPw~w+ zpTVRMO^na}DC3!JDXSRc%gmW`zWKg$`|+WJ1THjyyxZa0?rXsH4ZwQ?y+>*kI_& zWOo>}C*B^>50q?IZZ-}o(%%*phdi44!;s8GINK`fU!Mw70lx5$8RA9DY10~Iui;x# z6~-`9c15jryeR_vP?l8D{(`EMV+1!ju49PfJ|1u^VVNNjHX*F1oju1xtms(fxPwuS zHLP loadedLibFiles = new HashMap(); - private static HashMap loadedLib = new HashMap(); - - public static synchronized void load(String lib) { - if (loadedLibFiles.containsKey(lib) && loadedLibFiles.get(lib) == true) - return; - - try { - System.load(lib); - loadedLibFiles.put(lib, true); - } - catch (Exception e) { - e.printStackTrace(); - } - } - - public static synchronized void loadLibrary(String libname) { - if (loadedLib.containsKey(libname) && loadedLib.get(libname) == true) - return; - - try { - System.loadLibrary(libname); - loadedLib.put(libname, true); - } - catch (Exception e) { - e.printStackTrace(); - } - } -}