On Thu, 30 Jul 2026 17:00:56 GMT, Chen Liang <[email protected]> wrote:
>> Sure, but the need to clarify the spec jumps out, I don't mind if it is done >> in a separate issue. > > Created https://bugs.openjdk.org/browse/JDK-8389466 to track the spec updates. Well, I don't think we should be changing the behavior without understand what spec changes are necessary here. Since desiredAssertionStatus() can be called on any `Class` object, it will exhibit some behavior; it seems unreasonable for the JVM to fail an assert in any mode, so it should probably returning a boolean. On its face it seems reasonable to return false for these cases, but there is the additional case mentioned previously of non-bootloader array classes that ought to be discussed. I don't particularly care how this is implemented. But it would seem a bit odd to add checking at the Java layer only to have the same checking done in the JVM both in an assert and in regular code. Maybe the right thing to do is simply to remove the asserts. (If that results in the correct, specified behavior.) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32086#discussion_r3684715727
