On Wed, 15 Mar 2023 20:18:11 GMT, Jonathan Gibbons <[email protected]> wrote:

>> I believe that shallow unmodifiability of namedMembers is a bug, which you 
>> spotted. We should either fix it by making it deeply unmodifiable, or remove 
>> this defensiveness altogether: those lists and maps (especially maps) are 
>> internal and should never escape. I suppose, it's better to fix it now and 
>> revisit later.
>
> Or just comment the existing code, indicating that this is just a shallow 
> copy.

I think we should follow the original code intent, if that's not too 
complicated. Please have a look at the proposal in 7565f89, and if you are okay 
with it, and the tests pass, I'll integrate it.

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

PR: https://git.openjdk.org/jdk/pull/13044

Reply via email to