[JSR308] Enhanced for loops

Artemus Harper subanark at gmail.com
Mon Aug 4 18:54:25 EDT 2008


As it currently stands the code to determine if the element is valid in the
foreach loop is to determine if the generic type parameter of the iterable
matches the element. This may be fine in some cases, but it assumes that
annotations are copied from the parameter type to the returned value.

So... instead would it be possible to:
1. move this method out of AnnotatedTypes and into the AnnotatedTypeFactory
(since there might be special treatment for this "expression")
2. Instead of using the type of the Iterable type parameter, use the return
type of iterator().next() to emulate what is actually happening in the loop.

As it is now, I have to subclass AnnotatedTypes and change the
implementation of getIteratedType(AnnotatedTypeMirror) method

-- 
Artemus Harper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.csail.mit.edu/pipermail/jsr308/attachments/20080804/f6aa961c/attachment.htm 


More information about the JSR308 mailing list