mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-30 13:41:46 +00:00
Use existing utility to copy jstring
This commit is contained in:
parent
49f36bde02
commit
a5cc7abe38
|
@ -2311,13 +2311,13 @@ void Java_org_rocksdb_Options_setDailyOffpeakTimeUTC(JNIEnv* env, jclass,
|
|||
jlong jhandle,
|
||||
jstring jtimeutc) {
|
||||
auto* opt = reinterpret_cast<ROCKSDB_NAMESPACE::Options*>(jhandle);
|
||||
const jsize jtimesz = env->GetStringUTFLength(jtimeutc);
|
||||
const char* timeutc = env->GetStringUTFChars(jtimeutc, nullptr);
|
||||
if (env->ExceptionCheck()) {
|
||||
jboolean has_exception;
|
||||
auto timeutc =
|
||||
ROCKSDB_NAMESPACE::JniUtil::copyStdString(env, jtimeutc, &has_exception);
|
||||
if (has_exception == JNI_TRUE) {
|
||||
return;
|
||||
}
|
||||
opt->daily_offpeak_time_utc = std::string(timeutc, jtimesz);
|
||||
env->ReleaseStringUTFChars(jtimeutc, timeutc);
|
||||
opt->daily_offpeak_time_utc = timeutc;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue