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-r...@openjdk.org> on behalf of Eirik 
Bjørsnøs <eir...@gmail.com>
Sent: Monday, November 18, 2024 2:38 PM
To: core-libs-dev <core-libs-dev@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.

Reply via email to