Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-06-16 Thread Paul Sandoz
Hi, Late to this thread… I think for consistency it’s ok to apply in all three cases. I will push today. — Another trivial fix in Collections would be to go through the nested classes and mark appropriate classes as final. Paul. > On 28 May 2016, at 11:27, Louis Wasserman

Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-28 Thread Mohamed Naufal
Hi, Compared to avoiding an allocation, not really. In addition to avoiding the calls, this was more for the sake of consistency with the change for EmptyList. Thanks, Naufal On 28 May 2016 at 23:57, Louis Wasserman wrote: > Do you actually expect that to represent a

Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-28 Thread Mohamed Naufal
Hi, You're right of course, I should have been clearer, no allocation happens for clear() on EmptyMap or EmptySet, but a lot of unnecessary calls are made. The call stack for clear() on EmptySet looks something like this: AbstractCollection#clear() ->EmptySet#iterator() ->

Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-28 Thread Mohamed Naufal
Hi, I see that this is applicable to EmptyMap and EmptySet as well, here's an updated patch with clear() overridden for all 3 classes. Thanks, Naufal On 23 May 2016 at 16:13, Paul Sandoz wrote: > Hi Naufal, > > Thanks for looking at this. > > For us to accept your

Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-24 Thread dalibor topic
Thanks, Naufal - I'll take a look and let you & Paul know when it's processed. cheers, dalibor topic On 23.05.2016 12:53, Mohamed Naufal wrote: Hi Paul, I've already sent a signed copy of the OCA to oracle-ca...@oracle.com. Thanks, Naufal On 23 May 2016 at 16:13, Paul Sandoz

Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-23 Thread Paul Sandoz
Argh email address completion fail… that was meant for someone else… sorry for the noise, Paul. > On 23 May 2016, at 13:28, Paul Sandoz wrote: > > Hmm… apparently simple patches can be accepted without OCA as pointed out by > David: > >

Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-23 Thread Paul Sandoz
Hmm… apparently simple patches can be accepted without OCA as pointed out by David: http://openjdk.java.net/bylaws#participant Paul. > On 23 May 2016, at 13:25, David Holmes wrote: > > On 23/05/2016 8:43 PM, Paul Sandoz

Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-23 Thread David Holmes
On 23/05/2016 8:43 PM, Paul Sandoz wrote: Hi Naufal, Thanks for looking at this. For us to accept your patch (no matter how small) you need to become a contributor, which requires that you agree to the Oracle Contributor Agreement (OCA), see: http://openjdk.java.net/contribute/ Simple

Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-23 Thread Mohamed Naufal
Hi Paul, I've already sent a signed copy of the OCA to oracle-ca...@oracle.com. Thanks, Naufal On 23 May 2016 at 16:13, Paul Sandoz wrote: > Hi Naufal, > > Thanks for looking at this. > > For us to accept your patch (no matter how small) you need to become a >

Re: [PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-23 Thread Paul Sandoz
Hi Naufal, Thanks for looking at this. For us to accept your patch (no matter how small) you need to become a contributor, which requires that you agree to the Oracle Contributor Agreement (OCA), see: http://openjdk.java.net/contribute/ Thanks, Paul. > On 22 May 2016, at 12:10, Mohamed

[PATCH] Implement a noop clear() for Collections#EMPTY_LIST

2016-05-22 Thread Mohamed Naufal
Hi, A call to clear() on Collections#EMPTY_LIST is currently redirected to AbstractList#clear(), which performs a bunch of checks and creates a ListItr object, all of which is unnecessary for an EmptyList. PFA a patch that implements a noop clear() for EmptyList. Thanks, Naufal # HG changeset