< prev index next >
src/java.base/share/classes/java/lang/invoke/MethodHandle.java
Print this page
rev 59151 : imported patch viewAs
*** 1638,1653 ****
}
/*non-public*/
MethodHandle viewAsType(MethodType newType, boolean strict) {
// No actual conversions, just a new view of the same method.
! // Note that this operation must not produce a DirectMethodHandle,
! // because retyped DMHs, like any transformed MHs,
! // cannot be cracked into MethodHandleInfo.
assert viewAsTypeChecks(newType, strict);
! BoundMethodHandle mh = rebind();
! return mh.copyWith(newType, mh.form);
}
/*non-public*/
boolean viewAsTypeChecks(MethodType newType, boolean strict) {
if (strict) {
--- 1638,1650 ----
}
/*non-public*/
MethodHandle viewAsType(MethodType newType, boolean strict) {
// No actual conversions, just a new view of the same method.
! // Overridden in DMH, which has special rules
assert viewAsTypeChecks(newType, strict);
! return copyWith(newType, form);
}
/*non-public*/
boolean viewAsTypeChecks(MethodType newType, boolean strict) {
if (strict) {
*** 1702,1711 ****
--- 1699,1713 ----
boolean isInvokeSpecial() {
return false; // DMH.Special returns true
}
/*non-public*/
+ boolean isCrackable() {
+ return false;
+ }
+
+ /*non-public*/
Object internalValues() {
return null;
}
/*non-public*/
< prev index next >