Q: Why is java.lang.Runtime non-final?
Chen Liang
chen.l.liang at oracle.com
Mon Nov 18 21:17:18 UTC 2024
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.
Regards,
Chen Liang
________________________________
From: core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of Eirik Bjørsnøs <eirbjo at gmail.com>
Sent: Monday, November 18, 2024 2:38 PM
To: core-libs-dev <core-libs-dev at openjdk.org>
Subject: Q: Why is java.lang.Runtime non-final?
Hi,
Tried to find an answer to this question in JBS, but found nothing:
Since java.lang.Runtime has a single private constructor, it seems effectively final. Why is it not declared final?
If Runtime was made final it seems we could remove the CheckCSMs test.
Are there compatibility concerns here that I don't see?
Eirik.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20241118/6f072223/attachment.htm>
More information about the core-libs-dev
mailing list