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 perfectly fine to have this test:
 149         assertTrue((head == tail) ^ (elements[head] != null));

though I would find it a bit easier to read if it were written as
         assertEquals(head == tail, elements[head] == null);

It's a matter of style, of course.

With kind regards,
Ivan

On 7/3/18 3:15 PM, Martin Buchholz wrote:
OK, this thread is officially upgraded to a RFR.

http://cr.openjdk.java.net/~martin/webrevs/jdk/jsr166-integration/ArrayDeque-capacity/index.html <http://cr.openjdk.java.net/%7Emartin/webrevs/jdk/jsr166-integration/ArrayDeque-capacity/index.html>

On Tue, Jul 3, 2018 at 11:04 AM, Paul Sandoz <[email protected] <mailto:[email protected]>> wrote:



    On Jul 3, 2018, at 10:42 AM, Martin Buchholz <[email protected]
    <mailto:[email protected]>> wrote:


    On Tue, Jul 3, 2018 at 9:53 AM, Paul Sandoz
    <[email protected] <mailto:[email protected]>> 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
    
<http://cr.openjdk.java.net/%7Emartin/webrevs/jdk/jsr166-integration/overview.html>

    I hadn't gotten around to a RFR - the test is slightly modified
    from my initial post.

    Ok, i see more thorough assertions in the assertInvariants method.

    Thanks,
    Paul.



--
With kind regards,
Ivan Gerasimov

Reply via email to