diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-28 10:39:17 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-28 11:39:17 +0300 |
commit | 7065740d6d02954c3483e2f24db36ad1af45c62e (patch) | |
tree | db3a0f0cabb8cc3ce4a4d2636aff9bf1716fcd8b /compatibility-server/src | |
parent | 1827ccb5ed99c9b2deeea38e239527420711f5d1 (diff) | |
download | vaadin-framework-7065740d6d02954c3483e2f24db36ad1af45c62e.tar.gz vaadin-framework-7065740d6d02954c3483e2f24db36ad1af45c62e.zip |
Use interface instead of implementation (#10073)
Diffstat (limited to 'compatibility-server/src')
24 files changed, 125 insertions, 112 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/ContainerHelpers.java b/compatibility-server/src/main/java/com/vaadin/v7/data/ContainerHelpers.java index 1b80737546..51e1444b24 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/ContainerHelpers.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/ContainerHelpers.java @@ -29,7 +29,8 @@ import com.vaadin.v7.data.Container.Indexed; * * @since 7.0 * - * @deprecated As of 8.0, no direct replacement available, see {@link DataProvider} + * @deprecated As of 8.0, no direct replacement available, see + * {@link DataProvider} */ @Deprecated public class ContainerHelpers implements Serializable { @@ -87,16 +88,16 @@ public class ContainerHelpers implements Serializable { endIndex = container.size(); } - ArrayList<Object> rangeOfIds = new ArrayList<Object>(); + List<Object> rangeOfIds = new ArrayList<Object>(); for (int i = startIndex; i < endIndex; i++) { Object idByIndex = container.getIdByIndex(i); if (idByIndex == null) { - throw new RuntimeException( - "Unable to get item id for index: " + i - + " from container using Container.Indexed#getIdByIndex() " - + "even though container.size() > endIndex. " - + "Returned item id was null. " - + "Check your container implementation!"); + throw new RuntimeException("Unable to get item id for index: " + + i + + " from container using Container.Indexed#getIdByIndex() " + + "even though container.size() > endIndex. " + + "Returned item id was null. " + + "Check your container implementation!"); } rangeOfIds.add(idByIndex); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/FieldGroup.java b/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/FieldGroup.java index 154014707a..ff4779ee8e 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/FieldGroup.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/FieldGroup.java @@ -40,10 +40,10 @@ import com.vaadin.v7.ui.Field; * FieldGroup provides an easy way of binding fields to data and handling * commits of these fields. * <p> - * The functionality of FieldGroup is similar to {@link com.vaadin.v7.ui.Form Form} but - * {@link FieldGroup} does not handle layouts in any way. The typical use case - * is to create a layout outside the FieldGroup and then use FieldGroup to bind - * the fields to a data source. + * The functionality of FieldGroup is similar to {@link com.vaadin.v7.ui.Form + * Form} but {@link FieldGroup} does not handle layouts in any way. The typical + * use case is to create a layout outside the FieldGroup and then use FieldGroup + * to bind the fields to a data source. * </p> * <p> * {@link FieldGroup} is not a UI component so it cannot be added to a layout. @@ -65,7 +65,7 @@ public class FieldGroup implements Serializable { private boolean enabled = true; private boolean readOnly = false; - private HashMap<Object, Field<?>> propertyIdToField = new HashMap<Object, Field<?>>(); + private Map<Object, Field<?>> propertyIdToField = new HashMap<Object, Field<?>>(); private LinkedHashMap<Field<?>, Object> fieldToPropertyId = new LinkedHashMap<Field<?>, Object>(); private List<CommitHandler> commitHandlers = new ArrayList<CommitHandler>(); @@ -1258,7 +1258,7 @@ public class FieldGroup implements Serializable { */ protected static List<java.lang.reflect.Field> getFieldsInDeclareOrder( Class searchClass) { - ArrayList<java.lang.reflect.Field> memberFieldInOrder = new ArrayList<java.lang.reflect.Field>(); + List<java.lang.reflect.Field> memberFieldInOrder = new ArrayList<java.lang.reflect.Field>(); while (searchClass != null) { for (java.lang.reflect.Field memberField : searchClass @@ -1284,4 +1284,4 @@ public class FieldGroup implements Serializable { } -}
\ No newline at end of file +} diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerHierarchicalWrapper.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerHierarchicalWrapper.java index 5ad3cee4c7..a4e9d74c53 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerHierarchicalWrapper.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerHierarchicalWrapper.java @@ -26,6 +26,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.LinkedList; +import java.util.Map; import com.vaadin.v7.data.Container; import com.vaadin.v7.data.Item; @@ -63,10 +64,10 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, private HashSet<Object> noChildrenAllowed = null; /** Mapping from Item ID to parent Item ID */ - private Hashtable<Object, Object> parent = null; + private Map<Object, Object> parent = null; /** Mapping from Item ID to a list of child IDs */ - private Hashtable<Object, LinkedList<Object>> children = null; + private Map<Object, LinkedList<Object>> children = null; /** List that contains all root elements of the container. */ private LinkedHashSet<Object> roots = null; diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerOrderedWrapper.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerOrderedWrapper.java index 69f51fc884..f7da00acd9 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerOrderedWrapper.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerOrderedWrapper.java @@ -22,6 +22,7 @@ import java.util.Hashtable; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map; import com.vaadin.data.provider.DataProvider; import com.vaadin.v7.data.Container; @@ -60,13 +61,13 @@ public class ContainerOrderedWrapper implements Container.Ordered, * Ordering information, i.e. the mapping from Item ID to the next item ID. * The last item id should not be present */ - private Hashtable<Object, Object> next; + private Map<Object, Object> next; /** * Reverse ordering information for convenience and performance reasons. The * first item id should not be present */ - private Hashtable<Object, Object> prev; + private Map<Object, Object> prev; /** * ID of the first Item in the container. diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/HierarchicalContainer.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/HierarchicalContainer.java index a0943bc7ce..aa504409db 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/HierarchicalContainer.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/HierarchicalContainer.java @@ -22,6 +22,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.LinkedList; +import java.util.Map; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -53,23 +54,23 @@ public class HierarchicalContainer extends IndexedContainer /** * Mapping from Item ID to parent Item ID. */ - private final HashMap<Object, Object> parent = new HashMap<Object, Object>(); + private final Map<Object, Object> parent = new HashMap<Object, Object>(); /** * Mapping from Item ID to parent Item ID for items included in the filtered * container. */ - private HashMap<Object, Object> filteredParent = null; + private Map<Object, Object> filteredParent = null; /** * Mapping from Item ID to a list of child IDs. */ - private final HashMap<Object, LinkedList<Object>> children = new HashMap<Object, LinkedList<Object>>(); + private final Map<Object, LinkedList<Object>> children = new HashMap<Object, LinkedList<Object>>(); /** * Mapping from Item ID to a list of child IDs when filtered */ - private HashMap<Object, LinkedList<Object>> filteredChildren = null; + private Map<Object, LinkedList<Object>> filteredChildren = null; /** * List that contains all root elements of the container. diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/IndexedContainer.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/IndexedContainer.java index f91cb783fe..bd74a132b0 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/IndexedContainer.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/IndexedContainer.java @@ -28,6 +28,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Set; import com.vaadin.data.provider.ListDataProvider; import com.vaadin.v7.data.Container; @@ -74,29 +75,29 @@ public class IndexedContainer /** * Linked list of ordered Property IDs. */ - private ArrayList<Object> propertyIds = new ArrayList<Object>(); + private List<Object> propertyIds = new ArrayList<Object>(); /** * Property ID to type mapping. */ - private Hashtable<Object, Class<?>> types = new Hashtable<Object, Class<?>>(); + private Map<Object, Class<?>> types = new Hashtable<Object, Class<?>>(); /** * Hash of Items, where each Item is implemented as a mapping from Property * ID to Property value. */ - private Hashtable<Object, Map<Object, Object>> items = new Hashtable<Object, Map<Object, Object>>(); + private Map<Object, Map<Object, Object>> items = new Hashtable<Object, Map<Object, Object>>(); /** * Set of properties that are read-only. */ - private HashSet<Property<?>> readOnlyProperties = new HashSet<Property<?>>(); + private Set<Property<?>> readOnlyProperties = new HashSet<Property<?>>(); /** * List of all Property value change event listeners listening all the * properties. */ - private LinkedList<Property.ValueChangeListener> propertyValueChangeListeners = null; + private List<Property.ValueChangeListener> propertyValueChangeListeners = null; /** * Data structure containing all listeners interested in changes to single @@ -104,9 +105,9 @@ public class IndexedContainer * hashtable that maps Item IDs to a linked list of listeners listening * Property identified by given Property ID and Item ID. */ - private Hashtable<Object, Map<Object, List<Property.ValueChangeListener>>> singlePropertyValueChangeListeners = null; + private Map<Object, Map<Object, List<Property.ValueChangeListener>>> singlePropertyValueChangeListeners; - private HashMap<Object, Object> defaultPropertyValues; + private Map<Object, Object> defaultPropertyValues; private int nextGeneratedItemId = 1; @@ -266,7 +267,7 @@ public class IndexedContainer * @param t * data table of added item */ - private void addDefaultValues(Hashtable<Object, Object> t) { + private void addDefaultValues(Map<Object, Object> t) { if (defaultPropertyValues != null) { for (Object key : defaultPropertyValues.keySet()) { t.put(key, defaultPropertyValues.get(key)); @@ -389,7 +390,7 @@ public class IndexedContainer @Override protected void registerNewItem(int index, Object newItemId, Item item) { - Hashtable<Object, Object> t = new Hashtable<Object, Object>(); + Map<Object, Object> t = new Hashtable<Object, Object>(); items.put(newItemId, t); addDefaultValues(t); } @@ -983,39 +984,39 @@ public class IndexedContainer final IndexedContainer nc = new IndexedContainer(); // Clone the shallow properties - nc.setAllItemIds(getAllItemIds() != null - ? (ListSet<Object>) ((ListSet<Object>) getAllItemIds()).clone() - : null); + nc.setAllItemIds( + getAllItemIds() != null ? new ListSet<Object>(getAllItemIds()) + : null); nc.setItemSetChangeListeners(getItemSetChangeListeners() != null ? new LinkedList<Container.ItemSetChangeListener>( getItemSetChangeListeners()) : null); nc.propertyIds = propertyIds != null - ? (ArrayList<Object>) propertyIds.clone() : null; + ? new ArrayList<Object>(propertyIds) + : null; nc.setPropertySetChangeListeners(getPropertySetChangeListeners() != null ? new LinkedList<Container.PropertySetChangeListener>( getPropertySetChangeListeners()) : null); nc.propertyValueChangeListeners = propertyValueChangeListeners != null - ? (LinkedList<Property.ValueChangeListener>) propertyValueChangeListeners - .clone() + ? new LinkedList<Property.ValueChangeListener>( + propertyValueChangeListeners) : null; nc.readOnlyProperties = readOnlyProperties != null - ? (HashSet<Property<?>>) readOnlyProperties.clone() : null; + ? new HashSet<Property<?>>(readOnlyProperties) + : null; nc.singlePropertyValueChangeListeners = singlePropertyValueChangeListeners != null - ? (Hashtable<Object, Map<Object, List<Property.ValueChangeListener>>>) singlePropertyValueChangeListeners - .clone() + ? new Hashtable<Object, Map<Object, List<Property.ValueChangeListener>>>( + singlePropertyValueChangeListeners) : null; - nc.types = types != null ? (Hashtable<Object, Class<?>>) types.clone() + nc.types = types != null ? new Hashtable<Object, Class<?>>(types) : null; - nc.setFilters( - (HashSet<Filter>) ((HashSet<Filter>) getFilters()).clone()); + nc.setFilters(new HashSet<Filter>(getFilters())); nc.setFilteredItemIds(getFilteredItemIds() == null ? null - : (ListSet<Object>) ((ListSet<Object>) getFilteredItemIds()) - .clone()); + : new ListSet<Object>(getFilteredItemIds())); // Clone property-values if (items == null) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/ListSet.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/ListSet.java index 7b7a4b7782..4c40c8c81a 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/ListSet.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/ListSet.java @@ -21,6 +21,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.Map; /** * ListSet is an internal Vaadin class which implements a combination of a List @@ -42,7 +43,7 @@ public class ListSet<E> extends ArrayList<E> { * Contains a map from an element to the number of duplicates it has. Used * to temporarily allow duplicates in the list. */ - private HashMap<E, Integer> duplicates = new HashMap<E, Integer>(); + private Map<E, Integer> duplicates = new HashMap<E, Integer>(); public ListSet() { super(); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/PropertysetItem.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/PropertysetItem.java index d5ad5f4aef..81eb4eb00d 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/PropertysetItem.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/PropertysetItem.java @@ -22,6 +22,7 @@ import java.util.EventObject; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; +import java.util.List; import java.util.Map; import com.vaadin.data.Binder; @@ -54,17 +55,17 @@ public class PropertysetItem /** * Mapping from property id to property. */ - private HashMap<Object, Property<?>> map = new HashMap<Object, Property<?>>(); + private Map<Object, Property<?>> map = new HashMap<Object, Property<?>>(); /** * List of all property ids to maintain the order. */ - private LinkedList<Object> list = new LinkedList<Object>(); + private List<Object> list = new LinkedList<Object>(); /** * List of property set modification listeners. */ - private LinkedList<Item.PropertySetChangeListener> propertySetChangeListeners = null; + private List<Item.PropertySetChangeListener> propertySetChangeListeners = null; /* Item methods */ @@ -307,12 +308,12 @@ public class PropertysetItem final PropertysetItem npsi = new PropertysetItem(); - npsi.list = list != null ? (LinkedList<Object>) list.clone() : null; + npsi.list = list != null ? new LinkedList<Object>(list) : null; npsi.propertySetChangeListeners = propertySetChangeListeners != null - ? (LinkedList<PropertySetChangeListener>) propertySetChangeListeners - .clone() + ? new LinkedList<PropertySetChangeListener>( + propertySetChangeListeners) : null; - npsi.map = (HashMap<Object, Property<?>>) map.clone(); + npsi.map = new HashMap<Object, Property<?>>(map); return npsi; } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainer.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainer.java index 070b15fc5c..5ff356cbfe 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainer.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainer.java @@ -313,7 +313,7 @@ public class SQLContainer implements Container, Container.Filterable, @Override public Collection<?> getItemIds() { updateCount(); - ArrayList<RowId> ids = new ArrayList<RowId>(); + List<RowId> ids = new ArrayList<RowId>(); ResultSet rs = null; try { // Load ALL rows :( @@ -542,7 +542,7 @@ public class SQLContainer implements Container, Container.Filterable, * {@inheritDoc} */ public void removeContainerFilters(Object propertyId) { - ArrayList<Filter> toRemove = new ArrayList<Filter>(); + List<Filter> toRemove = new ArrayList<Filter>(); for (Filter f : filters) { if (f.appliesToProperty(propertyId)) { toRemove.add(f); @@ -1322,7 +1322,7 @@ public class SQLContainer implements Container, Container.Filterable, } private List<RowItem> getFilteredAddedItems() { - ArrayList<RowItem> filtered = new ArrayList<RowItem>(addedItems); + List<RowItem> filtered = new ArrayList<RowItem>(addedItems); if (filters != null && !filters.isEmpty()) { for (RowItem item : addedItems) { if (!itemPassesFilters(item)) { @@ -1684,8 +1684,7 @@ public class SQLContainer implements Container, Container.Filterable, return refdCont.getItem(getReferencedItemId(itemId, refdCont)); } - private void writeObject(ObjectOutputStream out) - throws IOException { + private void writeObject(ObjectOutputStream out) throws IOException { out.defaultWriteObject(); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/TableQuery.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/TableQuery.java index b415c5ac51..3cfd95e489 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/TableQuery.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/TableQuery.java @@ -559,9 +559,11 @@ public class TableQuery extends AbstractTransactionalQuery null); if (!tables.next()) { String catalog = (catalogName != null) - ? catalogName.toUpperCase() : null; + ? catalogName.toUpperCase() + : null; String schema = (schemaName != null) - ? schemaName.toUpperCase() : null; + ? schemaName.toUpperCase() + : null; tables = dbmd.getTables(catalog, schema, tableName.toUpperCase(), null); if (!tables.next()) { @@ -680,7 +682,7 @@ public class TableQuery extends AbstractTransactionalQuery @Override public boolean containsRowWithKey(Object... keys) throws SQLException { - ArrayList<Filter> filtersAndKeys = new ArrayList<Filter>(); + List<Filter> filtersAndKeys = new ArrayList<Filter>(); if (filters != null) { filtersAndKeys.addAll(filters); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractSelect.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractSelect.java index eada1aa02b..894936e1cd 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractSelect.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractSelect.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import com.vaadin.ui.AbstractListing; import org.jsoup.nodes.Element; import com.vaadin.event.Transferable; @@ -46,6 +45,7 @@ import com.vaadin.server.Resource; import com.vaadin.server.VaadinSession; import com.vaadin.shared.ui.dd.VerticalDropLocation; import com.vaadin.ui.AbstractComponent; +import com.vaadin.ui.AbstractListing; import com.vaadin.ui.Component; import com.vaadin.ui.LegacyComponent; import com.vaadin.ui.declarative.DesignAttributeHandler; @@ -245,12 +245,12 @@ public abstract class AbstractSelect extends AbstractField<Object> implements /** * Item icons. */ - private final HashMap<Object, Resource> itemIcons = new HashMap<Object, Resource>(); + private final Map<Object, Resource> itemIcons = new HashMap<Object, Resource>(); /** * Item captions. */ - private final HashMap<Object, String> itemCaptions = new HashMap<Object, String>(); + private final Map<Object, String> itemCaptions = new HashMap<Object, String>(); /** * Item caption mode. diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java index b88ee7f5df..63a6118c58 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java @@ -114,12 +114,12 @@ public class Form extends AbstractField<Object> /** * Mapping from propertyName to corresponding field. */ - private final HashMap<Object, Field<?>> fields = new HashMap<Object, Field<?>>(); + private final Map<Object, Field<?>> fields = new HashMap<Object, Field<?>>(); /** * Form may act as an Item, its own properties are stored here. */ - private final HashMap<Object, Property<?>> ownProperties = new HashMap<Object, Property<?>>(); + private final Map<Object, Property<?>> ownProperties = new HashMap<Object, Property<?>>(); /** * Field factory for this form. diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java index 82dc65774c..c99757ee04 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java @@ -410,37 +410,37 @@ public class Table extends AbstractSelect implements Action.Container, /** * Holds headers for visible columns (by propertyId). */ - private final HashMap<Object, String> columnHeaders = new HashMap<Object, String>(); + private final Map<Object, String> columnHeaders = new HashMap<Object, String>(); /** * Holds footers for visible columns (by propertyId). */ - private final HashMap<Object, String> columnFooters = new HashMap<Object, String>(); + private final Map<Object, String> columnFooters = new HashMap<Object, String>(); /** * Holds icons for visible columns (by propertyId). */ - private final HashMap<Object, Resource> columnIcons = new HashMap<Object, Resource>(); + private final Map<Object, Resource> columnIcons = new HashMap<Object, Resource>(); /** * Holds alignments for visible columns (by propertyId). */ - private HashMap<Object, Align> columnAlignments = new HashMap<Object, Align>(); + private Map<Object, Align> columnAlignments = new HashMap<Object, Align>(); /** * Holds column widths in pixels for visible columns (by propertyId). */ - private final HashMap<Object, Integer> columnWidths = new HashMap<Object, Integer>(); + private final Map<Object, Integer> columnWidths = new HashMap<Object, Integer>(); /** * Holds column expand rations for visible columns (by propertyId). */ - private final HashMap<Object, Float> columnExpandRatios = new HashMap<Object, Float>(); + private final Map<Object, Float> columnExpandRatios = new HashMap<Object, Float>(); /** * Holds column generators */ - private final HashMap<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<Object, ColumnGenerator>(); + private final Map<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<Object, ColumnGenerator>(); /** * Holds value of property pageLength. 0 disables paging. @@ -597,7 +597,7 @@ public class Table extends AbstractSelect implements Action.Container, private boolean painted = false; - private HashMap<Object, Converter<String, Object>> propertyValueConverters = new HashMap<Object, Converter<String, Object>>(); + private Map<Object, Converter<String, Object>> propertyValueConverters = new HashMap<Object, Converter<String, Object>>(); /** * Set to true if the client-side should be informed that the key mapper has @@ -895,7 +895,7 @@ public class Table extends AbstractSelect implements Action.Container, } // Resets the alignments - final HashMap<Object, Align> newCA = new HashMap<Object, Align>(); + final Map<Object, Align> newCA = new HashMap<Object, Align>(); int i = 0; for (final Iterator<Object> it = visibleColumns.iterator(); it.hasNext() && i < columnAlignments.length; i++) { @@ -3725,7 +3725,7 @@ public class Table extends AbstractSelect implements Action.Container, private void paintVisibleColumnOrder(PaintTarget target) { // Visible column order - final ArrayList<String> visibleColOrder = new ArrayList<String>(); + final List<String> visibleColOrder = new ArrayList<String>(); for (Object columnId : visibleColumns) { if (!isColumnCollapsed(columnId)) { visibleColOrder.add(columnIdMap.key(columnId)); @@ -3737,7 +3737,7 @@ public class Table extends AbstractSelect implements Action.Container, private Set<Action> findAndPaintBodyActions(PaintTarget target) { Set<Action> actionSet = new LinkedHashSet<Action>(); if (actionHandlers != null) { - final ArrayList<String> keys = new ArrayList<String>(); + final List<String> keys = new ArrayList<String>(); for (Handler ah : actionHandlers) { // Getting actions for the null item, which in this case means // the body item @@ -3955,7 +3955,7 @@ public class Table extends AbstractSelect implements Action.Container, // Actions if (actionHandlers != null) { - final ArrayList<String> keys = new ArrayList<String>(); + final List<String> keys = new ArrayList<String>(); for (Handler ah : actionHandlers) { final Action[] aa = ah.getActions(itemId, this); if (aa != null) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Tree.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Tree.java index cba3dd45da..6b3a4497c8 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Tree.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Tree.java @@ -25,6 +25,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.LinkedList; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.Stack; @@ -122,7 +123,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Item icons alt texts. */ - private final HashMap<Object, String> itemIconAlts = new HashMap<Object, String>(); + private final Map<Object, String> itemIconAlts = new HashMap<Object, String>(); /** * Set of expanded nodes. @@ -691,7 +692,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * by right clicking on the Tree body */ if (actionHandlers != null) { - final ArrayList<String> keys = new ArrayList<String>(); + final List<String> keys = new ArrayList<String>(); for (Handler ah : actionHandlers) { // Getting action for the null item, which in this case @@ -778,7 +779,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, // Actions if (actionHandlers != null) { - final ArrayList<String> keys = new ArrayList<String>(); + final List<String> keys = new ArrayList<String>(); final Iterator<Action.Handler> ahi = actionHandlers .iterator(); while (ahi.hasNext()) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/event/BasicEventProvider.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/event/BasicEventProvider.java index 99383c165c..e84a8384f8 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/event/BasicEventProvider.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/event/BasicEventProvider.java @@ -59,7 +59,7 @@ public class BasicEventProvider implements CalendarEditableEventProvider, */ @Override public List<CalendarEvent> getEvents(Date startDate, Date endDate) { - ArrayList<CalendarEvent> activeEvents = new ArrayList<CalendarEvent>(); + List<CalendarEvent> activeEvents = new ArrayList<CalendarEvent>(); for (CalendarEvent ev : eventList) { long from = startDate.getTime(); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/PerformanceTestIndexedContainerTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/PerformanceTestIndexedContainerTest.java index a22b704b84..78ff4e9b9f 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/PerformanceTestIndexedContainerTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/PerformanceTestIndexedContainerTest.java @@ -3,6 +3,7 @@ package com.vaadin.v7.data.util; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.List; import java.util.SortedSet; import java.util.TreeSet; @@ -113,7 +114,7 @@ public class PerformanceTestIndexedContainerTest { } private Long median(Collection<Long> times) { - ArrayList<Long> list = new ArrayList<Long>(times); + List<Long> list = new ArrayList<Long>(times); Collections.sort(list); // not exact median in some cases, but good enough return list.get(list.size() / 2); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/ColumnPropertyTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/ColumnPropertyTest.java index ce6398b50a..7392674fce 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/ColumnPropertyTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/ColumnPropertyTest.java @@ -6,6 +6,7 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.Arrays; +import java.util.List; import org.easymock.EasyMock; import org.junit.Assert; @@ -301,7 +302,7 @@ public class ColumnPropertyTest { // Here we really don't care about the container management, but in // order to set the value for a column the owner (RowItem) must be set // and to create the owner we must have a container... - ArrayList<ColumnProperty> properties = new ArrayList<ColumnProperty>(); + List<ColumnProperty> properties = new ArrayList<ColumnProperty>(); properties.add(property); SQLContainer container = EasyMock.createNiceMock(SQLContainer.class); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTableQueryTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTableQueryTest.java index 4318295547..e04b6fc643 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTableQueryTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTableQueryTest.java @@ -163,7 +163,7 @@ public class SQLContainerTableQueryTest { @Test public void propertyIdsAreFetched() { - ArrayList<String> propertyIds = new ArrayList<String>( + List<String> propertyIds = new ArrayList<String>( (Collection<? extends String>) container .getContainerPropertyIds()); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTest.java index f858bde4ac..fe344cf8ef 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTest.java @@ -1649,7 +1649,7 @@ public class SQLContainerTest { connectionPool, "ID"); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - final ArrayList<OrderBy> orderBys = new ArrayList<OrderBy>(); + final List<OrderBy> orderBys = new ArrayList<OrderBy>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); @@ -1767,7 +1767,7 @@ public class SQLContainerTest { connectionPool, "ID"); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - final ArrayList<OrderBy> orderBys = new ArrayList<OrderBy>(); + final List<OrderBy> orderBys = new ArrayList<OrderBy>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); @@ -1878,7 +1878,7 @@ public class SQLContainerTest { connectionPool, "ID"); FreeformStatementDelegate delegate = EasyMock .createMock(FreeformStatementDelegate.class); - final ArrayList<Filter> filters = new ArrayList<Filter>(); + final List<Filter> filters = new ArrayList<Filter>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); @@ -1949,7 +1949,7 @@ public class SQLContainerTest { connectionPool, "ID"); FreeformStatementDelegate delegate = EasyMock .createMock(FreeformStatementDelegate.class); - final ArrayList<Filter> filters = new ArrayList<Filter>(); + final List<Filter> filters = new ArrayList<Filter>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(null); @@ -2019,7 +2019,7 @@ public class SQLContainerTest { connectionPool, "ID"); FreeformStatementDelegate delegate = EasyMock .createMock(FreeformStatementDelegate.class); - final ArrayList<Filter> filters = new ArrayList<Filter>(); + final List<Filter> filters = new ArrayList<Filter>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); @@ -2090,7 +2090,7 @@ public class SQLContainerTest { connectionPool, "ID"); FreeformStatementDelegate delegate = EasyMock .createMock(FreeformStatementDelegate.class); - final ArrayList<Filter> filters = new ArrayList<Filter>(); + final List<Filter> filters = new ArrayList<Filter>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); @@ -2167,7 +2167,7 @@ public class SQLContainerTest { connectionPool, "ID"); FreeformStatementDelegate delegate = EasyMock .createMock(FreeformStatementDelegate.class); - final ArrayList<Filter> filters = new ArrayList<Filter>(); + final List<Filter> filters = new ArrayList<Filter>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); @@ -2244,7 +2244,7 @@ public class SQLContainerTest { connectionPool, "ID"); FreeformStatementDelegate delegate = EasyMock .createMock(FreeformStatementDelegate.class); - final ArrayList<Filter> filters = new ArrayList<Filter>(); + final List<Filter> filters = new ArrayList<Filter>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); @@ -2353,7 +2353,7 @@ public class SQLContainerTest { connectionPool, "ID"); FreeformQueryDelegate delegate = EasyMock .createMock(FreeformQueryDelegate.class); - final ArrayList<OrderBy> orderBys = new ArrayList<OrderBy>(); + final List<OrderBy> orderBys = new ArrayList<OrderBy>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/TicketTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/TicketTest.java index 34cc791c7a..cd8ad96e9a 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/TicketTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/TicketTest.java @@ -56,7 +56,7 @@ public class TicketTest { Arrays.asList("ID"), connectionPool); FreeformStatementDelegate delegate = EasyMock .createMock(FreeformStatementDelegate.class); - final ArrayList<Filter> filters = new ArrayList<Filter>(); + final List<Filter> filters = new ArrayList<Filter>(); delegate.setFilters(null); EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQueryTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQueryTest.java index 04d357c71c..ea65310fc4 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQueryTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQueryTest.java @@ -259,7 +259,7 @@ public class FreeformQueryTest { public void setFilters_noDelegate_shouldFail() { FreeformQuery query = new FreeformQuery("SELECT * FROM people", Arrays.asList("ID"), connectionPool); - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new Like("name", "%lle")); query.setFilters(filters); } diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/query/QueryBuilderTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/query/QueryBuilderTest.java index 834329b3d2..b01af9b9ad 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/query/QueryBuilderTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/query/QueryBuilderTest.java @@ -1,6 +1,7 @@ package com.vaadin.v7.data.util.sqlcontainer.query; import java.util.ArrayList; +import java.util.List; import org.easymock.EasyMock; import org.junit.Assert; @@ -200,7 +201,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_listOfFilters() { StatementHelper sh = mockedStatementHelper("%lle", 18); - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new Like("NAME", "%lle")); filters.add(new Greater("AGE", 18)); Assert.assertEquals(" WHERE \"NAME\" LIKE ? AND \"AGE\" > ?", @@ -211,7 +212,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_oneAndFilter() { StatementHelper sh = mockedStatementHelper("%lle", 18); - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new And(new Like("NAME", "%lle"), new Greater("AGE", 18))); Assert.assertEquals(" WHERE (\"NAME\" LIKE ? AND \"AGE\" > ?)", QueryBuilder.getWhereStringForFilters(filters, sh)); @@ -221,7 +222,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_oneOrFilter() { StatementHelper sh = mockedStatementHelper("%lle", 18); - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new Or(new Like("NAME", "%lle"), new Greater("AGE", 18))); Assert.assertEquals(" WHERE (\"NAME\" LIKE ? OR \"AGE\" > ?)", QueryBuilder.getWhereStringForFilters(filters, sh)); @@ -231,7 +232,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_complexCompoundFilters() { StatementHelper sh = mockedStatementHelper("%lle", 18, 65, "Pelle"); - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new Or( new And(new Like("NAME", "%lle"), new Or(new Less("AGE", 18), new Greater("AGE", 65))), @@ -246,7 +247,7 @@ public class QueryBuilderTest { public void getWhereStringForFilters_complexCompoundFiltersAndSingleFilter() { StatementHelper sh = mockedStatementHelper("%lle", 18, 65, "Pelle", "Virtanen"); - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new Or( new And(new Like("NAME", "%lle"), new Or(new Less("AGE", 18), new Greater("AGE", 65))), @@ -260,7 +261,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_emptyList_shouldReturnEmptyString() { - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); Assert.assertEquals("", QueryBuilder.getWhereStringForFilters(filters, new StatementHelper())); } @@ -268,7 +269,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_NotFilter() { StatementHelper sh = mockedStatementHelper(18); - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new Not(new Equal("AGE", 18))); Assert.assertEquals(" WHERE NOT \"AGE\" = ?", QueryBuilder.getWhereStringForFilters(filters, sh)); @@ -278,7 +279,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_complexNegatedFilter() { StatementHelper sh = mockedStatementHelper(65, 18); - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add( new Not(new Or(new Equal("AGE", 65), new Equal("AGE", 18)))); Assert.assertEquals(" WHERE NOT (\"AGE\" = ? OR \"AGE\" = ?)", @@ -288,7 +289,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_isNull() { - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new IsNull("NAME")); Assert.assertEquals(" WHERE \"NAME\" IS NULL", QueryBuilder .getWhereStringForFilters(filters, new StatementHelper())); @@ -296,7 +297,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_isNotNull() { - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new Not(new IsNull("NAME"))); Assert.assertEquals(" WHERE \"NAME\" IS NOT NULL", QueryBuilder .getWhereStringForFilters(filters, new StatementHelper())); @@ -305,7 +306,7 @@ public class QueryBuilderTest { @Test public void getWhereStringForFilters_customStringDecorator() { QueryBuilder.setStringDecorator(new StringDecorator("[", "]")); - ArrayList<Filter> filters = new ArrayList<Filter>(); + List<Filter> filters = new ArrayList<Filter>(); filters.add(new Not(new IsNull("NAME"))); Assert.assertEquals(" WHERE [NAME] IS NOT NULL", QueryBuilder .getWhereStringForFilters(filters, new StatementHelper())); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/table/TablePropertyValueConverterTest.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/table/TablePropertyValueConverterTest.java index 4e59d432a0..09ace47f3d 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/table/TablePropertyValueConverterTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/table/TablePropertyValueConverterTest.java @@ -21,9 +21,9 @@ import static org.junit.Assert.fail; import java.lang.reflect.Field; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; import java.util.Locale; +import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -347,7 +347,7 @@ public class TablePropertyValueConverterTest { Field f = Table.class .getDeclaredField("propertyValueConverters"); f.setAccessible(true); - HashMap<Object, Converter<String, Object>> pvc = (HashMap<Object, Converter<String, Object>>) f + Map<Object, Converter<String, Object>> pvc = (Map<Object, Converter<String, Object>>) f .get(this); Set<Object> currentConverters = new HashSet<Object>(); for (Entry<Object, Converter<String, Object>> entry : pvc diff --git a/compatibility-server/src/test/java/com/vaadin/v7/ui/AbsSelectTest.java b/compatibility-server/src/test/java/com/vaadin/v7/ui/AbsSelectTest.java index 518ee484cc..635ba4e0e2 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/ui/AbsSelectTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/ui/AbsSelectTest.java @@ -17,6 +17,7 @@ package com.vaadin.v7.ui; import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import org.junit.Assert; import org.junit.Test; @@ -49,7 +50,7 @@ public class AbsSelectTest { @Test public void addItemsStringList() { - ArrayList<String> itemIds = new ArrayList<String>(); + List<String> itemIds = new ArrayList<String>(); itemIds.add("foo"); itemIds.add("bar"); itemIds.add("baz"); @@ -65,7 +66,7 @@ public class AbsSelectTest { Object o1 = new Object(); Object o2 = new Object(); Object o3 = new Object(); - ArrayList<Object> itemIds = new ArrayList<Object>(); + List<Object> itemIds = new ArrayList<Object>(); itemIds.add(o1); itemIds.add(o2); itemIds.add(o3); |