[lworld] RFR: 8361496: [lworld] Treating interfaces as isValue() leads to failed assert [v2]

Roger Riggs rriggs at openjdk.org
Tue Jul 15 14:55:55 UTC 2025


On Mon, 14 Jul 2025 21:15:20 GMT, Chen Liang <liach at openjdk.org> wrote:

>> test/jdk/valhalla/valuetypes/ValueClassTest.java line 60:
>> 
>>> 58:         assertFalse(isValueObjectCompatible(ArrayList[].class), "array class");
>>> 59:         assertFalse(isValueObjectCompatible(String[].class), "array class");
>>> 60:         assertFalse(isValueObjectCompatible(Comparable[].class), "array class");
>> 
>> If these ever fail, the error messages are not going to be very information  like`expected tru, actual = false Object`;
>> no mention of preview mode being tested or the method under test.
>
> Junit composes the exception message with the expected, actual values and the string provided, also there is the line number.

True, but seeing true and false by themselves doesn't communicate anything about the failure and you have to go look at the source and the line number and decode what assertEquals is comparing.
It may not be worth much effort but the message could be more informative.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1504#discussion_r2207738248


More information about the valhalla-dev mailing list