JDK-8283414 : Update java.base to use sealed classes (umbrella)
  • Type: Enhancement
  • Component: core-libs
  • Affected Version: 19
  • Priority: P4
  • Status: Closed
  • Resolution: Other
  • Submitted: 2022-03-19
  • Updated: 2022-06-03
  • Resolved: 2022-04-11
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8282536 :  
JDK-8283237 :  
JDK-8283415 :  
JDK-8283416 :  
JDK-8283417 :  
JDK-8283470 :  
JDK-8283480 :  
JDK-8283668 :  
JDK-8283715 :  
JDK-8283772 :  
JDK-8284036 :  
Description
Various additional class hierarchies within java.base can be updated to use sealed classes (JDK-8260514).

Candidates to be re-declared as sealed as found by an automated analysis (in-progress candidates from  JDK-8282536 and JDK-8283237 indentified):

Note: sealing candidate java.lang.LiveStackFrame.PrimitiveSlot
Note: sealing candidate java.lang.Package
Note: sealing candidate java.util.IllegalFormatException
Note: sealing candidate java.io.ObjectStreamClass
Note: sealing candidate java.io.OptionalDataException
Note: sealing candidate java.lang.invoke.CallSite
Note: sealing candidate java.lang.invoke.ClassSpecializer.Factory
Note: sealing candidate java.lang.invoke.MethodHandle
Note: sealing candidate java.lang.invoke.VarHandle
Note: sealing candidate java.lang.module.ModuleDescriptor
Note: sealing candidate java.net.InetAddress
Note: sealing candidate java.net.InterfaceAddress
Note: sealing candidate java.nio.Buffer
Note: sealing candidate java.nio.ByteBuffer
Note: sealing candidate java.nio.CharBuffer
Note: sealing candidate java.nio.DoubleBuffer
Note: sealing candidate java.nio.FloatBuffer
Note: sealing candidate java.nio.IntBuffer
Note: sealing candidate java.nio.LongBuffer
Note: sealing candidate java.nio.MappedByteBuffer
Note: sealing candidate java.nio.ShortBuffer
Note: sealing candidate java.util.concurrent.ConcurrentHashMap.KeySetView
Note: sealing candidate java.util.concurrent.ForkJoinWorkerThread
Note: sealing candidate javax.crypto.Cipher
Note: sealing candidate jdk.internal.jimage.ImageStringsReader
Note: sealing candidate jdk.internal.loader.AbstractClassLoaderValue
Note: sealing candidate jdk.internal.loader.BuiltinClassLoader
Note: sealing candidate jdk.internal.logger.SimpleConsoleLogger
Note: sealing candidate jdk.internal.module.ModuleHashes.Builder
Note: sealing candidate jdk.internal.module.ModulePatcher.PatchedModuleReader
Note: sealing candidate jdk.internal.platform.CgroupMetrics
Note: sealing candidate jdk.internal.platform.CgroupV1MetricsImpl
Note: sealing candidate sun.net.dns.ResolverConfigurationImpl
Note: sealing candidate sun.net.www.MimeTable
Note: sealing candidate sun.net.www.protocol.http.AuthCacheValue
Note: sealing candidate sun.nio.ch.FileLockImpl
Note: sealing candidate sun.nio.ch.InheritedChannel.InheritedSocketChannelImpl
Note: sealing candidate sun.nio.ch.InheritedChannel.InheritedServerSocketChannelImpl
Note: sealing candidate sun.nio.ch.InheritedChannel.InheritedDatagramChannelImpl
Note: sealing candidate sun.nio.ch.SimpleAsynchronousFileChannelImpl
Note: sealing candidate sun.nio.cs.StreamDecoder
Note: sealing candidate sun.security.provider.JavaKeyStore
Note: sealing candidate sun.security.provider.certpath.Builder
Note: sealing candidate sun.security.provider.certpath.SunCertPathBuilderResult
Note: sealing candidate sun.security.provider.certpath.Vertex
Note: sealing candidate sun.security.rsa.RSAKeyPairGenerator
Note: sealing candidate sun.security.rsa.RSASignature
Note: sealing candidate sun.security.timestamp.TSResponse
Note: sealing candidate sun.security.util.math.intpoly.IntegerPolynomial
Note: sealing candidate sun.security.validator.Validator
Note: sealing candidate sun.util.locale.LocaleExtensions
Note: sealing candidate sun.util.locale.UnicodeLocaleExtension
Note: sealing candidate sun.util.locale.provider.LocaleResources

Comments
Attached an annotation processor that can be used to find candidate for sealing.
03-06-2022

Subtasks all resolved; closing.
11-04-2022