Q: Why is java.lang.Runtime non-final?
Eirik Bjørsnøs
eirbjo at gmail.com
Mon Nov 25 13:25:49 UTC 2024
>
> These are the non-final, not subclassable, public, non-enum classes, in
> packages with unqualified exports in java.base:
>
Filed https://bugs.openjdk.org/browse/JDK-8344943 to to track this.
If we extend the search to identify classes with at-most package protected
access, we find the following additional candidates for marking final:
java.net.InterfaceAddress (the sole constructor is invoked from native code
only, could be made private)
java.lang.module.ModuleDescriptor (package protected constructor invoked
via JavaLangModuleAccess could be made private)
java.lang.Package
java.io.OptionalDataException
None of the above have subclasses, so can be marked final.
Eirik.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20241125/ce0ba301/attachment.htm>
More information about the core-libs-dev
mailing list