Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/hotspot/share/classfile/javaClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,16 +456,18 @@ char* java_lang_String::as_platform_dependent_str(Handle java_string, TRAPS) {
}

char *native_platform_string;
{ JavaThread* thread = THREAD;
jstring js = (jstring) JNIHandles::make_local(thread, java_string());
bool is_copy;
JavaThread* thread = THREAD;
jstring js = (jstring) JNIHandles::make_local(thread, java_string());
{
HandleMark hm(thread);
ThreadToNativeFromVM ttn(thread);
JNIEnv *env = thread->jni_environment();
bool is_copy;
native_platform_string = (_to_platform_string_fn)(env, js, &is_copy);
assert(is_copy == JNI_TRUE, "is_copy value changed");
JNIHandles::destroy_local(js);
}
JNIHandles::destroy_local(js);

return native_platform_string;
}

Expand Down