On Thu, 5 Jun 2025 08:12:29 GMT, David Holmes <dhol...@openjdk.org> wrote:
> It is far too easy to have a test "pass" because it catches the wrong > instance of a thrown exception and hide an underlying problem. OmitStackTraceInFastThrow is enabled by default so possible for C2 to compile this to throw a pre-allocated exception with no message detail or stack trace. This is what is happening with these -Xcomp runs so the detail message is null rather than the expected message. An explicit test with Objects.requireNonNull would likely dodge this but does seem fragile. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25655#issuecomment-2943390680