Re: RFR: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized* [v3]

2021-02-20 Thread liach
On Wed, 17 Feb 2021 19:56:01 GMT, Ian Graves wrote: >> Modify the `unmodifiable*` methods in `java.util.Collections` to be >> idempotent. That is, when given an immutable collection from >> `java.util.ImmutableCollections` or `java.util.Collections`, these methods >> will return the reference

Re: RFR: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized* [v3]

2021-02-18 Thread liach
On Thu, 18 Feb 2021 16:18:42 GMT, jmehrens wrote: >> Yes -- I think in response to this it makes more sense to pull the >> `ImmutableCollections` classes out for now and only focus on the wrapping of >> the classes within `Collections` so we aren't blocked by studying and >> rectifying these

Re: RFR: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized* [v3]

2021-02-18 Thread jmehrens
On Wed, 17 Feb 2021 19:12:19 GMT, Ian Graves wrote: >> This raises some interesting issues and makes me wonder if we should allow a >> single-wrap of the `ImmutableCollections` classes for now to make this less >> onerous. > > Yes -- I think in response to this it makes more sense to pull the

Re: RFR: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized* [v3]

2021-02-17 Thread Ian Graves
On Wed, 17 Feb 2021 14:14:57 GMT, Claes Redestad wrote: >> No? This unmodifiable set here just delegates call to the backing field `c`, >> so all exceptions from `c`'s calls are just delegated, aren't they? The NPE >> will still be thrown; it's just that the stack trace will be different (i.e.

Re: RFR: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized* [v3]

2021-02-17 Thread Ian Graves
> Modify the `unmodifiable*` methods in `java.util.Collections` to be > idempotent. That is, when given an immutable collection from > `java.util.ImmutableCollections` or `java.util.Collections`, these methods > will return the reference instead of creating a new immutable collection that >