On Tue, 25 Apr 2023 21:01:04 GMT, Roger Riggs <rri...@openjdk.org> wrote:
>> test/jdk/java/io/ObjectInputStream/NegativeArraySizeTest.java line 88: >> >>> 86: } catch (ObjectStreamException ose) { >>> 87: // OK, because a NegativeArraySizeException should be >>> converted into a ObjectStreamException >>> 88: if ("Array length is negative".equals(ose.getMessage())) { >> >> This feels like `!equals`, i.e. throw exception when the message is *not* >> "Array length is negative"? > > The complete `getMessage()` is `[Ljava.lang.String;; Array length is > negative`. > Perhaps: > > ose.getMessage().contains("Array length is negative") ... Your right. @RogerRiggs I've further simplified the exception message to only contain the message "Array length is negative". I hope that's fine for you and in line with your previous comment to "*keep the exception logic simple/minimal*". ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13540#discussion_r1177751891