I would consider this an enhancement rather than a bug, but good to do nevertheless.
Some of the remaining cases are probably there because it has been unclear (during the quick first phase of the conversion process) whether something more specific can be used or not and what it would require from other parts of the data APIs. Other cases clearly could and should use the “<?>” suffix, though.
There is an older ticket (
#5731 ) about using generics more, but it addresses primarily other parts of APIs and some of its parts are already obsolete/addressed.
No, I think this is definitely a bug, because it causes a compiler error for the developer.
If I create a class like this:
public class FooItem implements Item {
@Override
public boolean addItemProperty(Object id, Property<?> property) {
// blah blah
}
}
which is the
correct way to declare that method, then my build fails with this compiler error:
FooItem.java:19: FooItem is not abstract and does not override abstract method addItemProperty(java.lang.Object,com.vaadin.data.Property) in com.vaadin.data.Item
public class FooItem implements Item {
^
FooItem.java:21: method does not override or implement a method from a supertype
@Override
In my experience with genericization, it’s an “all or nothing” thing. You can’t do it half-way.
There is a good deal more genericization work to be done. For example,
AbstractField should really have two generic type parameters, one for the field type and one for the underlying “converted” type.
Property.Viewer should have a generic type. Etc.