|
There seems to be no example in the spec which shows the usage of constraints on generic types:
public class Student<V extends Number> {
Student(V v) {
this.v = v;
}
@Max(6)
V v;
}
j.l.Number can be resolved for the type parameter V here, thus the @Max constraints is legitimate. Whereas V can only be resolved to j.l.Object in the following example, rendering the constraint illegal:
public class Student<V> {
Student(V v) {
this.v = v;
}
@Max(6)
V v;
}
A TCK test may be required for this as well, I couldn't find one.
|