Q: Why is java.lang.Runtime non-final?

Alan Bateman alan.bateman at oracle.com
Tue Nov 19 07:44:54 UTC 2024



On 18/11/2024 21:17, Chen Liang wrote:
> Hi Eirik,
> I think it might have been a legacy oversight; note that even 
> java.util.Arrays was just recently made final.
>
> > If Runtime was made final it seems we could remove the CheckCSMs test.
>
> I disagree; CheckCSMs test checks for missing CSM annotations when new 
> caller sensitive methods are added, and to ensure other reflection 
> changes do not tamper with the caller sensitive mechanism. The 
> static/final requirements is just one minor aspect of that test.
>
Right, CheckCSMs is an important test. One of the good things about the 
SM removal is that many methods were @CS because of permission checks 
are no longer @CS. Better still is some @CS methods in non-final classes 
that could be overridden are no longer @CS, hence the need to update 
this test as part of several PRs.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20241119/984f76a7/attachment.htm>


More information about the core-libs-dev mailing list