Re: RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-07-05 Thread joe darcy
Hello, Note that another approach would be to change the spec to match the long-standing implementation. That is the the default resolution patch in situations like this, but in this case I don't think it matters very much how the matter is resolved. Cheers, -Joe On 6/29/2018 7:21 PM,

Re: RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-07-04 Thread Martin Buchholz
On Tue, Jul 3, 2018 at 9:31 PM, Ivan Gerasimov wrote: > Hi Martin! > > Why did you exclude the case of zero initial capacity? > 96 int initialCapacity = rnd.nextInt(1, 20); > > Well spotted - I was just being lazy - ArrayDeque doesn't handle the case of zero specially. public

Re: RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-07-03 Thread Ivan Gerasimov
Hi Martin! Why did you exclude the case of zero initial capacity? 96 int initialCapacity = rnd.nextInt(1, 20); I think it may make sense to have "static final EMPTY_DEQUE = ArrayDeque(0);" somewhere, and we may want to make sure it doesn't allocate more memory than needed? It's

Re: RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-07-03 Thread Martin Buchholz
OK, this thread is officially upgraded to a RFR. http://cr.openjdk.java.net/~martin/webrevs/jdk/jsr166-integration/ArrayDeque-capacity/index.html On Tue, Jul 3, 2018 at 11:04 AM, Paul Sandoz wrote: > > > On Jul 3, 2018, at 10:42 AM, Martin Buchholz wrote: > > > On Tue, Jul 3, 2018 at 9:53 AM,

Re: RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-07-03 Thread Paul Sandoz
> On Jul 3, 2018, at 10:42 AM, Martin Buchholz wrote: > > > On Tue, Jul 3, 2018 at 9:53 AM, Paul Sandoz > wrote: > Looks good. Where do you propose to place the test in the OpenJDK repo? > > >

Re: RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-07-03 Thread Martin Buchholz
On Tue, Jul 3, 2018 at 9:53 AM, Paul Sandoz wrote: > Looks good. Where do you propose to place the test in the OpenJDK repo? > http://cr.openjdk.java.net/~martin/webrevs/jdk/jsr166-integration/overview.html I hadn't gotten around to a RFR - the test is slightly modified from my initial post.

Re: RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-07-03 Thread Paul Sandoz
Looks good. Where do you propose to place the test in the OpenJDK repo? Paul. > On Jun 30, 2018, at 10:29 AM, Martin Buchholz wrote: > > Hi Ivan, > > Thanks for finding this bug - I'll take the blame. > > Forgive my pushiness - I'd like to do a friendly takeover of this. As > penance I

Re: RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-06-30 Thread Ivan Gerasimov
Hi Martin! On 6/30/18 10:29 AM, Martin Buchholz wrote: Hi Ivan, Thanks for finding this bug - I'll take the blame. Forgive my pushiness - I'd like to do a friendly takeover of this. As penance I ported the similar WhiteBox test from ConcurrentHashMap to ArrayDeque. Sure, no problem! I

Re: RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-06-30 Thread Martin Buchholz
Hi Ivan, Thanks for finding this bug - I'll take the blame. Forgive my pushiness - I'd like to do a friendly takeover of this. As penance I ported the similar WhiteBox test from ConcurrentHashMap to ArrayDeque. I would elide the comment in the default constructor. And we can delete our noreg

RFR 8206123 : ArrayDeque created with default constructor can only hold 15 elements

2018-06-29 Thread Ivan Gerasimov
Hello! The spec states that an ArrayDeque created with the default constructor should be able to hold 16 elements. https://docs.oracle.com/javase/10/docs/api/java/util/ArrayDeque.html#%3Cinit%3E() """ Constructs an empty array deque with an initial capacity sufficient to hold 16 elements.