< prev index next >

src/hotspot/share/prims/jvm.cpp

Print this page
rev 56281 : 8218628: Add detailed message to NullPointerException describing what is null.
Summary: This is the implementation of JEP 358: Helpful NullPointerExceptions.
Reviewed-by: coleenp
rev 56283 : [mq]: fixes_review_of_16.patch

*** 572,585 **** } if (method->is_native()) { return NULL; } - ResourceMark rm(THREAD); stringStream ss; bool ok = BytecodeUtils::get_NPE_message_at(&ss, method, bci); if (ok) { char *result_string = ss.as_string(); trim_well_known_class_names(result_string); oop result = java_lang_String::create_oop_from_str(result_string, CHECK_0); return (jstring) JNIHandles::make_local(env, result); } else { --- 572,585 ---- } if (method->is_native()) { return NULL; } stringStream ss; bool ok = BytecodeUtils::get_NPE_message_at(&ss, method, bci); if (ok) { + ResourceMark rm(THREAD); char *result_string = ss.as_string(); trim_well_known_class_names(result_string); oop result = java_lang_String::create_oop_from_str(result_string, CHECK_0); return (jstring) JNIHandles::make_local(env, result); } else {
< prev index next >