On Thu, 7 Dec 2023 09:00:46 GMT, Per Minborg <pminb...@openjdk.org> wrote:

>> This PR proposes to change the exception type for exceptions thrown for 
>> certain methods with a parameter of type `MemorySegment` when it is 
>> `MemorySegment::isReadOnly`. Previously an `UnsupportedOperationException` 
>> was specified but in some cases, in reality, an `IllegalArgumentException` 
>> was thrown. 
>> 
>> The principle used in this PR is that operations acting on an MS where the 
>> MS is `this` should throw an `UnsupportedOperationException` whereas in 
>> cases where the MS is a *parameter* an `IllegalArgumentException` should be 
>> thrown.
>> 
>> It should be noted that this PR retains the previous behavior for MS 
>> VarHandle access (even though the MS is a parameter to the accessor methods, 
>> the first parameter can be said to represent `this`).
>
> Per Minborg has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Revert checkAccess parameter type

Looks good!

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

Marked as reviewed by mcimadamore (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16993#pullrequestreview-1769982170

Reply via email to