Right so it’s present in all shipping versions of Java back to at least 8, and the reproduction case works fine on Sonoma pre-14.4. Ergo, Apple changed something in 14.4 (a minor patch release), and it broke something in Java. I’m not sure what point you’re trying to make.
It’s possible that Java was doing something very weird, maybe undocumented/unsupported; but it’s not clear how this is anything other than Apple making a change (which I don’t see documented in their release notes) and breaking users.