JDK-8224022 : Add @Meant-to-be-sealed annotation type to guide compiler warnings
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 13
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2019-05-16
  • Updated: 2019-05-20
Related Reports
Relates :  
Relates :  
Relates :  
Description
Certain types are meant to be *sealed*, not extendable/implementable outside of a certain known set of types (see JDK-8222777).

Until such a language mechanism exists, it could be helpful to include a "@Meant-to-be-sealed" annotation to help document the intended semantic restriction and to guide compiler warnings.
Comments
The type java.lang.reflect.AccessibleObject is one that would benefit from sealing.
20-05-2019