Has anyone tried Java 1.5 and WO?

I've run into an issue with the new for() syntax.

    @Test public void arrayIteratorProblem() {
        int count = 0;
        NSArray array = new NSMutableArray(30);
        for (Object object: array)
            count++;
        assertEquals(0, count);

The test fails with count == 30. I believe the underlying problem is a bug in NSArray.iterator() which returns an Iterator setup for the array's capacity instead of the array's size.

Workaround:
        for (Object object: array.objects())

It might help if more people file bug reports about the NSArray.iterator() issue.


Christian

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to