diff --git a/util/env_windows.cc b/util/env_windows.cc index b2969911a2..a747db5c5d 100644 --- a/util/env_windows.cc +++ b/util/env_windows.cc @@ -153,25 +153,6 @@ class WindowsFileLock : public FileLock { } }; -class WindowsLogger : public Logger { - WritableFile* log_; - -public: - WindowsLogger(WritableFile* log) : log_(log) {} - virtual ~WindowsLogger() { delete log_; } - - // Write an entry to the log file with the specified format. - virtual void Logv(const char* format, va_list ap) { - const size_t kBufSize = 4096; - char buffer[kBufSize]; - int written = vsnprintf(buffer, kBufSize - 1, format, ap); - if(written < 0) written = kBufSize - 1; - buffer[written++] = '\n'; - log_->Append(Slice(buffer, written)); - log_->Flush(); - } -}; - } class WindowsEnv : public Env { diff --git a/util/jni.cc b/util/jni.cc index 39ee1bec76..6230b69c39 100644 --- a/util/jni.cc +++ b/util/jni.cc @@ -207,7 +207,9 @@ extern "C" JNIEXPORT jint JNICALL DEF_JAVA(leveldb_1write) mid_getKey = jenv->GetMethodID(cls_entry, "getKey", "()Ljava/lang/Object;"); mid_getValue = jenv->GetMethodID(cls_entry, "getValue", "()Ljava/lang/Object;"); fid_buffer = jenv->GetFieldID(cls_octets, "_buffer", "[B"); + if(!fid_buffer) fid_buffer = jenv->GetFieldID(cls_octets, "buffer", "[B"); fid_count = jenv->GetFieldID(cls_octets, "_count", "I"); + if(!fid_count) fid_count = jenv->GetFieldID(cls_octets, "count", "I"); if(!mid_hasNext || !mid_next || !mid_getKey || !mid_getValue || !fid_buffer || !fid_count) return s_err = 3; s_err = 0; }