< prev index next >

src/hotspot/share/classfile/javaClasses.cpp

Print this page

        

*** 381,398 **** if (_to_java_string_fn == NULL) { fatal("NewStringPlatform missing"); } } ! jstring js = NULL; ! { JavaThread* thread = (JavaThread*)THREAD; assert(thread->is_Java_thread(), "must be java thread"); HandleMark hm(thread); ThreadToNativeFromVM ttn(thread); js = (_to_java_string_fn)(thread->jni_environment(), str); } ! return Handle(THREAD, JNIHandles::resolve(js)); } // Converts a Java String to a native C string that can be used for // native OS calls. char* java_lang_String::as_platform_dependent_str(Handle java_string, TRAPS) { --- 381,403 ---- if (_to_java_string_fn == NULL) { fatal("NewStringPlatform missing"); } } ! JavaThread* thread = (JavaThread*)THREAD; assert(thread->is_Java_thread(), "must be java thread"); + + jstring js = NULL; + { HandleMark hm(thread); ThreadToNativeFromVM ttn(thread); js = (_to_java_string_fn)(thread->jni_environment(), str); } ! ! Handle native_platform_string(THREAD, JNIHandles::resolve(js)); ! JNIHandles::destroy_local(js); // destroy local JNIHandle. ! return native_platform_string; } // Converts a Java String to a native C string that can be used for // native OS calls. char* java_lang_String::as_platform_dependent_str(Handle java_string, TRAPS) {
< prev index next >