From 7065740d6d02954c3483e2f24db36ad1af45c62e Mon Sep 17 00:00:00 2001 From: Ahmed Ashour Date: Thu, 28 Sep 2017 10:39:17 +0200 Subject: Use interface instead of implementation (#10073) --- .../main/java/com/vaadin/v7/ui/AbstractSelect.java | 6 +++--- .../src/main/java/com/vaadin/v7/ui/Form.java | 4 ++-- .../src/main/java/com/vaadin/v7/ui/Table.java | 24 +++++++++++----------- .../src/main/java/com/vaadin/v7/ui/Tree.java | 7 ++++--- .../calendar/event/BasicEventProvider.java | 2 +- 5 files changed, 22 insertions(+), 21 deletions(-) (limited to 'compatibility-server/src/main/java/com/vaadin/v7/ui') 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 implements /** * Item icons. */ - private final HashMap itemIcons = new HashMap(); + private final Map itemIcons = new HashMap(); /** * Item captions. */ - private final HashMap itemCaptions = new HashMap(); + private final Map itemCaptions = new HashMap(); /** * 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 /** * Mapping from propertyName to corresponding field. */ - private final HashMap> fields = new HashMap>(); + private final Map> fields = new HashMap>(); /** * Form may act as an Item, its own properties are stored here. */ - private final HashMap> ownProperties = new HashMap>(); + private final Map> ownProperties = new HashMap>(); /** * 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 columnHeaders = new HashMap(); + private final Map columnHeaders = new HashMap(); /** * Holds footers for visible columns (by propertyId). */ - private final HashMap columnFooters = new HashMap(); + private final Map columnFooters = new HashMap(); /** * Holds icons for visible columns (by propertyId). */ - private final HashMap columnIcons = new HashMap(); + private final Map columnIcons = new HashMap(); /** * Holds alignments for visible columns (by propertyId). */ - private HashMap columnAlignments = new HashMap(); + private Map columnAlignments = new HashMap(); /** * Holds column widths in pixels for visible columns (by propertyId). */ - private final HashMap columnWidths = new HashMap(); + private final Map columnWidths = new HashMap(); /** * Holds column expand rations for visible columns (by propertyId). */ - private final HashMap columnExpandRatios = new HashMap(); + private final Map columnExpandRatios = new HashMap(); /** * Holds column generators */ - private final HashMap columnGenerators = new LinkedHashMap(); + private final Map columnGenerators = new LinkedHashMap(); /** * 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> propertyValueConverters = new HashMap>(); + private Map> propertyValueConverters = new HashMap>(); /** * 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 newCA = new HashMap(); + final Map newCA = new HashMap(); int i = 0; for (final Iterator 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 visibleColOrder = new ArrayList(); + final List visibleColOrder = new ArrayList(); 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 findAndPaintBodyActions(PaintTarget target) { Set actionSet = new LinkedHashSet(); if (actionHandlers != null) { - final ArrayList keys = new ArrayList(); + final List keys = new ArrayList(); 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 keys = new ArrayList(); + final List keys = new ArrayList(); 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 itemIconAlts = new HashMap(); + private final Map itemIconAlts = new HashMap(); /** * 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 keys = new ArrayList(); + final List keys = new ArrayList(); 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 keys = new ArrayList(); + final List keys = new ArrayList(); final Iterator 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 getEvents(Date startDate, Date endDate) { - ArrayList activeEvents = new ArrayList(); + List activeEvents = new ArrayList(); for (CalendarEvent ev : eventList) { long from = startDate.getTime(); -- cgit v1.2.3