8283470: Update java.lang.invoke.VarHandle to use sealed classes

Reviewed-by: darcy, psandoz
This commit is contained in:
Mandy Chung 2022-03-30 17:37:42 +00:00
parent e85fa2f04b
commit e61ccfba7f
5 changed files with 53 additions and 16 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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,7 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE;
final class VarHandle$Type$s {
static class FieldInstanceReadOnly extends VarHandle {
static sealed class FieldInstanceReadOnly extends VarHandle {
final long fieldOffset;
final Class<?> receiverType;
#if[Object]
@ -381,7 +381,7 @@ final class VarHandle$Type$s {
}
static class FieldStaticReadOnly extends VarHandle {
static sealed class FieldStaticReadOnly extends VarHandle {
final Object base;
final long fieldOffset;
#if[Object]