On Thu, 30 Jul 2026 15:54:27 GMT, Alan Bateman <[email protected]> wrote:

>> Coleen Phillimore has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Maybe this is better.
>
> src/java.base/share/classes/java/lang/Class.java line 3327:
> 
>> 3325:      */
>> 3326:     public boolean desiredAssertionStatus() {
>> 3327:         if (isPrimitive() || isArray()) return false;
> 
> This is mostly invoked from a compiled-generated class initializer when code 
> in the class was compiled with the "assert" keyword. Not common but you 
> sometimes see code invoking it directly, maybe to have -ea turn on a 
> debugging flag. I don't think I've never seen code using something other than 
> the "current class". So primitive and array classes is very weird. Having it 
> return false because that is long standing behavior should be okay and should 
> be specified. Is there any reason to do the spec update separately?

This patch aims to avoid calling JVM_DesiredAssertionStatus on a primitive or 
array class receiver, which would trigger an assert present since its 
introduction before OpenJDK in debug builds.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/32086#discussion_r3684379649

Reply via email to