8024260: 10 closed/java/lang/invoke/* tests failing after overhaul to MethodHandleInfo
Reviewed-by: vlivanov, briangoetz
Contributed-by: john.r.rose@oracle.com
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandle.java Thu Sep 05 14:58:49 2013 -0700
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandle.java Fri Sep 06 00:43:00 2013 -0700
@@ -1286,7 +1286,17 @@
/*non-public*/
MethodHandle withInternalMemberName(MemberName member) {
- return MethodHandleImpl.makeWrappedMember(this, member);
+ if (member != null) {
+ return MethodHandleImpl.makeWrappedMember(this, member);
+ } else if (internalMemberName() == null) {
+ // The required internaMemberName is null, and this MH (like most) doesn't have one.
+ return this;
+ } else {
+ // The following case is rare. Mask the internalMemberName by wrapping the MH in a BMH.
+ MethodHandle result = rebind();
+ assert (result.internalMemberName() == null);
+ return result;
+ }
}
/*non-public*/