8283417: Update java.nio buffers to use sealed classes

Reviewed-by: rriggs, darcy, iris, alanb
This commit is contained in:
Brian Burkhalter 2022-03-24 16:11:57 +00:00
parent 19f01ab701
commit b36cf35ad9
7 changed files with 45 additions and 8 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@ -191,7 +191,9 @@ import java.util.Spliterator;
* @since 1.4
*/
public abstract class Buffer {
public abstract sealed class Buffer
permits ByteBuffer, CharBuffer, DoubleBuffer, FloatBuffer, IntBuffer,
LongBuffer, ShortBuffer {
// Cached unsafe-access object
static final Unsafe UNSAFE = Unsafe.getUnsafe();