ArrayList constructor and KeyFor for parameters
I wish to invoke the ArrayList constructor on a set whose elements are
annotated with @KeyFor.
This works when the @KeyFor argument is a field, as in method usesField().
This does not work when the @KeyFor argument is a parameter, as in method
usesParameter().
See the attached test case.
Map<String,Integer> mymap = new HashMap<String,Integer>();
public static void usesField(Set</*@KeyFor("this.mymap")*/ String> keySet) {
new ArrayList</*@KeyFor("this.mymap")*/ String> (keySet);
}
public static void usesParameter(Map<String,Integer> m, Set</*@KeyFor("#1")*/ String> keySet) {
new ArrayList</*@KeyFor("#1")*/ String> (keySet);
}
Original issue reported on code.google.com by michael.ernst@gmail.com on 19 Mar 2015 at 2:41
Original issue reported on code.google.com by
michael.ernst@gmail.com
on 19 Mar 2015 at 2:41Attachments: