diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2017-02-24 17:06:58 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-03-07 12:36:54 +0200 |
commit | 0cfb20938f2b15767ebbd367ad8312642b947c8c (patch) | |
tree | 4fe0aab62b4551d630a90e5d74eb3659c1cef948 /compatibility-server/src/main/java/com/vaadin/v7/ui | |
parent | 812034829a9b2765b3b196b1cbba3e7ddfe4672d (diff) | |
download | vaadin-framework-0cfb20938f2b15767ebbd367ad8312642b947c8c.tar.gz vaadin-framework-0cfb20938f2b15767ebbd367ad8312642b947c8c.zip |
Revert diamond operator changes
Diffstat (limited to 'compatibility-server/src/main/java/com/vaadin/v7/ui')
18 files changed, 194 insertions, 190 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java index 53591e1d97..59e078e378 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java @@ -839,7 +839,7 @@ public abstract class AbstractField<T> extends AbstractLegacyComponent @Override public void addValidator(Validator validator) { if (validators == null) { - validators = new LinkedList<>(); + validators = new LinkedList<Validator>(); } validators.add(validator); markAsDirty(); @@ -962,7 +962,7 @@ public abstract class AbstractField<T> extends AbstractLegacyComponent } } - List<InvalidValueException> validationExceptions = new ArrayList<>(); + List<InvalidValueException> validationExceptions = new ArrayList<InvalidValueException>(); if (validators != null) { // Gets all the validation errors for (Validator v : validators) { 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 103eebb4e9..0aeef24c68 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 @@ -233,17 +233,17 @@ public abstract class AbstractSelect extends AbstractField<Object> implements /** * Keymapper used to map key values. */ - protected KeyMapper<Object> itemIdMapper = new KeyMapper<>(); + protected KeyMapper<Object> itemIdMapper = new KeyMapper<Object>(); /** * Item icons. */ - private final HashMap<Object, Resource> itemIcons = new HashMap<>(); + private final HashMap<Object, Resource> itemIcons = new HashMap<Object, Resource>(); /** * Item captions. */ - private final HashMap<Object, String> itemCaptions = new HashMap<>(); + private final HashMap<Object, String> itemCaptions = new HashMap<Object, String>(); /** * Item caption mode. @@ -471,7 +471,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements // TODO Optimize by adding repaintNotNeeded when applicable // Converts the key-array to id-set - final LinkedList<Object> acceptedSelections = new LinkedList<>(); + final LinkedList<Object> acceptedSelections = new LinkedList<Object>(); for (int i = 0; i < clientSideSelectedKeys.length; i++) { final Object id = itemIdMapper .get(clientSideSelectedKeys[i]); @@ -503,9 +503,9 @@ public abstract class AbstractSelect extends AbstractField<Object> implements @SuppressWarnings("unchecked") Set<Object> newsel = (Set<Object>) getValue(); if (newsel == null) { - newsel = new LinkedHashSet<>(); + newsel = new LinkedHashSet<Object>(); } else { - newsel = new LinkedHashSet<>(newsel); + newsel = new LinkedHashSet<Object>(newsel); } newsel.removeAll(visibleNotSelected); newsel.addAll(acceptedSelections); @@ -657,14 +657,14 @@ public abstract class AbstractSelect extends AbstractField<Object> implements // If the return value is not a set if (retValue == null) { - return new HashSet<>(); + return new HashSet<Object>(); } if (retValue instanceof Set) { return Collections.unmodifiableSet((Set<?>) retValue); } else if (retValue instanceof Collection) { return new HashSet<Object>((Collection<?>) retValue); } else { - final Set<Object> s = new HashSet<>(); + final Set<Object> s = new HashSet<Object>(); if (items.containsId(retValue)) { s.add(retValue); } @@ -722,7 +722,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements ConversionException, InvalidValueException { if (isMultiSelect()) { if (newFieldValue == null) { - super.setValue(new LinkedHashSet<>(), repaintIsNotNeeded, + super.setValue(new LinkedHashSet<Object>(), repaintIsNotNeeded, ignoreReadOnly); } else if (Collection.class .isAssignableFrom(newFieldValue.getClass())) { @@ -974,7 +974,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements if (isMultiSelect()) { Collection<Object> valueAsCollection = (Collection<Object>) value; - List<Object> newSelection = new ArrayList<>( + List<Object> newSelection = new ArrayList<Object>( valueAsCollection.size()); for (Object subValue : valueAsCollection) { if (containsId(subValue)) { @@ -1125,7 +1125,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements // Convert the value type if (multiSelect) { - final Set<Object> s = new HashSet<>(); + final Set<Object> s = new HashSet<Object>(); if (oldValue != null) { s.add(oldValue); } @@ -1530,7 +1530,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements setValue(itemId); } else if (!isSelected(itemId) && itemId != null && items.containsId(itemId)) { - final Set<Object> s = new HashSet<>((Set<?>) getValue()); + final Set<Object> s = new HashSet<Object>((Set<?>) getValue()); s.add(itemId); setValue(s); } @@ -1548,7 +1548,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements public void unselect(Object itemId) { if (isSelected(itemId)) { if (isMultiSelect()) { - final Set<Object> s = new HashSet<>((Set<?>) getValue()); + final Set<Object> s = new HashSet<Object>((Set<?>) getValue()); s.remove(itemId); setValue(s); } else { @@ -1577,7 +1577,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements public void addPropertySetChangeListener( Container.PropertySetChangeListener listener) { if (propertySetEventListeners == null) { - propertySetEventListeners = new LinkedHashSet<>(); + propertySetEventListeners = new LinkedHashSet<PropertySetChangeListener>(); } propertySetEventListeners.add(listener); } @@ -1627,7 +1627,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements public void addItemSetChangeListener( Container.ItemSetChangeListener listener) { if (itemSetEventListeners == null) { - itemSetEventListeners = new LinkedHashSet<>(); + itemSetEventListeners = new LinkedHashSet<ItemSetChangeListener>(); } itemSetEventListeners.add(listener); } @@ -1914,7 +1914,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements // TODO clean this up - type is either Item.PropertySetChangeNotifier or // Property.ValueChangeNotifier - HashSet<Object> captionChangeNotifiers = new HashSet<>(); + HashSet<Object> captionChangeNotifiers = new HashSet<Object>(); public void addNotifierForItem(Object itemId) { switch (getItemCaptionMode()) { @@ -2038,7 +2038,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements */ private static abstract class AbstractItemSetCriterion extends ClientSideCriterion { - protected final Collection<Object> itemIds = new HashSet<>(); + protected final Collection<Object> itemIds = new HashSet<Object>(); protected AbstractSelect select; public AbstractItemSetCriterion(AbstractSelect select, @@ -2213,7 +2213,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements } protected void readItems(Element design, DesignContext context) { - Set<String> selected = new HashSet<>(); + Set<String> selected = new HashSet<String>(); for (Element child : design.children()) { readItem(child, selected, context); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java index 73b147533c..6e5c1df7f8 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Calendar.java @@ -303,7 +303,7 @@ public class Calendar extends AbstractLegacyComponent public Calendar(String caption, CalendarEventProvider eventProvider) { registerRpc(rpc); setCaption(caption); - handlers = new HashMap<>(); + handlers = new HashMap<String, EventListener>(); setDefaultHandlers(); currentCalendar.setTime(new Date()); setEventProvider(eventProvider); @@ -467,7 +467,7 @@ public class Calendar extends AbstractLegacyComponent events = getEventProvider().getEvents(firstDateToShow, lastDateToShow); cacheMinMaxTimeOfDay(events); - List<CalendarState.Event> calendarStateEvents = new ArrayList<>(); + List<CalendarState.Event> calendarStateEvents = new ArrayList<CalendarState.Event>(); if (events != null) { for (int i = 0; i < events.size(); i++) { CalendarEvent e = events.get(i); @@ -617,9 +617,9 @@ public class Calendar extends AbstractLegacyComponent DateFormat weeklyCaptionFormatter = getWeeklyCaptionFormatter(); weeklyCaptionFormatter.setTimeZone(currentCalendar.getTimeZone()); - Map<CalendarDateRange, Set<Action>> actionMap = new HashMap<>(); + Map<CalendarDateRange, Set<Action>> actionMap = new HashMap<CalendarDateRange, Set<Action>>(); - List<CalendarState.Day> days = new ArrayList<>(); + List<CalendarState.Day> days = new ArrayList<CalendarState.Day>(); // Send all dates to client from server. This // approach was taken because gwt doesn't @@ -706,7 +706,7 @@ public class Calendar extends AbstractLegacyComponent getTimeZone()); Action[] actions = actionHandler.getActions(range, this); if (actions != null) { - Set<Action> actionSet = new LinkedHashSet<>( + Set<Action> actionSet = new LinkedHashSet<Action>( Arrays.asList(actions)); actionMap.put(range, actionSet); } @@ -719,7 +719,8 @@ public class Calendar extends AbstractLegacyComponent getTimeZone()); Action[] actions = actionHandler.getActions(range, this); if (actions != null) { - Set<Action> actionSet = new LinkedHashSet<>(Arrays.asList(actions)); + Set<Action> actionSet = new LinkedHashSet<Action>( + Arrays.asList(actions)); actionMap.put(range, actionSet); } } @@ -730,7 +731,7 @@ public class Calendar extends AbstractLegacyComponent return null; } - List<CalendarState.Action> calendarActions = new ArrayList<>(); + List<CalendarState.Action> calendarActions = new ArrayList<CalendarState.Action>(); SimpleDateFormat formatter = new SimpleDateFormat( DateConstants.ACTION_DATE_FORMAT_PATTERN); @@ -1519,7 +1520,7 @@ public class Calendar extends AbstractLegacyComponent @Override public TargetDetails translateDropTargetDetails( Map<String, Object> clientVariables) { - Map<String, Object> serverVariables = new HashMap<>(); + Map<String, Object> serverVariables = new HashMap<String, Object>(); if (clientVariables.containsKey("dropSlotIndex")) { int slotIndex = (Integer) clientVariables.get("dropSlotIndex"); @@ -1704,8 +1705,8 @@ public class Calendar extends AbstractLegacyComponent public void addActionHandler(Handler actionHandler) { if (actionHandler != null) { if (actionHandlers == null) { - actionHandlers = new LinkedList<>(); - actionMapper = new KeyMapper<>(); + actionHandlers = new LinkedList<Handler>(); + actionMapper = new KeyMapper<Action>(); } if (!actionHandlers.contains(actionHandler)) { actionHandlers.add(actionHandler); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java index f6a9d32d6b..8a9db41624 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/ComboBox.java @@ -672,7 +672,7 @@ public class ComboBox extends AbstractSelect protected List<?> getFilteredOptions() { if (!isFilteringNeeded()) { prevfilterstring = null; - filteredOptions = new LinkedList<>(getItemIds()); + filteredOptions = new LinkedList<Object>(getItemIds()); return filteredOptions; } @@ -689,7 +689,7 @@ public class ComboBox extends AbstractSelect } prevfilterstring = filterstring; - filteredOptions = new LinkedList<>(); + filteredOptions = new LinkedList<Object>(); for (final Iterator<?> it = items.iterator(); it.hasNext();) { final Object itemId = it.next(); String caption = getItemCaption(itemId); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/DateField.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/DateField.java index 16b0268354..33ca986fa1 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/DateField.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/DateField.java @@ -160,7 +160,7 @@ public class DateField extends AbstractField<Date> implements private TimeZone timeZone = null; - private static Map<Resolution, String> variableNameForResolution = new HashMap<>(); + private static Map<Resolution, String> variableNameForResolution = new HashMap<Resolution, String>(); private String dateOutOfRangeMessage = "Date is out of allowed range"; @@ -502,7 +502,7 @@ public class DateField extends AbstractField<Date> implements // Gets the new date in parts boolean hasChanges = false; - Map<Resolution, Integer> calendarFieldChanges = new HashMap<>(); + Map<Resolution, Integer> calendarFieldChanges = new HashMap<Resolution, Integer>(); for (Resolution r : Resolution .getResolutionsHigherOrEqualTo(resolution)) { 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 e0953a1eb4..c671caea93 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 @@ -98,7 +98,7 @@ public class Form extends AbstractField<Object> /** * Ordered list of property ids in this editor. */ - private final LinkedList<Object> propertyIds = new LinkedList<>(); + private final LinkedList<Object> propertyIds = new LinkedList<Object>(); /** * Current buffered source exception. @@ -113,12 +113,12 @@ public class Form extends AbstractField<Object> /** * Mapping from propertyName to corresponding field. */ - private final HashMap<Object, Field<?>> fields = new HashMap<>(); + private final HashMap<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<>(); + private final HashMap<Object, Property<?>> ownProperties = new HashMap<Object, Property<?>>(); /** * Field factory for this form. @@ -345,7 +345,7 @@ public class Form extends AbstractField<Object> } } catch (final Buffered.SourceException e) { if (problems == null) { - problems = new LinkedList<>(); + problems = new LinkedList<SourceException>(); } problems.add(e); } @@ -389,7 +389,7 @@ public class Form extends AbstractField<Object> fields.get(i.next()).discard(); } catch (final Buffered.SourceException e) { if (problems == null) { - problems = new LinkedList<>(); + problems = new LinkedList<SourceException>(); } problems.add(e); } @@ -1105,7 +1105,7 @@ public class Form extends AbstractField<Object> if (data instanceof Item) { item = (Item) data; } else if (data != null) { - item = new BeanItem<>(data); + item = new BeanItem<Object>(data); } // Sets the datasource to form @@ -1149,7 +1149,7 @@ public class Form extends AbstractField<Object> * the visibleProperties to set. */ public void setVisibleItemProperties(Object... visibleProperties) { - LinkedList<Object> v = new LinkedList<>(); + LinkedList<Object> v = new LinkedList<Object>(); for (int i = 0; i < visibleProperties.length; i++) { v.add(visibleProperties[i]); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java index 4b661d577c..207132f364 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java @@ -341,19 +341,19 @@ public class Grid extends AbstractComponent * client. Details components get destroyed once they scroll out of * view. */ - private final Map<Object, Component> itemIdToDetailsComponent = new HashMap<>(); + private final Map<Object, Component> itemIdToDetailsComponent = new HashMap<Object, Component>(); /** * Set of item ids that got <code>null</code> from DetailsGenerator when * {@link DetailsGenerator#getDetails(RowReference)} was called. */ - private final Set<Object> emptyDetails = new HashSet<>(); + private final Set<Object> emptyDetails = new HashSet<Object>(); /** * Set of item IDs for all open details rows. Contains even the ones * that are not currently visible on the client. */ - private final Set<Object> openDetails = new HashSet<>(); + private final Set<Object> openDetails = new HashSet<Object>(); public DetailComponentManager(Grid grid) { this(grid, DetailsGenerator.NULL); @@ -438,7 +438,7 @@ public class Grid extends AbstractComponent * Recreates all visible details components. */ public void refreshDetails() { - Set<Object> visibleItemIds = new HashSet<>( + Set<Object> visibleItemIds = new HashSet<Object>( itemIdToDetailsComponent.keySet()); for (Object itemId : visibleItemIds) { destroyDetails(itemId); @@ -572,7 +572,7 @@ public class Grid extends AbstractComponent @Override protected void bindFields() { - List<Field<?>> fields = new ArrayList<>(getFields()); + List<Field<?>> fields = new ArrayList<Field<?>>(getFields()); Item itemDataSource = getItemDataSource(); if (itemDataSource == null) { @@ -746,7 +746,7 @@ public class Grid extends AbstractComponent private CommitException cause; - private Set<Column> errorColumns = new HashSet<>(); + private Set<Column> errorColumns = new HashSet<Column>(); private String userErrorMessage; @@ -1408,7 +1408,7 @@ public class Grid extends AbstractComponent @Deprecated public static abstract class AbstractSelectionModel extends AbstractGridExtension implements SelectionModel, DataGenerator { - protected final LinkedHashSet<Object> selection = new LinkedHashSet<>(); + protected final LinkedHashSet<Object> selection = new LinkedHashSet<Object>(); @Override public boolean isSelected(final Object itemId) { @@ -1417,7 +1417,7 @@ public class Grid extends AbstractComponent @Override public Collection<Object> getSelectedRows() { - return new ArrayList<>(selection); + return new ArrayList<Object>(selection); } @Override @@ -1657,7 +1657,7 @@ public class Grid extends AbstractComponent @Override public void select(List<String> rowKeys) { - List<Object> items = new ArrayList<>(); + List<Object> items = new ArrayList<Object>(); for (String rowKey : rowKeys) { items.add(getItemId(rowKey)); } @@ -1666,7 +1666,7 @@ public class Grid extends AbstractComponent @Override public void deselect(List<String> rowKeys) { - List<Object> items = new ArrayList<>(); + List<Object> items = new ArrayList<Object>(); for (String rowKey : rowKeys) { items.add(getItemId(rowKey)); } @@ -1720,7 +1720,8 @@ public class Grid extends AbstractComponent final boolean selectionWillChange = !selection.containsAll(itemIds) && selection.size() < selectionLimit; if (selectionWillChange) { - final HashSet<Object> oldSelection = new HashSet<>(selection); + final HashSet<Object> oldSelection = new HashSet<Object>( + selection); if (selection.size() + itemIds.size() >= selectionLimit) { // Add one at a time if there's a risk of overflow Iterator<?> iterator = itemIds.iterator(); @@ -1807,7 +1808,8 @@ public class Grid extends AbstractComponent final boolean hasCommonElements = !Collections.disjoint(itemIds, selection); if (hasCommonElements) { - final HashSet<Object> oldSelection = new HashSet<>(selection); + final HashSet<Object> oldSelection = new HashSet<Object>( + selection); selection.removeAll(itemIds); fireSelectionEvent(oldSelection, selection); } @@ -1890,7 +1892,7 @@ public class Grid extends AbstractComponent checkItemIdsExist(itemIds); boolean changed = false; - Set<Object> selectedRows = new HashSet<>(itemIds); + Set<Object> selectedRows = new HashSet<Object>(itemIds); final Collection<Object> oldSelection = getSelectedRows(); Set<Object> added = getDifference(selectedRows, selection); if (!added.isEmpty()) { @@ -1931,7 +1933,7 @@ public class Grid extends AbstractComponent */ private static Set<Object> getDifference(Set<Object> set1, Set<Object> set2) { - Set<Object> diff = new HashSet<>(set1); + Set<Object> diff = new HashSet<Object>(set1); diff.removeAll(set2); return diff; } @@ -2311,8 +2313,8 @@ public class Grid extends AbstractComponent private RowState rowState = new RowState(); protected StaticSection<?> section; - private Map<Object, CELLTYPE> cells = new LinkedHashMap<>(); - private Map<Set<CELLTYPE>, CELLTYPE> cellGroups = new HashMap<>(); + private Map<Object, CELLTYPE> cells = new LinkedHashMap<Object, CELLTYPE>(); + private Map<Set<CELLTYPE>, CELLTYPE> cellGroups = new HashMap<Set<CELLTYPE>, CELLTYPE>(); protected StaticRow(StaticSection<?> section) { this.section = section; @@ -2397,7 +2399,7 @@ public class Grid extends AbstractComponent public CELLTYPE join(Object... propertyIds) { assert propertyIds.length > 1 : "You need to merge at least 2 properties"; - Set<CELLTYPE> cells = new HashSet<>(); + Set<CELLTYPE> cells = new HashSet<CELLTYPE>(); for (int i = 0; i < propertyIds.length; ++i) { cells.add(getCell(propertyIds[i])); } @@ -2415,7 +2417,7 @@ public class Grid extends AbstractComponent public CELLTYPE join(CELLTYPE... cells) { assert cells.length > 1 : "You need to merge at least 2 cells"; - return join(new HashSet<>(Arrays.asList(cells))); + return join(new HashSet<CELLTYPE>(Arrays.asList(cells))); } protected CELLTYPE join(Set<CELLTYPE> cells) { @@ -2432,7 +2434,7 @@ public class Grid extends AbstractComponent // Create new cell data for the group CELLTYPE newCell = createCell(); - Set<String> columnGroup = new HashSet<>(); + Set<String> columnGroup = new HashSet<String>(); for (CELLTYPE cell : cells) { columnGroup.add(cell.getColumnId()); } @@ -2481,7 +2483,7 @@ public class Grid extends AbstractComponent */ protected void writeDesign(Element trElement, DesignContext designContext) { - Set<CELLTYPE> visited = new HashSet<>(); + Set<CELLTYPE> visited = new HashSet<CELLTYPE>(); for (Grid.Column column : section.grid.getColumns()) { CELLTYPE cell = getCell(column.getPropertyId()); if (visited.contains(cell)) { @@ -2533,7 +2535,7 @@ public class Grid extends AbstractComponent int colspan = DesignAttributeHandler.readAttribute( "colspan", element.attributes(), 1, int.class); - Set<CELLTYPE> cells = new HashSet<>(); + Set<CELLTYPE> cells = new HashSet<CELLTYPE>(); for (int c = 0; c < colspan; ++c) { cells.add(getCell(section.grid.getColumns() .get(columnIndex + c).getPropertyId())); @@ -2774,7 +2776,7 @@ public class Grid extends AbstractComponent } protected Grid grid; - protected List<ROWTYPE> rows = new ArrayList<>(); + protected List<ROWTYPE> rows = new ArrayList<ROWTYPE>(); /** * Sets the visibility of the whole section. @@ -4517,17 +4519,17 @@ public class Grid extends AbstractComponent /** * Property id to column instance mapping */ - private final Map<Object, Column> columns = new HashMap<>(); + private final Map<Object, Column> columns = new HashMap<Object, Column>(); /** * Key generator for column server-to-client communication */ - private final KeyMapper<Object> columnKeys = new KeyMapper<>(); + private final KeyMapper<Object> columnKeys = new KeyMapper<Object>(); /** * The current sort order */ - private final List<SortOrder> sortOrder = new ArrayList<>(); + private final List<SortOrder> sortOrder = new ArrayList<SortOrder>(); /** * Property listener for listening to changes in data source properties. @@ -4540,7 +4542,7 @@ public class Grid extends AbstractComponent event.getContainer().getContainerPropertyIds()); // Find columns that need to be removed. - List<Column> removedColumns = new LinkedList<>(); + List<Column> removedColumns = new LinkedList<Column>(); for (Object propertyId : columns.keySet()) { if (!properties.contains(propertyId)) { removedColumns.add(getColumn(propertyId)); @@ -4556,7 +4558,7 @@ public class Grid extends AbstractComponent datasourceExtension.columnsRemoved(removedColumns); // Add new columns - List<Column> addedColumns = new LinkedList<>(); + List<Column> addedColumns = new LinkedList<Column>(); for (Object propertyId : properties) { if (!columns.containsKey(propertyId)) { addedColumns.add(appendColumn(propertyId)); @@ -4621,7 +4623,7 @@ public class Grid extends AbstractComponent * Poperty ID to Field mapping that stores editor fields set by * {@link #setEditorField(Object, Field)}. */ - private Map<Object, Field<?>> editorFields = new HashMap<>(); + private Map<Object, Field<?>> editorFields = new HashMap<Object, Field<?>>(); private CellStyleGenerator cellStyleGenerator; private RowStyleGenerator rowStyleGenerator; @@ -4643,7 +4645,7 @@ public class Grid extends AbstractComponent private DetailComponentManager detailComponentManager = null; - private Set<Component> extensionComponents = new HashSet<>(); + private Set<Component> extensionComponents = new HashSet<Component>(); private static final Method SELECTION_CHANGE_METHOD = ReflectTools .findMethod(SelectionListener.class, "select", @@ -4726,7 +4728,8 @@ public class Grid extends AbstractComponent boolean userOriginated) { assert columnIds.length == directions.length; - List<SortOrder> order = new ArrayList<>(columnIds.length); + List<SortOrder> order = new ArrayList<SortOrder>( + columnIds.length); for (int i = 0; i < columnIds.length; i++) { Object propertyId = getPropertyIdByColumnId(columnIds[i]); order.add(new SortOrder(propertyId, directions[i])); @@ -4922,7 +4925,7 @@ public class Grid extends AbstractComponent errorMessage = event.getUserErrorMessage(); - errorColumnIds = new ArrayList<>(); + errorColumnIds = new ArrayList<String>(); for (Column column : event.getErrorColumns()) { errorColumnIds.add(column.state.id); } @@ -5147,7 +5150,7 @@ public class Grid extends AbstractComponent * @return unmodifiable copy of current columns in visual order */ public List<Column> getColumns() { - List<Column> columns = new ArrayList<>(); + List<Column> columns = new ArrayList<Column>(); for (String columnId : getState(false).columnOrder) { columns.add(getColumnByColumnId(columnId)); } @@ -5190,7 +5193,7 @@ public class Grid extends AbstractComponent // Inform the data provider of this new column. Column column = getColumn(propertyId); - List<Column> addedColumns = new ArrayList<>(); + List<Column> addedColumns = new ArrayList<Column>(); addedColumns.add(column); datasourceExtension.columnsAdded(addedColumns); @@ -5255,8 +5258,8 @@ public class Grid extends AbstractComponent * Removes all columns from this Grid. */ public void removeAllColumns() { - List<Column> removed = new ArrayList<>(columns.values()); - Set<Object> properties = new HashSet<>(columns.keySet()); + List<Column> removed = new ArrayList<Column>(columns.values()); + Set<Object> properties = new HashSet<Object>(columns.keySet()); for (Object propertyId : properties) { removeColumn(propertyId); } @@ -5402,7 +5405,7 @@ public class Grid extends AbstractComponent "There is no column for given property id " + propertyId); } - List<Column> removed = new ArrayList<>(); + List<Column> removed = new ArrayList<Column>(); removed.add(getColumn(propertyId)); internalRemoveColumn(propertyId); datasourceExtension.columnsRemoved(removed); @@ -5435,12 +5438,12 @@ public class Grid extends AbstractComponent "The propertyIds array contains duplicates: " + SharedUtil.getDuplicates(propertyIds)); } - Set<?> removePids = new HashSet<>(columns.keySet()); + Set<?> removePids = new HashSet<Object>(columns.keySet()); removePids.removeAll(Arrays.asList(propertyIds)); for (Object removePid : removePids) { removeColumn(removePid); } - Set<?> addPids = new HashSet<>(Arrays.asList(propertyIds)); + Set<?> addPids = new HashSet<Object>(Arrays.asList(propertyIds)); addPids.removeAll(columns.keySet()); for (Object propertyId : addPids) { addColumn(propertyId); @@ -5462,7 +5465,7 @@ public class Grid extends AbstractComponent "The propertyIds array contains duplicates: " + SharedUtil.getDuplicates(propertyIds)); } - List<String> columnOrder = new ArrayList<>(); + List<String> columnOrder = new ArrayList<String>(); for (Object propertyId : propertyIds) { if (columns.containsKey(propertyId)) { columnOrder.add(columnKeys.key(propertyId)); @@ -6238,7 +6241,7 @@ public class Grid extends AbstractComponent getState().sortColumns = new String[] {}; getState(false).sortDirs = new SortDirection[] {}; } - fireEvent(new SortEvent(this, new ArrayList<>(sortOrder), + fireEvent(new SortEvent(this, new ArrayList<SortOrder>(sortOrder), userOriginated)); } else { throw new IllegalStateException( @@ -6579,7 +6582,7 @@ public class Grid extends AbstractComponent public Iterator<Component> iterator() { // This is a hash set to avoid adding header/footer components inside // merged cells multiple times - LinkedHashSet<Component> componentList = new LinkedHashSet<>(); + LinkedHashSet<Component> componentList = new LinkedHashSet<Component>(); Header header = getHeader(); for (int i = 0; i < header.getRowCount(); ++i) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/OptionGroup.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/OptionGroup.java index 667149d0e9..34090225ff 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/OptionGroup.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/OptionGroup.java @@ -50,7 +50,7 @@ import com.vaadin.v7.shared.ui.optiongroup.OptionGroupState; public class OptionGroup extends AbstractSelect implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier { - private Set<Object> disabledItemIds = new HashSet<>(); + private Set<Object> disabledItemIds = new HashSet<Object>(); public OptionGroup() { super(); 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 b8c649eba5..8b6ad8dbfb 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 @@ -389,57 +389,57 @@ public class Table extends AbstractSelect implements Action.Container, /** * Keymapper for column ids. */ - private final KeyMapper<Object> columnIdMap = new KeyMapper<>(); + private final KeyMapper<Object> columnIdMap = new KeyMapper<Object>(); /** * Holds visible column propertyIds - in order. */ - private LinkedList<Object> visibleColumns = new LinkedList<>(); + private LinkedList<Object> visibleColumns = new LinkedList<Object>(); /** * Holds noncollapsible columns. */ - private HashSet<Object> noncollapsibleColumns = new HashSet<>(); + private HashSet<Object> noncollapsibleColumns = new HashSet<Object>(); /** * Holds propertyIds of currently collapsed columns. */ - private final HashSet<Object> collapsedColumns = new HashSet<>(); + private final HashSet<Object> collapsedColumns = new HashSet<Object>(); /** * Holds headers for visible columns (by propertyId). */ - private final HashMap<Object, String> columnHeaders = new HashMap<>(); + private final HashMap<Object, String> columnHeaders = new HashMap<Object, String>(); /** * Holds footers for visible columns (by propertyId). */ - private final HashMap<Object, String> columnFooters = new HashMap<>(); + private final HashMap<Object, String> columnFooters = new HashMap<Object, String>(); /** * Holds icons for visible columns (by propertyId). */ - private final HashMap<Object, Resource> columnIcons = new HashMap<>(); + private final HashMap<Object, Resource> columnIcons = new HashMap<Object, Resource>(); /** * Holds alignments for visible columns (by propertyId). */ - private HashMap<Object, Align> columnAlignments = new HashMap<>(); + private HashMap<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<>(); + private final HashMap<Object, Integer> columnWidths = new HashMap<Object, Integer>(); /** * Holds column expand rations for visible columns (by propertyId). */ - private final HashMap<Object, Float> columnExpandRatios = new HashMap<>(); + private final HashMap<Object, Float> columnExpandRatios = new HashMap<Object, Float>(); /** * Holds column generators */ - private final HashMap<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<>(); + private final HashMap<Object, ColumnGenerator> columnGenerators = new LinkedHashMap<Object, ColumnGenerator>(); /** * Holds value of property pageLength. 0 disables paging. @@ -592,11 +592,11 @@ public class Table extends AbstractSelect implements Action.Container, private RowGenerator rowGenerator = null; - private final Map<Field<?>, Property<?>> associatedProperties = new HashMap<>(); + private final Map<Field<?>, Property<?>> associatedProperties = new HashMap<Field<?>, Property<?>>(); private boolean painted = false; - private HashMap<Object, Converter<String, Object>> propertyValueConverters = new HashMap<>(); + private HashMap<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 @@ -605,7 +605,7 @@ public class Table extends AbstractSelect implements Action.Container, */ private boolean keyMapperReset; - private List<Throwable> exceptionsDuringCachePopulation = new ArrayList<>(); + private List<Throwable> exceptionsDuringCachePopulation = new ArrayList<Throwable>(); private boolean isBeingPainted; @@ -689,7 +689,7 @@ public class Table extends AbstractSelect implements Action.Container, "Can not set visible columns to null value"); } - final LinkedList<Object> newVC = new LinkedList<>(); + final LinkedList<Object> newVC = new LinkedList<Object>(); // Checks that the new visible columns contains no nulls, properties // exist and that there are no duplicates before adding them to newVC. @@ -894,7 +894,7 @@ public class Table extends AbstractSelect implements Action.Container, } // Resets the alignments - final HashMap<Object, Align> newCA = new HashMap<>(); + final HashMap<Object, Align> newCA = new HashMap<Object, Align>(); int i = 0; for (final Iterator<Object> it = visibleColumns.iterator(); it.hasNext() && i < columnAlignments.length; i++) { @@ -1471,7 +1471,7 @@ public class Table extends AbstractSelect implements Action.Container, if (columnOrder == null || !isColumnReorderingAllowed()) { return; } - final LinkedList<Object> newOrder = new LinkedList<>(); + final LinkedList<Object> newOrder = new LinkedList<Object>(); for (int i = 0; i < columnOrder.length; i++) { if (columnOrder[i] != null && visibleColumns.contains(columnOrder[i])) { @@ -2202,8 +2202,8 @@ public class Table extends AbstractSelect implements Action.Container, if (replaceListeners) { // initialize the listener collections, this should only be done if // the entire cache is refreshed (through refreshRenderedCells) - listenedProperties = new HashSet<>(); - visibleComponents = new HashSet<>(); + listenedProperties = new HashSet<Property<?>>(); + visibleComponents = new HashSet<Component>(); } Object[][] cells = new Object[cols + CELL_FIRSTCOL][rows]; @@ -2644,7 +2644,7 @@ public class Table extends AbstractSelect implements Action.Container, throws UnsupportedOperationException { // remove generated columns from the list of columns being assigned - final LinkedList<Object> availableCols = new LinkedList<>(); + final LinkedList<Object> availableCols = new LinkedList<Object>(); for (Iterator<Object> it = visibleColumns.iterator(); it.hasNext();) { Object id = it.next(); if (!columnGenerators.containsKey(id)) { @@ -2735,7 +2735,7 @@ public class Table extends AbstractSelect implements Action.Container, } else { generated = Collections.emptyList(); } - List<Object> visibleIds = new ArrayList<>(); + List<Object> visibleIds = new ArrayList<Object>(); if (generated.isEmpty()) { visibleIds.addAll(newDataSource.getContainerPropertyIds()); } else { @@ -2777,7 +2777,7 @@ public class Table extends AbstractSelect implements Action.Container, newDataSource = new IndexedContainer(); } if (visibleIds == null) { - visibleIds = new ArrayList<>(); + visibleIds = new ArrayList<Object>(); } // Retain propertyValueConverters if their corresponding ids are @@ -2786,7 +2786,7 @@ public class Table extends AbstractSelect implements Action.Container, if (propertyValueConverters != null) { Collection<?> newPropertyIds = newDataSource .getContainerPropertyIds(); - LinkedList<Object> retainableValueConverters = new LinkedList<>(); + LinkedList<Object> retainableValueConverters = new LinkedList<Object>(); for (Object propertyId : newPropertyIds) { Converter<String, ?> converter = getConverter(propertyId); if (converter != null) { @@ -2819,7 +2819,7 @@ public class Table extends AbstractSelect implements Action.Container, } // don't add the same id twice - Collection<Object> col = new LinkedList<>(); + Collection<Object> col = new LinkedList<Object>(); for (Iterator<?> it = visibleIds.iterator(); it.hasNext();) { Object id = it.next(); if (!col.contains(id)) { @@ -2860,7 +2860,7 @@ public class Table extends AbstractSelect implements Action.Container, */ private LinkedHashSet<Object> getItemIdsInRange(Object itemId, final int length) { - LinkedHashSet<Object> ids = new LinkedHashSet<>(); + LinkedHashSet<Object> ids = new LinkedHashSet<Object>(); for (int i = 0; i < length; i++) { assert itemId != null; // should not be null unless client-server // are out of sync @@ -2883,7 +2883,7 @@ public class Table extends AbstractSelect implements Action.Container, Set<Object> renderedButNotSelectedItemIds = getCurrentlyRenderedItemIds(); @SuppressWarnings("unchecked") - HashSet<Object> newValue = new LinkedHashSet<>( + HashSet<Object> newValue = new LinkedHashSet<Object>( (Collection<Object>) getValue()); if (variables.containsKey("clearSelections")) { @@ -2938,7 +2938,7 @@ public class Table extends AbstractSelect implements Action.Container, } private Set<Object> getCurrentlyRenderedItemIds() { - HashSet<Object> ids = new HashSet<>(); + HashSet<Object> ids = new HashSet<Object>(); if (pageBuffer != null) { for (int i = 0; i < pageBuffer[CELL_ITEMID].length; i++) { ids.add(pageBuffer[CELL_ITEMID][i]); @@ -2971,7 +2971,7 @@ public class Table extends AbstractSelect implements Action.Container, if (!isSelectable() && variables.containsKey("selected")) { // Not-selectable is a special case, AbstractSelect does not support // TODO could be optimized. - variables = new HashMap<>(variables); + variables = new HashMap<String, Object>(variables); variables.remove("selected"); } @@ -2983,7 +2983,7 @@ public class Table extends AbstractSelect implements Action.Container, && variables.containsKey("selected") && multiSelectMode == MultiSelectMode.DEFAULT) { handleSelectedItems(variables); - variables = new HashMap<>(variables); + variables = new HashMap<String, Object>(variables); variables.remove("selected"); } @@ -3082,7 +3082,7 @@ public class Table extends AbstractSelect implements Action.Container, try { final Object[] ids = (Object[]) variables .get("collapsedcolumns"); - Set<Object> idSet = new HashSet<>(); + Set<Object> idSet = new HashSet<Object>(); for (Object id : ids) { idSet.add(columnIdMap.get(id.toString())); } @@ -3648,7 +3648,7 @@ public class Table extends AbstractSelect implements Action.Container, private void paintAvailableColumns(PaintTarget target) throws PaintException { if (columnCollapsingAllowed) { - final HashSet<Object> collapsedCols = new HashSet<>(); + final HashSet<Object> collapsedCols = new HashSet<Object>(); for (Object colId : visibleColumns) { if (isColumnCollapsed(colId)) { collapsedCols.add(colId); @@ -3772,7 +3772,7 @@ public class Table extends AbstractSelect implements Action.Container, private void paintVisibleColumnOrder(PaintTarget target) { // Visible column order - final ArrayList<String> visibleColOrder = new ArrayList<>(); + final ArrayList<String> visibleColOrder = new ArrayList<String>(); for (Object columnId : visibleColumns) { if (!isColumnCollapsed(columnId)) { visibleColOrder.add(columnIdMap.key(columnId)); @@ -3782,9 +3782,9 @@ public class Table extends AbstractSelect implements Action.Container, } private Set<Action> findAndPaintBodyActions(PaintTarget target) { - Set<Action> actionSet = new LinkedHashSet<>(); + Set<Action> actionSet = new LinkedHashSet<Action>(); if (actionHandlers != null) { - final ArrayList<String> keys = new ArrayList<>(); + final ArrayList<String> keys = new ArrayList<String>(); for (Handler ah : actionHandlers) { // Getting actions for the null item, which in this case means // the body item @@ -3846,7 +3846,7 @@ public class Table extends AbstractSelect implements Action.Container, } private String[] findSelectedKeys() { - LinkedList<String> selectedKeys = new LinkedList<>(); + LinkedList<String> selectedKeys = new LinkedList<String>(); if (isMultiSelect()) { HashSet<?> sel = new HashSet<Object>((Set<?>) getValue()); Collection<?> vids = getVisibleItemIds(); @@ -4002,7 +4002,7 @@ public class Table extends AbstractSelect implements Action.Container, // Actions if (actionHandlers != null) { - final ArrayList<String> keys = new ArrayList<>(); + final ArrayList<String> keys = new ArrayList<String>(); for (Handler ah : actionHandlers) { final Action[] aa = ah.getActions(itemId, this); if (aa != null) { @@ -4197,8 +4197,8 @@ public class Table extends AbstractSelect implements Action.Container, if (actionHandler != null) { if (actionHandlers == null) { - actionHandlers = new LinkedList<>(); - actionMapper = new KeyMapper<>(); + actionHandlers = new LinkedList<Handler>(); + actionMapper = new KeyMapper<Action>(); } if (!actionHandlers.contains(actionHandler)) { @@ -4534,7 +4534,7 @@ public class Table extends AbstractSelect implements Action.Container, @Override public Collection<?> getVisibleItemIds() { - final LinkedList<Object> visible = new LinkedList<>(); + final LinkedList<Object> visible = new LinkedList<Object>(); final Object[][] cells = getVisibleCells(); // may be null if the table has not been rendered yet (e.g. not attached @@ -4616,7 +4616,8 @@ public class Table extends AbstractSelect implements Action.Container, Collection<?> containerPropertyIds = getContainerDataSource() .getContainerPropertyIds(); - LinkedList<Object> newVisibleColumns = new LinkedList<>(visibleColumns); + LinkedList<Object> newVisibleColumns = new LinkedList<Object>( + visibleColumns); for (Iterator<Object> iterator = newVisibleColumns.iterator(); iterator .hasNext();) { Object id = iterator.next(); @@ -6179,7 +6180,7 @@ public class Table extends AbstractSelect implements Action.Container, if (colgroup != null) { int i = 0; - List<Object> pIds = new ArrayList<>(); + List<Object> pIds = new ArrayList<Object>(); for (Element col : colgroup.children()) { if (!col.tagName().equals("col")) { throw new DesignException("invalid column"); @@ -6281,7 +6282,7 @@ public class Table extends AbstractSelect implements Action.Container, return; } - Set<String> selected = new HashSet<>(); + Set<String> selected = new HashSet<String>(); for (Element tr : tbody.children()) { readItem(tr, selected, context); } 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 094dd1d5e4..67da52df51 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 @@ -122,12 +122,12 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Item icons alt texts. */ - private final HashMap<Object, String> itemIconAlts = new HashMap<>(); + private final HashMap<Object, String> itemIconAlts = new HashMap<Object, String>(); /** * Set of expanded nodes. */ - private HashSet<Object> expanded = new HashSet<>(); + private HashSet<Object> expanded = new HashSet<Object>(); /** * List of action handlers. @@ -375,7 +375,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, boolean result = true; // Initial stack - final Stack<Object> todo = new Stack<>(); + final Stack<Object> todo = new Stack<Object>(); todo.add(startItemId); // Expands recursively @@ -428,7 +428,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, boolean result = true; // Initial stack - final Stack<Object> todo = new Stack<>(); + final Stack<Object> todo = new Stack<Object>(); todo.add(startItemId); // Collapse recursively @@ -522,7 +522,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, if (!isSelectable() && variables.containsKey("selected")) { // Not-selectable is a special case, AbstractSelect does not support // TODO could be optimized. - variables = new HashMap<>(variables); + variables = new HashMap<String, Object>(variables); variables.remove("selected"); } @@ -561,7 +561,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, if (variables.containsKey("selected") && isMultiSelect() && multiSelectMode == MultiSelectMode.DEFAULT) { handleSelectedItems(variables); - variables = new HashMap<>(variables); + variables = new HashMap<String, Object>(variables); variables.remove("selected"); } @@ -595,7 +595,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, final String[] ka = (String[]) variables.get("selected"); // Converts the key-array to id-set - final LinkedList<Object> s = new LinkedList<>(); + final LinkedList<Object> s = new LinkedList<Object>(); for (int i = 0; i < ka.length; i++) { final Object id = itemIdMapper.get(ka[i]); if (!isNullSelectionAllowed() @@ -666,15 +666,15 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, } // Initialize variables - final Set<Action> actionSet = new LinkedHashSet<>(); + final Set<Action> actionSet = new LinkedHashSet<Action>(); // rendered selectedKeys - LinkedList<String> selectedKeys = new LinkedList<>(); + LinkedList<String> selectedKeys = new LinkedList<String>(); - final LinkedList<String> expandedKeys = new LinkedList<>(); + final LinkedList<String> expandedKeys = new LinkedList<String>(); // Iterates through hierarchical tree using a stack of iterators - final Stack<Iterator<?>> iteratorStack = new Stack<>(); + final Stack<Iterator<?>> iteratorStack = new Stack<Iterator<?>>(); Collection<?> ids; if (partialUpdate) { ids = getChildren(expandedItemId); @@ -691,7 +691,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<>(); + final ArrayList<String> keys = new ArrayList<String>(); for (Handler ah : actionHandlers) { // Getting action for the null item, which in this case @@ -780,7 +780,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, // Actions if (actionHandlers != null) { - final ArrayList<String> keys = new ArrayList<>(); + final ArrayList<String> keys = new ArrayList<String>(); final Iterator<Action.Handler> ahi = actionHandlers .iterator(); while (ahi.hasNext()) { @@ -1242,8 +1242,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, if (actionHandler != null) { if (actionHandlers == null) { - actionHandlers = new LinkedList<>(); - actionMapper = new KeyMapper<>(); + actionHandlers = new LinkedList<Handler>(); + actionMapper = new KeyMapper<Action>(); } if (!actionHandlers.contains(actionHandler)) { @@ -1291,10 +1291,10 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, @Override public Collection<?> getVisibleItemIds() { - final LinkedList<Object> visible = new LinkedList<>(); + final LinkedList<Object> visible = new LinkedList<Object>(); // Iterates trough hierarchical tree using a stack of iterators - final Stack<Iterator<?>> iteratorStack = new Stack<>(); + final Stack<Iterator<?>> iteratorStack = new Stack<Iterator<?>>(); final Collection<?> ids = rootItemIds(); if (ids != null) { iteratorStack.push(ids.iterator()); @@ -1844,7 +1844,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, } private void cleanupExpandedItems() { - Set<Object> removedItemIds = new HashSet<>(); + Set<Object> removedItemIds = new HashSet<Object>(); for (Object expandedItemId : expanded) { if (getItem(expandedItemId) == null) { removedItemIds.add(expandedItemId); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/TreeTable.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/TreeTable.java index e2fc9c28bf..8efdbed66c 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/TreeTable.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/TreeTable.java @@ -199,7 +199,7 @@ public class TreeTable extends Table implements Hierarchical { */ private class HierarchicalStrategy extends AbstractStrategy { - private final HashSet<Object> openItems = new HashSet<>(); + private final HashSet<Object> openItems = new HashSet<Object>(); @Override public boolean isNodeOpen(Object itemId) { @@ -286,7 +286,7 @@ public class TreeTable extends Table implements Hierarchical { */ private List<Object> getPreOrder() { if (preOrder == null) { - preOrder = new ArrayList<>(); + preOrder = new ArrayList<Object>(); Collection<?> rootItemIds = getContainerDataSource() .rootItemIds(); for (Object id : rootItemIds) { @@ -896,7 +896,7 @@ public class TreeTable extends Table implements Hierarchical { @Override protected List<Object> getItemIds(int firstIndex, int rows) { - List<Object> itemIds = new ArrayList<>(); + List<Object> itemIds = new ArrayList<Object>(); for (int i = firstIndex; i < firstIndex + rows; i++) { itemIds.add(getIdByIndex(i)); } @@ -910,8 +910,8 @@ public class TreeTable extends Table implements Hierarchical { return; } - Set<String> selected = new HashSet<>(); - Stack<Object> parents = new Stack<>(); + Set<String> selected = new HashSet<String>(); + Stack<Object> parents = new Stack<Object>(); int lastDepth = -1; for (Element tr : tbody.children()) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java index a1f987b55e..cf855b6868 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Upload.java @@ -802,7 +802,7 @@ public class Upload extends AbstractLegacyComponent */ public void addProgressListener(ProgressListener listener) { if (progressListeners == null) { - progressListeners = new LinkedHashSet<>(); + progressListeners = new LinkedHashSet<ProgressListener>(); } progressListeners.add(listener); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/ContainerEventProvider.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/ContainerEventProvider.java index 4f15272eb0..d00439cbb8 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/ContainerEventProvider.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/ContainerEventProvider.java @@ -37,7 +37,6 @@ import com.vaadin.v7.ui.components.calendar.event.CalendarEditableEventProvider; import com.vaadin.v7.ui.components.calendar.event.CalendarEvent; import com.vaadin.v7.ui.components.calendar.event.CalendarEvent.EventChangeListener; import com.vaadin.v7.ui.components.calendar.event.CalendarEvent.EventChangeNotifier; -import com.vaadin.v7.ui.components.calendar.event.CalendarEventProvider; import com.vaadin.v7.ui.components.calendar.event.CalendarEventProvider.EventSetChangeNotifier; /** @@ -85,14 +84,14 @@ public class ContainerEventProvider /** * Listeners attached to the container */ - private final List<EventSetChangeListener> eventSetChangeListeners = new LinkedList<>(); - private final List<EventChangeListener> eventChangeListeners = new LinkedList<>(); + private final List<EventSetChangeListener> eventSetChangeListeners = new LinkedList<EventSetChangeListener>(); + private final List<EventChangeListener> eventChangeListeners = new LinkedList<EventChangeListener>(); /** * The event cache contains the events previously created by * {@link #getEvents(Date, Date)} */ - private final List<CalendarEvent> eventCache = new LinkedList<>(); + private final List<CalendarEvent> eventCache = new LinkedList<CalendarEvent>(); /** * The container used as datasource diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/event/BasicEvent.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/event/BasicEvent.java index 3f899debd7..114e696058 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/event/BasicEvent.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/calendar/event/BasicEvent.java @@ -38,7 +38,7 @@ public class BasicEvent implements EditableCalendarEvent, EventChangeNotifier { private Date end; private Date start; private String styleName; - private transient List<EventChangeListener> listeners = new ArrayList<>(); + private transient List<EventChangeListener> listeners = new ArrayList<EventChangeListener>(); private boolean isAllDay; 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 2fa32f93e3..99383c165c 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 @@ -46,9 +46,9 @@ import com.vaadin.v7.ui.components.calendar.event.CalendarEventProvider.EventSet public class BasicEventProvider implements CalendarEditableEventProvider, EventSetChangeNotifier, CalendarEvent.EventChangeListener { - protected List<CalendarEvent> eventList = new ArrayList<>(); + protected List<CalendarEvent> eventList = new ArrayList<CalendarEvent>(); - private List<EventSetChangeListener> listeners = new ArrayList<>(); + private List<EventSetChangeListener> listeners = new ArrayList<EventSetChangeListener>(); /* * (non-Javadoc) @@ -59,7 +59,7 @@ public class BasicEventProvider implements CalendarEditableEventProvider, */ @Override public List<CalendarEvent> getEvents(Date startDate, Date endDate) { - ArrayList<CalendarEvent> activeEvents = new ArrayList<>(); + ArrayList<CalendarEvent> activeEvents = new ArrayList<CalendarEvent>(); for (CalendarEvent ev : eventList) { long from = startDate.getTime(); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java index 2278bde171..5ba0f2893e 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerGrid.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2016 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -27,12 +27,12 @@ import com.vaadin.v7.shared.ui.colorpicker.ColorPickerGridState; /** * A component that represents a color selection grid within a color picker. - * + * * @since 7.0.0 */ @Deprecated -public class ColorPickerGrid extends AbstractComponent implements - ColorSelector { +public class ColorPickerGrid extends AbstractComponent + implements ColorSelector { private static final String STYLENAME = "v-colorpicker-grid"; @@ -86,7 +86,7 @@ public class ColorPickerGrid extends AbstractComponent implements private Color[][] colorGrid = new Color[1][1]; /** The changed colors. */ - private final Map<Point, Color> changedColors = new HashMap<>(); + private final Map<Point, Color> changedColors = new HashMap<Point, Color>(); /** * Instantiates a new color picker grid. @@ -100,7 +100,7 @@ public class ColorPickerGrid extends AbstractComponent implements /** * Instantiates a new color picker grid. - * + * * @param rows * the rows * @param columns @@ -115,7 +115,7 @@ public class ColorPickerGrid extends AbstractComponent implements /** * Instantiates a new color picker grid. - * + * * @param colors * the colors */ @@ -164,7 +164,7 @@ public class ColorPickerGrid extends AbstractComponent implements /** * Sets the color grid. - * + * * @param colors * the new color grid */ @@ -185,7 +185,7 @@ public class ColorPickerGrid extends AbstractComponent implements /** * Adds a color change listener - * + * * @param listener * The color change listener */ @@ -201,7 +201,7 @@ public class ColorPickerGrid extends AbstractComponent implements /** * Removes a color change listener - * + * * @param listener * The listener */ @@ -220,7 +220,7 @@ public class ColorPickerGrid extends AbstractComponent implements /** * Sets the position. - * + * * @param x * the x * @param y @@ -235,7 +235,7 @@ public class ColorPickerGrid extends AbstractComponent implements /** * Gets the position. - * + * * @return the position */ public int[] getPosition() { @@ -244,7 +244,7 @@ public class ColorPickerGrid extends AbstractComponent implements /** * Notifies the listeners that a color change has occurred - * + * * @param color * The color which it changed to */ diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java index 111800b94f..40c0190ac6 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerHistory.java @@ -1,12 +1,12 @@ /* * Copyright 2000-2016 Vaadin Ltd. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -28,12 +28,12 @@ import com.vaadin.v7.shared.ui.colorpicker.Color; /** * A component that represents color selection history within a color picker. - * + * * @since 7.0.0 */ @Deprecated -public class ColorPickerHistory extends CustomComponent implements - ColorSelector, ColorChangeListener { +public class ColorPickerHistory extends CustomComponent + implements ColorSelector, ColorChangeListener { private static final String STYLENAME = "v-colorpicker-history"; @@ -56,7 +56,7 @@ public class ColorPickerHistory extends CustomComponent implements private static final int columns = 15; /** Temporary color history for when the component is detached. */ - private ArrayBlockingQueue<Color> tempHistory = new ArrayBlockingQueue<>( + private ArrayBlockingQueue<Color> tempHistory = new ArrayBlockingQueue<Color>( rows * columns); /** The grid. */ @@ -83,7 +83,7 @@ public class ColorPickerHistory extends CustomComponent implements } private void createColorHistoryIfNecessary() { - List<Color> tempColors = new ArrayList<>(tempHistory); + List<Color> tempColors = new ArrayList<Color>(tempHistory); if (getSession().getAttribute("colorPickerHistory") == null) { getSession().setAttribute("colorPickerHistory", new ArrayBlockingQueue<Color>(rows * columns)); @@ -97,8 +97,8 @@ public class ColorPickerHistory extends CustomComponent implements @SuppressWarnings("unchecked") private ArrayBlockingQueue<Color> getColorHistory() { if (isAttached()) { - Object colorHistory = getSession().getAttribute( - "colorPickerHistory"); + Object colorHistory = getSession() + .getAttribute("colorPickerHistory"); if (colorHistory instanceof ArrayBlockingQueue<?>) { return (ArrayBlockingQueue<Color>) colorHistory; } @@ -135,7 +135,7 @@ public class ColorPickerHistory extends CustomComponent implements } } - List<Color> colorList = new ArrayList<>(colorHistory); + List<Color> colorList = new ArrayList<Color>(colorHistory); // Invert order of colors Collections.reverse(colorList); @@ -168,7 +168,7 @@ public class ColorPickerHistory extends CustomComponent implements /** * Gets the history. - * + * * @return the history */ public List<Color> getHistory() { @@ -179,10 +179,10 @@ public class ColorPickerHistory extends CustomComponent implements /** * Checks if the history contains given color. - * + * * @param c * the color - * + * * @return true, if successful */ public boolean hasColor(Color c) { @@ -191,7 +191,7 @@ public class ColorPickerHistory extends CustomComponent implements /** * Adds a color change listener - * + * * @param listener * The listener */ @@ -202,7 +202,7 @@ public class ColorPickerHistory extends CustomComponent implements /** * Removes a color change listener - * + * * @param listener * The listener */ diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java index a6f35fa6f9..ff5334ea83 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java @@ -133,7 +133,7 @@ public class ColorPickerPopup extends Window private ColorPickerSelect colorSelect; /** The selectors. */ - private final Set<ColorSelector> selectors = new HashSet<>(); + private final Set<ColorSelector> selectors = new HashSet<ColorSelector>(); /** * Set true while the slider values are updated after colorChange. When @@ -211,7 +211,7 @@ public class ColorPickerPopup extends Window history.setHeight("22px"); // Create the default colors - List<Color> defaultColors = new ArrayList<>(); + List<Color> defaultColors = new ArrayList<Color>(); defaultColors.add(Color.BLACK); defaultColors.add(Color.WHITE); |