8283416: Update java.lang.invoke.MethodHandle to use sealed classes

Reviewed-by: sundar, mchung
This commit is contained in:
Joe Darcy 2022-03-24 19:08:23 +00:00
parent 90750decb4
commit f16244509d
6 changed files with 23 additions and 17 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -37,7 +37,11 @@ import static java.lang.invoke.MethodHandleStatics.*;
* @author jrose
*/
/*non-public*/
abstract class DelegatingMethodHandle extends MethodHandle {
abstract sealed class DelegatingMethodHandle extends MethodHandle
permits MethodHandleImpl.AsVarargsCollector,
MethodHandleImpl.WrappedMember,
MethodHandleImpl.IntrinsicMethodHandle,
MethodHandleImpl.CountingWrapper {
protected DelegatingMethodHandle(MethodHandle target) {
this(target.type(), target);
}