RFR: 8310053: VarHandle and slice handle derived from layout are lacking alignment check [v3]

Jorn Vernee jvernee at openjdk.org
Wed Jun 14 23:30:56 UTC 2023


On Wed, 14 Jun 2023 22:48:34 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   formatting
>
> test/jdk/java/foreign/TestLayoutPaths.java line 152:
> 
>> 150:             String expectedMessage = "Target offset incompatible with alignment constraints: " + struct.byteAlignment();
>> 151: 
>> 152:             try {
> 
> Can assertThrows be used to simplify this pattern?

Yeah. I thought `assertThrows` was only a junit thing, but it looks like TestNG also has an `expectThrows` which does the same and returns the thrown exception so that we can check the message.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14475#discussion_r1230267718


More information about the core-libs-dev mailing list