# HG changeset patch # User twisti # Date 1372830683 25200 # Node ID cde003d396e120ba00dbc16d79da5014e3aeb6be # Parent 61bfc8995bb36e9b78bff12015e05154f6c058f1# Parent 3b95160639d8df3e405c763e74db752d4437d330 Merge diff -r 61bfc8995bb3 -r cde003d396e1 hotspot/src/share/vm/prims/methodHandles.cpp --- a/hotspot/src/share/vm/prims/methodHandles.cpp Tue Jul 02 20:42:12 2013 -0400 +++ b/hotspot/src/share/vm/prims/methodHandles.cpp Tue Jul 02 22:51:23 2013 -0700 @@ -1137,7 +1137,12 @@ if (VerifyMethodHandles && caller_jh != NULL && java_lang_invoke_MemberName::clazz(mname()) != NULL) { Klass* reference_klass = java_lang_Class::as_Klass(java_lang_invoke_MemberName::clazz(mname())); - if (reference_klass != NULL) { + if (reference_klass != NULL && reference_klass->oop_is_objArray()) { + reference_klass = ObjArrayKlass::cast(reference_klass)->bottom_klass(); + } + + // Reflection::verify_class_access can only handle instance classes. + if (reference_klass != NULL && reference_klass->oop_is_instance()) { // Emulate LinkResolver::check_klass_accessability. Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh)); if (!Reflection::verify_class_access(caller, diff -r 61bfc8995bb3 -r cde003d396e1 hotspot/src/share/vm/runtime/reflection.cpp --- a/hotspot/src/share/vm/runtime/reflection.cpp Tue Jul 02 20:42:12 2013 -0400 +++ b/hotspot/src/share/vm/runtime/reflection.cpp Tue Jul 02 22:51:23 2013 -0700 @@ -458,7 +458,7 @@ // doesn't have a classloader. if ((current_class == NULL) || (current_class == new_class) || - (InstanceKlass::cast(new_class)->is_public()) || + (new_class->is_public()) || is_same_class_package(current_class, new_class)) { return true; }