[JSR308] Enhanced for loops
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the JSR308