So the correct solution would be return T[] only for the object array type,
and return the correct primitive array for each primitive array type?

On Tue, Mar 31, 2009 at 6:52 PM, Ray Cromwell <cromwell...@gmail.com> wrote:

>
> Yes,  My concern is, if you don't make a method that returns a T[], and
> instead make a JSO that implements Iterable<T>, you can only do this once.
> Java treats T[] differently than Iterable<T> with regard to the for-each
> loop. As usual in Java, the primitive types are treated non-orthogonally.
>
> -Ray
>
>
> On Tue, Mar 31, 2009 at 3:50 PM, Ian Petersen <ispet...@gmail.com> wrote:
>
>>
>> On Tue, Mar 31, 2009 at 3:42 PM, Freeland Abbott <fabb...@google.com>
>> wrote:
>> > I'm not sure I understand Ray's concern... JSO wouldn't implement
>> iterable,
>> > so another subclass of JSO would do whatever the author made it do.
>> Most of
>> > the methods on JsArray<T> and e.g. JsArrayString[1] are final, but we
>> > wouldn't have to do that for iterator(), so a subclass could still
>> override.
>>
>> I assumed Ray's concern is based around the fact that only one
>> subclass of JSO can implement any given interface so, if JsArray<T>
>> implements Iterable<T>, no other subclass of JSO can implement it.  Am
>> I right?
>>
>> Ian
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to