On Thu, 30 Jul 2026 15:47:28 GMT, Coleen Phillimore <[email protected]> wrote:
>> This fixes a longstanding problem with desiredAssertionStatus and adds a >> test. >> Tested with tier1. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > 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? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32086#discussion_r3684218880
