Removed unnecessary code

This commit is contained in:
Taro L. Saito 2014-06-26 14:33:54 +09:00
parent 199cdaced2
commit 492be99787
5 changed files with 13 additions and 71 deletions

2
.gitignore vendored
View File

@ -20,4 +20,6 @@ project/plugins/project/
# Scala-IDE specific
.scala_dependencies
atlassian-ide-plugin.xml

View File

@ -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

View File

@ -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

View File

@ -1,59 +0,0 @@
/*--------------------------------------------------------------------------
* Copyright 2011 Taro L. Saito
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*--------------------------------------------------------------------------*/
//--------------------------------------
// XerialJ
//
// SnappyNativeLoader.java
// Since: 2011/07/04 12:10:28
//
// $URL$
// $Author$
//--------------------------------------
package org.xerial.snappy;
import java.util.HashMap;
public class SnappyNativeLoader
{
private static HashMap<String, Boolean> loadedLibFiles = new HashMap<String, Boolean>();
private static HashMap<String, Boolean> loadedLib = new HashMap<String, Boolean>();
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();
}
}
}