diff options
Diffstat (limited to 'src/com/vaadin/data/util')
13 files changed, 29 insertions, 24 deletions
diff --git a/src/com/vaadin/data/util/AbstractBeanContainer.java b/src/com/vaadin/data/util/AbstractBeanContainer.java index 4e5cb182b2..a562edf8a6 100644 --- a/src/com/vaadin/data/util/AbstractBeanContainer.java +++ b/src/com/vaadin/data/util/AbstractBeanContainer.java @@ -104,7 +104,8 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends + " not found"); } try { - Property<IDTYPE> property = pd.createProperty(bean); + Property<IDTYPE> property = (Property<IDTYPE>) pd + .createProperty(bean); return property.getValue(); } catch (MethodException e) { throw new IllegalArgumentException(e); @@ -256,7 +257,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { Item item = getItem(itemId); if (item == null) { return null; @@ -371,7 +372,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends * The id of the property */ private void addValueChangeListener(Item item, Object propertyId) { - Property property = item.getItemProperty(propertyId); + Property<?> property = item.getItemProperty(propertyId); if (property instanceof ValueChangeNotifier) { // avoid multiple notifications for the same property if // multiple filters are in use @@ -390,7 +391,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends * The id of the property */ private void removeValueChangeListener(Item item, Object propertyId) { - Property property = item.getItemProperty(propertyId); + Property<?> property = item.getItemProperty(propertyId); if (property instanceof ValueChangeNotifier) { ((ValueChangeNotifier) property).removeListener(this); } diff --git a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java index 3633154c4a..bbccd37394 100644 --- a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java +++ b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java @@ -641,7 +641,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * Container Don't add a JavaDoc comment here, we use the default * documentation from implemented interface. */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { return container.getContainerProperty(itemId, propertyId); } diff --git a/src/com/vaadin/data/util/ContainerOrderedWrapper.java b/src/com/vaadin/data/util/ContainerOrderedWrapper.java index 1bf9a49a3d..51be30bf7e 100644 --- a/src/com/vaadin/data/util/ContainerOrderedWrapper.java +++ b/src/com/vaadin/data/util/ContainerOrderedWrapper.java @@ -437,7 +437,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * Container Don't add a JavaDoc comment here, we use the default * documentation from implemented interface. */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { return container.getContainerProperty(itemId, propertyId); } diff --git a/src/com/vaadin/data/util/FilesystemContainer.java b/src/com/vaadin/data/util/FilesystemContainer.java index 76a7b90376..c95eb4a8a1 100644 --- a/src/com/vaadin/data/util/FilesystemContainer.java +++ b/src/com/vaadin/data/util/FilesystemContainer.java @@ -459,7 +459,7 @@ public class FilesystemContainer implements Container.Hierarchical { * the property's ID. * @return the requested property's value, or <code>null</code> */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { if (!(itemId instanceof File)) { return null; @@ -609,7 +609,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Gets the specified property of this file. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ - public Property getItemProperty(Object id) { + public Property<?> getItemProperty(Object id) { return getContainerProperty(file, id); } diff --git a/src/com/vaadin/data/util/IndexedContainer.java b/src/com/vaadin/data/util/IndexedContainer.java index 79d9d89b90..b7e72c3467 100644 --- a/src/com/vaadin/data/util/IndexedContainer.java +++ b/src/com/vaadin/data/util/IndexedContainer.java @@ -150,7 +150,7 @@ public class IndexedContainer extends * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { if (!containsId(itemId)) { return null; } @@ -680,7 +680,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Item#getItemProperty(java.lang.Object) */ - public Property getItemProperty(Object id) { + public Property<?> getItemProperty(Object id) { return new IndexedContainerProperty(itemId, id); } diff --git a/src/com/vaadin/data/util/MethodProperty.java b/src/com/vaadin/data/util/MethodProperty.java index 3809029223..092c72e5f1 100644 --- a/src/com/vaadin/data/util/MethodProperty.java +++ b/src/com/vaadin/data/util/MethodProperty.java @@ -170,7 +170,7 @@ public class MethodProperty<T> extends AbstractProperty<T> { @SuppressWarnings("unchecked") public MethodProperty(Object instance, String beanPropertyName) { - final Class beanClass = instance.getClass(); + final Class<?> beanClass = instance.getClass(); // Assure that the first letter is upper cased (it is a common // mistake to write firstName, not FirstName). @@ -474,7 +474,9 @@ public class MethodProperty<T> extends AbstractProperty<T> { * {@link #setValue(Object newValue)} is called. */ @SuppressWarnings("unchecked") - public MethodProperty(Class type, Object instance, Method getMethod, + // cannot use "Class<? extends T>" because of automatic primitive type + // conversions + public MethodProperty(Class<?> type, Object instance, Method getMethod, Method setMethod, Object[] getArgs, Object[] setArgs, int setArgumentIndex) { @@ -495,13 +497,13 @@ public class MethodProperty<T> extends AbstractProperty<T> { } // Gets the return type from get method - type = convertPrimitiveType(type); + Class<? extends T> convertedType = (Class<? extends T>) convertPrimitiveType(type); this.getMethod = getMethod; this.setMethod = setMethod; setArguments(getArgs, setArgs, setArgumentIndex); this.instance = instance; - this.type = type; + this.type = convertedType; } /** @@ -673,6 +675,7 @@ public class MethodProperty<T> extends AbstractProperty<T> { // convert using a string constructor try { // Gets the string constructor + @SuppressWarnings("rawtypes") final Constructor constr = type .getConstructor(new Class[] { String.class }); diff --git a/src/com/vaadin/data/util/MethodPropertyDescriptor.java b/src/com/vaadin/data/util/MethodPropertyDescriptor.java index 1d7944dc6c..b56df34831 100644 --- a/src/com/vaadin/data/util/MethodPropertyDescriptor.java +++ b/src/com/vaadin/data/util/MethodPropertyDescriptor.java @@ -123,7 +123,7 @@ public class MethodPropertyDescriptor<BT> implements return propertyType; } - public Property createProperty(Object bean) { + public Property<?> createProperty(Object bean) { return new MethodProperty<Object>(propertyType, bean, readMethod, writeMethod); } diff --git a/src/com/vaadin/data/util/NestedPropertyDescriptor.java b/src/com/vaadin/data/util/NestedPropertyDescriptor.java index b452fdbc49..1a11263587 100644 --- a/src/com/vaadin/data/util/NestedPropertyDescriptor.java +++ b/src/com/vaadin/data/util/NestedPropertyDescriptor.java @@ -37,7 +37,8 @@ public class NestedPropertyDescriptor<BT> implements public NestedPropertyDescriptor(String name, Class<BT> beanType) throws IllegalArgumentException { this.name = name; - NestedMethodProperty property = new NestedMethodProperty(beanType, name); + NestedMethodProperty<?> property = new NestedMethodProperty<Object>( + beanType, name); this.propertyType = property.getType(); } @@ -49,8 +50,8 @@ public class NestedPropertyDescriptor<BT> implements return propertyType; } - public Property createProperty(BT bean) { - return new NestedMethodProperty(bean, name); + public Property<?> createProperty(BT bean) { + return new NestedMethodProperty<Object>(bean, name); } } diff --git a/src/com/vaadin/data/util/PropertysetItem.java b/src/com/vaadin/data/util/PropertysetItem.java index 6224d3a01c..321342eb64 100644 --- a/src/com/vaadin/data/util/PropertysetItem.java +++ b/src/com/vaadin/data/util/PropertysetItem.java @@ -57,7 +57,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * the identifier of the Property to get. * @return the Property with the given ID or <code>null</code> */ - public Property getItemProperty(Object id) { + public Property<?> getItemProperty(Object id) { return map.get(id); } diff --git a/src/com/vaadin/data/util/QueryContainer.java b/src/com/vaadin/data/util/QueryContainer.java index 10e308f43c..28c511d32f 100644 --- a/src/com/vaadin/data/util/QueryContainer.java +++ b/src/com/vaadin/data/util/QueryContainer.java @@ -229,7 +229,7 @@ public class QueryContainer implements Container, Container.Ordered, * otherwise. */ - public synchronized Property getContainerProperty(Object itemId, + public synchronized Property<?> getContainerProperty(Object itemId, Object propertyId) { if (!(itemId instanceof Integer && propertyId instanceof String)) { return null; @@ -532,7 +532,7 @@ public class QueryContainer implements Container, Container.Ordered, * identifier of the Property to get * @return the Property with the given ID or <code>null</code> */ - public Property getItemProperty(Object propertyId) { + public Property<?> getItemProperty(Object propertyId) { return getContainerProperty(id, propertyId); } diff --git a/src/com/vaadin/data/util/VaadinPropertyDescriptor.java b/src/com/vaadin/data/util/VaadinPropertyDescriptor.java index 37f030bbc2..50ca939b3a 100644 --- a/src/com/vaadin/data/util/VaadinPropertyDescriptor.java +++ b/src/com/vaadin/data/util/VaadinPropertyDescriptor.java @@ -39,5 +39,5 @@ public interface VaadinPropertyDescriptor<BT> extends Serializable { * @param bean * @return */ - public Property createProperty(BT bean); + public Property<?> createProperty(BT bean); }
\ No newline at end of file diff --git a/src/com/vaadin/data/util/sqlcontainer/RowItem.java b/src/com/vaadin/data/util/sqlcontainer/RowItem.java index fbcee76f37..fac0292efa 100644 --- a/src/com/vaadin/data/util/sqlcontainer/RowItem.java +++ b/src/com/vaadin/data/util/sqlcontainer/RowItem.java @@ -48,7 +48,7 @@ public final class RowItem implements Item { this.id = id; } - public Property getItemProperty(Object id) { + public Property<?> getItemProperty(Object id) { if (id instanceof String && id != null) { for (ColumnProperty cp : properties) { if (id.equals(cp.getPropertyId())) { diff --git a/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java index 1db5d406d7..110fd32913 100644 --- a/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java +++ b/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java @@ -227,7 +227,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ - public Property getContainerProperty(Object itemId, Object propertyId) { + public Property<?> getContainerProperty(Object itemId, Object propertyId) { Item item = getItem(itemId); if (item == null) { return null; |