You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice for PolyNull to take an optional argument, so that
multiple different instantiations of PolyNull can be used in a single
method. The need for this is very rare, but here is a concrete example:
/** Returns an array of Strings, where the strings are the result of
* invoking x.getClass().toString() for each element x in the
* array. If an element of the array is null, its slot in the returned
* array is null.
*/
public static
@PolyNull("elt") String @PolyNull("container") []
typeArray(@PolyNull("elt") Object @PolyNull("container") [] seq) {
if (seq == null) { return null; }
@PolyNull("elt") String[] retval = new @PolyNull("elt") String[seq.length];
for (int i = 0 ; i < seq.length ; i++) {
if (seq[i] == null) {
retval[i] = null;
} else {
retval[i] = seq[i].getClass().toString();
}
}
return retval;
}
Original issue reported on code.google.com by michael.ernst@gmail.com on 12 Jan 2010 at 5:21
Original issue reported on code.google.com by
michael.ernst@gmail.com
on 12 Jan 2010 at 5:21The text was updated successfully, but these errors were encountered: