Request for review : 7121314 : Behavior mismatch between AbstractCollection.toArray(T[] ) and its spec

Sean Chou zhouyx at linux.vnet.ibm.com
Sat Mar 31 09:43:03 UTC 2012


Hi David and Ulf,

   The new webrev is at:
http://cr.openjdk.java.net/~zhouyx/7121314/webrev.03/  .

About the fix, I remained the previous one.
About the testcase, I merged the 3 files into one.
During merging, there are 2 modifications:
1. I added static modifier to the 3 classes, which are enclosed by class
ToArrayTest;
2. I removed field TestCollection.fixedSize, which is never read after Ulf
fixed the bug in testcase.


The link to the bug:
  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7121314
The link to the start of the thread:

http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-March/009512.html


Looking for comments, thanks.


On Thu, Mar 29, 2012 at 8:36 AM, David Holmes <david.holmes at oracle.com>wrote:

> Hi Ulf,
>
> Thanks for the updates. This will take a little rearranging to get into
> the right form I think - a single file is easier to deal with so we could
> nest the TestCollection class.
>
> Regarding setPseudoConcurrentChronologic**alSizeSequence, I think perhaps:
>
>   /** Sets the values that size() will return on each use. The next
>       call to size will return sizes[0], then sizes[1] etc. This
>       allows us to emulate a concurrent change to the contents of
>       the collection without having to perform concurrent changes.
>       If sizes contains a larger value, the collection will appear to
>       have shrunk when iterated; if a smaller value then the
>       collection will appear to have grown when iterated
>   */
>   void setSizeSequence(int... sizes) {
>        this.sizes = sizes;
>        nextSize = 0;
>    }
>
> Sean: can you massage this into a final version? If not I will try to do
> so but I'm about to head out to JavaOne Japan and then am taking some
> vacation time. Might be something I can work on on the plane :)
>
> Thanks,
> David
>
>
> On 29/03/2012 4:48 AM, Ulf Zibis wrote:
>
>> Hi David, Sean,
>>
>> I have made little changes to make understanding little easier, see
>> attachment...
>>
>> -Ulf
>>
>>
>> Am 28.03.2012 07:29, schrieb David Holmes:
>>
>>> Hi Ulf,
>>>
>>> I understand your point about ensuring we test
>>> AbstractCollection.toArray but I find this revised test much harder to
>>> understand.
>>>
>>> Also in the name setPseudoConcurrentSizeCourse the word "Course"
>>> doesn't fit. I'm not sure what you were meaning here? Perhaps just
>>> modifySize or emulateConcurrentSizeChange ?
>>>
>>> Thanks,
>>> David
>>>
>>>


-- 
Best Regards,
Sean Chou



More information about the core-libs-dev mailing list