No subject


Tue Jun 24 21:06:34 EDT 2008


<br>This transformation cannot be done with the current API, as there is no implicit annotation on the method. I normally add or remove these annotations in the methodFromUse method in the AnnotatedTypeFactory.<br><br>The reason I choose not to directly annotate the type parameters (and instead use InnerUnique) is that this would unnecessarly require that some classes have a generic parameter for items that did not need to have type parameters for. I want to allow micro properties in a container to be annotateable. E.g. a JList has a model, a cell editor, a selection model, a ui, which are all simple properties which can be annotated, but it would be unwieldly to use generics to add them all in, while with simple inner properties a user can obmit any of them for their default annotation values.<br>
<br>Some of the requirements I would like to keep for this project:<br>1. Reusability of code that will work for both annotated and unannotated code.<br>2. User does not need to be aware of the annotations except in situations that demand it.<br>
&nbsp;-- For API utility classes, the classes can support uniqueness, but all the methods are freely useable for non-unqiue instances.<br><br><div class="gmail_quote">On Mon, Aug 4, 2008 at 8:06 PM, Mahmood Ali <span dir="ltr">&lt;<a href="mailto:mahmood at mit.edu">mahmood at mit.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Artemus,<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
As it currently stands the code [...] determine[s] 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.<div class="Ih2E3d">
<br>
<br>
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.<br>
</div></blockquote>
<br>
Can you please provide a use case for this proposal?<br>
<br>
Personally, I think that it&#39;s essential that the return type of Iterator.next() is the same as the type variable of Iterator. &nbsp;I think that this is important to maintain the subtype relations with Iterator&lt;E&gt;.<br>

<br>
Thanks,<br><font color="#888888">
<br>
Mahmood<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Artemus Harper<br>
</div>

------=_Part_45778_32701882.1217907852043--



More information about the JSR308 mailing list