Summary
-------
Update `MethodHandle` to be a sealed class.
Problem
-------
The `MethodHandle` class is not intended to have user-defined subclasses and sealing is an explicit way to indicate this.
Solution
--------
Update the class to be declared 'sealed`. Other needed changes are implementation-only and not part of the user-visible API change listed in this CSR.
Specification
-------------
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
@@ -440,7 +440,9 @@ mh.invokeExact(System.out, "Hello, world.");
* @author John Rose, JSR 292 EG
* @since 1.7
*/
-public abstract class MethodHandle implements Constable {
+public abstract sealed class MethodHandle implements Constable
+ permits NativeMethodHandle, DirectMethodHandle,
+ DelegatingMethodHandle, BoundMethodHandle {
/**
* Internal marker interface which distinguishes (to the Java compiler)