From 0cfb20938f2b15767ebbd367ad8312642b947c8c Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Fri, 24 Feb 2017 17:06:58 +0200 Subject: Revert diamond operator changes --- .../java/com/vaadin/server/GAEVaadinServlet.java | 4 +- .../java/com/vaadin/v7/data/ContainerHelpers.java | 2 +- .../vaadin/v7/data/fieldgroup/BeanFieldGroup.java | 6 +- .../com/vaadin/v7/data/fieldgroup/FieldGroup.java | 20 ++--- .../main/java/com/vaadin/v7/data/sort/Sort.java | 2 +- .../vaadin/v7/data/util/AbstractBeanContainer.java | 6 +- .../v7/data/util/AbstractInMemoryContainer.java | 6 +- .../com/vaadin/v7/data/util/AbstractProperty.java | 4 +- .../java/com/vaadin/v7/data/util/BeanItem.java | 10 +-- .../v7/data/util/ContainerHierarchicalWrapper.java | 22 +++--- .../v7/data/util/ContainerOrderedWrapper.java | 10 +-- .../com/vaadin/v7/data/util/DefaultItemSorter.java | 4 +- .../vaadin/v7/data/util/FilesystemContainer.java | 4 +- .../v7/data/util/GeneratedPropertyContainer.java | 20 ++--- .../vaadin/v7/data/util/HierarchicalContainer.java | 22 +++--- .../com/vaadin/v7/data/util/IndexedContainer.java | 30 ++++---- .../main/java/com/vaadin/v7/data/util/ListSet.java | 12 +-- .../vaadin/v7/data/util/NestedMethodProperty.java | 6 +- .../v7/data/util/NestedPropertyDescriptor.java | 4 +- .../com/vaadin/v7/data/util/PropertysetItem.java | 6 +- .../util/converter/DefaultConverterFactory.java | 2 +- .../data/util/sqlcontainer/CacheFlushNotifier.java | 6 +- .../vaadin/v7/data/util/sqlcontainer/RowItem.java | 2 +- .../v7/data/util/sqlcontainer/SQLContainer.java | 43 +++++------ .../connection/SimpleJDBCConnectionPool.java | 4 +- .../util/sqlcontainer/query/FreeformQuery.java | 2 +- .../data/util/sqlcontainer/query/TableQuery.java | 14 ++-- .../query/generator/DefaultSQLGenerator.java | 4 +- .../query/generator/StatementHelper.java | 4 +- .../query/generator/filter/QueryBuilder.java | 2 +- .../v7/data/validator/CompositeValidator.java | 4 +- .../java/com/vaadin/v7/event/SelectionEvent.java | 6 +- .../data/RpcDataProviderExtension.java | 20 ++--- .../main/java/com/vaadin/v7/ui/AbstractField.java | 4 +- .../main/java/com/vaadin/v7/ui/AbstractSelect.java | 36 ++++----- .../src/main/java/com/vaadin/v7/ui/Calendar.java | 21 +++--- .../src/main/java/com/vaadin/v7/ui/ComboBox.java | 4 +- .../src/main/java/com/vaadin/v7/ui/DateField.java | 4 +- .../src/main/java/com/vaadin/v7/ui/Form.java | 14 ++-- .../src/main/java/com/vaadin/v7/ui/Grid.java | 85 +++++++++++----------- .../main/java/com/vaadin/v7/ui/OptionGroup.java | 2 +- .../src/main/java/com/vaadin/v7/ui/Table.java | 85 +++++++++++----------- .../src/main/java/com/vaadin/v7/ui/Tree.java | 36 ++++----- .../src/main/java/com/vaadin/v7/ui/TreeTable.java | 10 +-- .../src/main/java/com/vaadin/v7/ui/Upload.java | 2 +- .../calendar/ContainerEventProvider.java | 7 +- .../ui/components/calendar/event/BasicEvent.java | 2 +- .../calendar/event/BasicEventProvider.java | 6 +- .../ui/components/colorpicker/ColorPickerGrid.java | 30 ++++---- .../components/colorpicker/ColorPickerHistory.java | 32 ++++---- .../components/colorpicker/ColorPickerPopup.java | 4 +- .../component/AbstractListenerMethodsTestBase.java | 2 +- .../java/com/vaadin/v7/tests/VaadinClasses.java | 2 +- .../vaadin/v7/tests/server/SerializationTest.java | 10 ++- .../calendar/ContainerDataSourceTest.java | 8 +- .../datefield/DateFieldConverterTest.java | 2 +- .../component/fieldgroup/FieldGroupTest.java | 3 +- .../grid/GridEditorMissingPropertyTest.java | 12 +-- .../server/components/ComboBoxValueChangeTest.java | 2 +- .../test/java/com/vaadin/v7/ui/ComboBoxTest.java | 2 +- 60 files changed, 376 insertions(+), 364 deletions(-) (limited to 'compatibility-server') diff --git a/compatibility-server/src/main/java/com/vaadin/server/GAEVaadinServlet.java b/compatibility-server/src/main/java/com/vaadin/server/GAEVaadinServlet.java index edf9f24256..6cc933e670 100644 --- a/compatibility-server/src/main/java/com/vaadin/server/GAEVaadinServlet.java +++ b/compatibility-server/src/main/java/com/vaadin/server/GAEVaadinServlet.java @@ -425,7 +425,7 @@ public class GAEVaadinServlet extends VaadinServlet { getLogger().log(Level.INFO, "Vaadin cleanup deleting {0} expired Vaadin sessions.", entities.size()); - List keys = new ArrayList<>(); + List keys = new ArrayList(); for (Entity e : entities) { keys.add(e.getKey()); } @@ -445,7 +445,7 @@ public class GAEVaadinServlet extends VaadinServlet { getLogger().log(Level.INFO, "Vaadin cleanup deleting {0} expired appengine sessions.", entities.size()); - List keys = new ArrayList<>(); + List keys = new ArrayList(); for (Entity e : entities) { keys.add(e.getKey()); } 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 1f324c86d7..bc5927318f 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 @@ -84,7 +84,7 @@ public class ContainerHelpers implements Serializable { endIndex = container.size(); } - ArrayList rangeOfIds = new ArrayList<>(); + ArrayList rangeOfIds = new ArrayList(); for (int i = startIndex; i < endIndex; i++) { Object idByIndex = container.getIdByIndex(i); if (idByIndex == null) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/BeanFieldGroup.java b/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/BeanFieldGroup.java index f5d70fbee0..986515ced8 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/BeanFieldGroup.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/BeanFieldGroup.java @@ -36,7 +36,7 @@ public class BeanFieldGroup extends FieldGroup { public BeanFieldGroup(Class beanType) { this.beanType = beanType; - this.defaultValidators = new HashMap<>(); + this.defaultValidators = new HashMap, BeanValidator>(); } @Override @@ -117,7 +117,7 @@ public class BeanFieldGroup extends FieldGroup { if (bean == null) { setItemDataSource((Item) null); } else { - setItemDataSource(new BeanItem<>(bean, beanType)); + setItemDataSource(new BeanItem(bean, beanType)); } } @@ -260,7 +260,7 @@ public class BeanFieldGroup extends FieldGroup { private static BeanFieldGroup createAndBindFields(T bean, Object objectWithMemberFields, boolean buffered) { @SuppressWarnings("unchecked") - BeanFieldGroup beanFieldGroup = new BeanFieldGroup<>( + BeanFieldGroup beanFieldGroup = new BeanFieldGroup( (Class) bean.getClass()); beanFieldGroup.setItemDataSource(bean); beanFieldGroup.setBuffered(buffered); 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 e2e6b64f32..a56703090f 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 @@ -61,9 +61,9 @@ public class FieldGroup implements Serializable { private boolean enabled = true; private boolean readOnly = false; - private HashMap> propertyIdToField = new HashMap<>(); - private LinkedHashMap, Object> fieldToPropertyId = new LinkedHashMap<>(); - private List commitHandlers = new ArrayList<>(); + private HashMap> propertyIdToField = new HashMap>(); + private LinkedHashMap, Object> fieldToPropertyId = new LinkedHashMap, Object>(); + private List commitHandlers = new ArrayList(); /** * The field factory used by builder methods. @@ -104,7 +104,7 @@ public class FieldGroup implements Serializable { /** * Binds all fields to the properties in the item in use. - * + * * @since 7.7.5 */ protected void bindFields() { @@ -303,7 +303,7 @@ public class FieldGroup implements Serializable { */ protected Property.Transactional wrapInTransactionalProperty( Property itemProperty) { - return new TransactionalPropertyWrapper<>(itemProperty); + return new TransactionalPropertyWrapper(itemProperty); } private void throwIfFieldIsNull(Field field, Object propertyId) { @@ -462,9 +462,9 @@ public class FieldGroup implements Serializable { */ public Collection getUnboundPropertyIds() { if (getItemDataSource() == null) { - return new ArrayList<>(); + return new ArrayList(); } - List unboundPropertyIds = new ArrayList<>(); + List unboundPropertyIds = new ArrayList(); unboundPropertyIds.addAll(getItemDataSource().getItemPropertyIds()); unboundPropertyIds.removeAll(propertyIdToField.keySet()); return unboundPropertyIds; @@ -517,7 +517,7 @@ public class FieldGroup implements Serializable { * commits succeeded */ private Map, InvalidValueException> commitFields() { - Map, InvalidValueException> invalidValueExceptions = new HashMap<>(); + Map, InvalidValueException> invalidValueExceptions = new HashMap, InvalidValueException>(); for (Field f : fieldToPropertyId.keySet()) { try { @@ -1112,7 +1112,7 @@ public class FieldGroup implements Serializable { return ((FieldGroupInvalidValueException) getCause()) .getInvalidFields(); } - return new HashMap<>(); + return new HashMap, InvalidValueException>(); } /** @@ -1254,7 +1254,7 @@ public class FieldGroup implements Serializable { */ protected static List getFieldsInDeclareOrder( Class searchClass) { - ArrayList memberFieldInOrder = new ArrayList<>(); + ArrayList memberFieldInOrder = new ArrayList(); while (searchClass != null) { for (java.lang.reflect.Field memberField : searchClass diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/sort/Sort.java b/compatibility-server/src/main/java/com/vaadin/v7/data/sort/Sort.java index 701c7d317e..e187033ed7 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/sort/Sort.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/sort/Sort.java @@ -141,7 +141,7 @@ public class Sort implements Serializable { ++count; } - List order = new ArrayList<>(count); + List order = new ArrayList(count); s = this; do { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractBeanContainer.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractBeanContainer.java index 809fbda644..70ce642456 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractBeanContainer.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractBeanContainer.java @@ -144,7 +144,7 @@ public abstract class AbstractBeanContainer * Maps all item ids in the container (including filtered) to their * corresponding BeanItem. */ - private final Map> itemIdToItem = new HashMap<>(); + private final Map> itemIdToItem = new HashMap>(); /** * The type of the beans in the container. @@ -196,7 +196,7 @@ public abstract class AbstractBeanContainer * @return created {@link BeanItem} or null if bean is null */ protected BeanItem createBeanItem(BEANTYPE bean) { - return bean == null ? null : new BeanItem<>(bean, model); + return bean == null ? null : new BeanItem(bean, model); } /** @@ -891,7 +891,7 @@ public abstract class AbstractBeanContainer .getPropertyDescriptors((Class) propertyType); for (String subPropertyId : pds.keySet()) { String qualifiedPropertyId = propertyId + "." + subPropertyId; - NestedPropertyDescriptor pd = new NestedPropertyDescriptor<>( + NestedPropertyDescriptor pd = new NestedPropertyDescriptor( qualifiedPropertyId, (Class) type); model.put(qualifiedPropertyId, pd); model.remove(propertyId); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractInMemoryContainer.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractInMemoryContainer.java index be33a0db21..2f7346d2db 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractInMemoryContainer.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractInMemoryContainer.java @@ -120,7 +120,7 @@ public abstract class AbstractInMemoryContainer filters = new HashSet<>(); + private Set filters = new HashSet(); /** * The item sorter which is used for sorting the container. @@ -671,7 +671,7 @@ public abstract class AbstractInMemoryContainer removedFilters = new LinkedList<>(); + List removedFilters = new LinkedList(); for (Iterator iterator = getFilters().iterator(); iterator .hasNext();) { Filter f = iterator.next(); @@ -760,7 +760,7 @@ public abstract class AbstractInMemoryContainer getSortablePropertyIds() { - LinkedList sortables = new LinkedList<>(); + LinkedList sortables = new LinkedList(); for (Object propertyId : getContainerPropertyIds()) { Class propertyType = getType(propertyId); if (Comparable.class.isAssignableFrom(propertyType) diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractProperty.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractProperty.java index 5574379122..86d6b85bc8 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractProperty.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/AbstractProperty.java @@ -113,7 +113,7 @@ public abstract class AbstractProperty implements Property, public void addReadOnlyStatusChangeListener( Property.ReadOnlyStatusChangeListener listener) { if (readOnlyStatusChangeListeners == null) { - readOnlyStatusChangeListeners = new LinkedList<>(); + readOnlyStatusChangeListeners = new LinkedList(); } readOnlyStatusChangeListeners.add(listener); } @@ -199,7 +199,7 @@ public abstract class AbstractProperty implements Property, @Override public void addValueChangeListener(ValueChangeListener listener) { if (valueChangeListeners == null) { - valueChangeListeners = new LinkedList<>(); + valueChangeListeners = new LinkedList(); } valueChangeListeners.add(listener); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/BeanItem.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/BeanItem.java index a286cdc3b2..28213d77dc 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/BeanItem.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/BeanItem.java @@ -187,7 +187,7 @@ public class BeanItem extends PropertysetItem { */ static LinkedHashMap> getPropertyDescriptors( final Class beanClass) { - final LinkedHashMap> pdMap = new LinkedHashMap<>(); + final LinkedHashMap> pdMap = new LinkedHashMap>(); // Try to introspect, if it fails, we just have an empty Item try { @@ -200,7 +200,7 @@ public class BeanItem extends PropertysetItem { final Method getMethod = pd.getReadMethod(); if ((getMethod != null) && getMethod.getDeclaringClass() != Object.class) { - VaadinPropertyDescriptor vaadinPropertyDescriptor = new MethodPropertyDescriptor<>( + VaadinPropertyDescriptor vaadinPropertyDescriptor = new MethodPropertyDescriptor( pd.getName(), pd.getPropertyType(), pd.getReadMethod(), pd.getWriteMethod()); pdMap.put(pd.getName(), vaadinPropertyDescriptor); @@ -224,7 +224,7 @@ public class BeanItem extends PropertysetItem { * not specified */ public void expandProperty(String propertyId, String... subPropertyIds) { - Set subPropertySet = new HashSet<>( + Set subPropertySet = new HashSet( Arrays.asList(subPropertyIds)); if (0 == subPropertyIds.length) { @@ -253,7 +253,7 @@ public class BeanItem extends PropertysetItem { */ public void addNestedProperty(String nestedPropertyId) { addItemProperty(nestedPropertyId, - new NestedMethodProperty<>(getBean(), nestedPropertyId)); + new NestedMethodProperty(getBean(), nestedPropertyId)); } /** @@ -275,7 +275,7 @@ public class BeanItem extends PropertysetItem { *

* Changing the bean will fire value change events for all properties of * type {@link MethodProperty} or {@link NestedMethodProperty}. - * + * * @param bean * The new bean to use for this item, not null */ 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 e5f1cba3ab..df0fd774a3 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 @@ -119,10 +119,10 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, // Create initial order if needed if (!hierarchical) { - noChildrenAllowed = new HashSet<>(); - parent = new Hashtable<>(); - children = new Hashtable<>(); - roots = new LinkedHashSet<>(container.getItemIds()); + noChildrenAllowed = new HashSet(); + parent = new Hashtable(); + children = new Hashtable>(); + roots = new LinkedHashSet(container.getItemIds()); } updateHierarchicalWrapper(); @@ -142,10 +142,10 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, // Recreate hierarchy and data structures if missing if (noChildrenAllowed == null || parent == null || children == null || roots == null) { - noChildrenAllowed = new HashSet<>(); - parent = new Hashtable<>(); - children = new Hashtable<>(); - roots = new LinkedHashSet<>(container.getItemIds()); + noChildrenAllowed = new HashSet(); + parent = new Hashtable(); + children = new Hashtable>(); + roots = new LinkedHashSet(container.getItemIds()); } // Check that the hierarchy is up-to-date @@ -158,7 +158,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, itemIds); // Calculate the set of all items in the hierarchy - final HashSet s = new HashSet<>(); + final HashSet s = new HashSet(); s.addAll(parent.keySet()); s.addAll(children.keySet()); s.addAll(roots); @@ -183,7 +183,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, Object[] array = roots.toArray(); Arrays.sort(array, basedOnOrderFromWrappedContainer); - roots = new LinkedHashSet<>(); + roots = new LinkedHashSet(); for (int i = 0; i < array.length; i++) { roots.add(array[i]); } @@ -476,7 +476,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, parent.put(itemId, newParentId); LinkedList pcl = children.get(newParentId); if (pcl == null) { - pcl = new LinkedList<>(); + pcl = new LinkedList(); children.put(newParentId, pcl); } pcl.add(itemId); 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 71e230b455..442dbbd233 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 @@ -216,12 +216,12 @@ public class ContainerOrderedWrapper implements Container.Ordered, if (next == null || first == null || last == null || prev == null) { first = null; last = null; - next = new Hashtable<>(); - prev = new Hashtable<>(); + next = new Hashtable(); + prev = new Hashtable(); } // Filter out all the missing items - final LinkedList l = new LinkedList<>(next.keySet()); + final LinkedList l = new LinkedList(next.keySet()); for (final Iterator i = l.iterator(); i.hasNext();) { final Object id = i.next(); if (!container.containsId(id)) { @@ -470,9 +470,9 @@ public class ContainerOrderedWrapper implements Container.Ordered, if (ordered) { return ((Container.Ordered) container).getItemIds(); } else if (first == null) { - return new ArrayList<>(); + return new ArrayList(); } else { - List itemIds = new ArrayList<>(); + List itemIds = new ArrayList(); itemIds.add(first); Object current = first; while (next.containsKey(current)) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/DefaultItemSorter.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/DefaultItemSorter.java index 7f1fe574c8..d3d587456e 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/DefaultItemSorter.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/DefaultItemSorter.java @@ -166,8 +166,8 @@ public class DefaultItemSorter implements ItemSorter { this.container = container; // Removes any non-sortable property ids - final List ids = new ArrayList<>(); - final List orders = new ArrayList<>(); + final List ids = new ArrayList(); + final List orders = new ArrayList(); final Collection sortable = container .getSortableContainerPropertyIds(); for (int i = 0; i < propertyId.length; i++) { diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/FilesystemContainer.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/FilesystemContainer.java index 06fb33a973..97c10eaed1 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/FilesystemContainer.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/FilesystemContainer.java @@ -81,7 +81,7 @@ public class FilesystemContainer implements Container.Hierarchical { static { - FILE_PROPERTIES = new ArrayList<>(); + FILE_PROPERTIES = new ArrayList(); FILE_PROPERTIES.add(PROPERTY_NAME); FILE_PROPERTIES.add(PROPERTY_ICON); FILE_PROPERTIES.add(PROPERTY_SIZE); @@ -441,7 +441,7 @@ public class FilesystemContainer implements Container.Hierarchical { public Collection getItemIds() { if (recursive) { - final Collection col = new ArrayList<>(); + final Collection col = new ArrayList(); for (int i = 0; i < roots.length; i++) { addItemIds(col, roots[i]); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/GeneratedPropertyContainer.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/GeneratedPropertyContainer.java index ac0c44d8f1..b66240175a 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/GeneratedPropertyContainer.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/GeneratedPropertyContainer.java @@ -71,7 +71,7 @@ public class GeneratedPropertyContainer extends AbstractContainer private Filterable filterableContainer = null; /* Removed properties which are hidden but not actually removed */ - private final Set removedProperties = new HashSet<>(); + private final Set removedProperties = new HashSet(); /** * Property implementation for generated properties @@ -150,7 +150,7 @@ public class GeneratedPropertyContainer extends AbstractContainer @Override public Collection getItemPropertyIds() { - Set wrappedProperties = new LinkedHashSet<>( + Set wrappedProperties = new LinkedHashSet( wrappedItem.getItemPropertyIds()); wrappedProperties.removeAll(removedProperties); wrappedProperties.addAll(propertyGenerators.keySet()); @@ -292,14 +292,14 @@ public class GeneratedPropertyContainer extends AbstractContainer @Deprecated public GeneratedPropertyContainer(Container.Indexed container) { wrappedContainer = container; - propertyGenerators = new HashMap<>(); + propertyGenerators = new HashMap>(); if (wrappedContainer instanceof Sortable) { sortableContainer = (Sortable) wrappedContainer; } if (wrappedContainer instanceof Filterable) { - activeFilters = new HashMap<>(); + activeFilters = new HashMap>(); filterableContainer = (Filterable) wrappedContainer; } else { activeFilters = null; @@ -383,7 +383,7 @@ public class GeneratedPropertyContainer extends AbstractContainer private Property createProperty(final Item item, final Object propertyId, final Object itemId, final PropertyValueGenerator generator) { - return new GeneratedProperty<>(item, propertyId, itemId, generator); + return new GeneratedProperty(item, propertyId, itemId, generator); } /* Listener functionality */ @@ -440,7 +440,7 @@ public class GeneratedPropertyContainer extends AbstractContainer "Wrapped container is not filterable"); } - List addedFilters = new ArrayList<>(); + List addedFilters = new ArrayList(); for (Entry> entry : propertyGenerators .entrySet()) { Object property = entry.getKey(); @@ -511,8 +511,8 @@ public class GeneratedPropertyContainer extends AbstractContainer return; } - List actualSortProperties = new ArrayList<>(); - List actualSortDirections = new ArrayList<>(); + List actualSortProperties = new ArrayList(); + List actualSortDirections = new ArrayList(); for (int i = 0; i < propertyId.length; ++i) { Object property = propertyId[i]; @@ -555,7 +555,7 @@ public class GeneratedPropertyContainer extends AbstractContainer return Collections.emptySet(); } - Set sortablePropertySet = new HashSet<>( + Set sortablePropertySet = new HashSet( sortableContainer.getSortableContainerPropertyIds()); for (Entry> entry : propertyGenerators .entrySet()) { @@ -632,7 +632,7 @@ public class GeneratedPropertyContainer extends AbstractContainer */ @Override public Collection getContainerPropertyIds() { - Set wrappedProperties = new LinkedHashSet<>( + Set wrappedProperties = new LinkedHashSet( wrappedContainer.getContainerPropertyIds()); wrappedProperties.removeAll(removedProperties); wrappedProperties.addAll(propertyGenerators.keySet()); 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 6bee45a616..e0b95bfe14 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 @@ -44,12 +44,12 @@ public class HierarchicalContainer extends IndexedContainer /** * Set of IDs of those contained Items that can't have children. */ - private final HashSet noChildrenAllowed = new HashSet<>(); + private final HashSet noChildrenAllowed = new HashSet(); /** * Mapping from Item ID to parent Item ID. */ - private final HashMap parent = new HashMap<>(); + private final HashMap parent = new HashMap(); /** * Mapping from Item ID to parent Item ID for items included in the filtered @@ -60,7 +60,7 @@ public class HierarchicalContainer extends IndexedContainer /** * Mapping from Item ID to a list of child IDs. */ - private final HashMap> children = new HashMap<>(); + private final HashMap> children = new HashMap>(); /** * Mapping from Item ID to a list of child IDs when filtered @@ -70,7 +70,7 @@ public class HierarchicalContainer extends IndexedContainer /** * List that contains all root elements of the container. */ - private final LinkedList roots = new LinkedList<>(); + private final LinkedList roots = new LinkedList(); /** * List that contains all filtered root elements of the container. @@ -325,7 +325,7 @@ public class HierarchicalContainer extends IndexedContainer if (pcl == null) { // Create an empty list for holding children if one were not // previously created - pcl = new LinkedList<>(); + pcl = new LinkedList(); children.put(newParentId, pcl); } pcl.add(itemId); @@ -712,14 +712,14 @@ public class HierarchicalContainer extends IndexedContainer } // Reset data structures - filteredRoots = new LinkedList<>(); - filteredChildren = new HashMap<>(); - filteredParent = new HashMap<>(); + filteredRoots = new LinkedList(); + filteredChildren = new HashMap>(); + filteredParent = new HashMap(); if (includeParentsWhenFiltering) { // Filter so that parents for items that match the filter are also // included - HashSet includedItems = new HashSet<>(); + HashSet includedItems = new HashSet(); for (Object rootId : roots) { if (filterIncludingParents(rootId, includedItems)) { filteredRoots.add(rootId); @@ -741,7 +741,7 @@ public class HierarchicalContainer extends IndexedContainer // match super.doFilterContainer(hasFilters); - LinkedHashSet filteredItemIds = new LinkedHashSet<>( + LinkedHashSet filteredItemIds = new LinkedHashSet( getItemIds()); for (Object itemId : filteredItemIds) { @@ -773,7 +773,7 @@ public class HierarchicalContainer extends IndexedContainer LinkedList parentToChildrenList = filteredChildren .get(parentItemId); if (parentToChildrenList == null) { - parentToChildrenList = new LinkedList<>(); + parentToChildrenList = new LinkedList(); filteredChildren.put(parentItemId, parentToChildrenList); } filteredParent.put(childItemId, parentItemId); 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 7a540cb04c..1e755f1a54 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 @@ -71,23 +71,23 @@ public class IndexedContainer /** * Linked list of ordered Property IDs. */ - private ArrayList propertyIds = new ArrayList<>(); + private ArrayList propertyIds = new ArrayList(); /** * Property ID to type mapping. */ - private Hashtable> types = new Hashtable<>(); + private Hashtable> types = new Hashtable>(); /** * Hash of Items, where each Item is implemented as a mapping from Property * ID to Property value. */ - private Hashtable> items = new Hashtable<>(); + private Hashtable> items = new Hashtable>(); /** * Set of properties that are read-only. */ - private HashSet> readOnlyProperties = new HashSet<>(); + private HashSet> readOnlyProperties = new HashSet>(); /** * List of all Property value change event listeners listening all the @@ -192,7 +192,7 @@ public class IndexedContainer } // store for next rows if (defaultPropertyValues == null) { - defaultPropertyValues = new HashMap<>(); + defaultPropertyValues = new HashMap(); } defaultPropertyValues.put(propertyId, defaultValue); } @@ -386,7 +386,7 @@ public class IndexedContainer @Override protected void registerNewItem(int index, Object newItemId, Item item) { - Hashtable t = new Hashtable<>(); + Hashtable t = new Hashtable(); items.put(newItemId, t); addDefaultValues(t); } @@ -479,7 +479,7 @@ public class IndexedContainer @Override public void addValueChangeListener(Property.ValueChangeListener listener) { if (propertyValueChangeListeners == null) { - propertyValueChangeListeners = new LinkedList<>(); + propertyValueChangeListeners = new LinkedList(); } propertyValueChangeListeners.add(listener); } @@ -590,19 +590,19 @@ public class IndexedContainer Object itemId, Property.ValueChangeListener listener) { if (listener != null) { if (singlePropertyValueChangeListeners == null) { - singlePropertyValueChangeListeners = new Hashtable<>(); + singlePropertyValueChangeListeners = new Hashtable>>(); } Map> propertySetToListenerListMap = singlePropertyValueChangeListeners .get(propertyId); if (propertySetToListenerListMap == null) { - propertySetToListenerListMap = new Hashtable<>(); + propertySetToListenerListMap = new Hashtable>(); singlePropertyValueChangeListeners.put(propertyId, propertySetToListenerListMap); } List listenerList = propertySetToListenerListMap .get(itemId); if (listenerList == null) { - listenerList = new LinkedList<>(); + listenerList = new LinkedList(); propertySetToListenerListMap.put(itemId, listenerList); } listenerList.add(listener); @@ -982,11 +982,15 @@ public class IndexedContainer ? (ListSet) ((ListSet) getAllItemIds()).clone() : null); nc.setItemSetChangeListeners(getItemSetChangeListeners() != null - ? new LinkedList<>(getItemSetChangeListeners()) : null); + ? new LinkedList( + getItemSetChangeListeners()) + : null); nc.propertyIds = propertyIds != null ? (ArrayList) propertyIds.clone() : null; nc.setPropertySetChangeListeners(getPropertySetChangeListeners() != null - ? new LinkedList<>(getPropertySetChangeListeners()) : null); + ? new LinkedList( + getPropertySetChangeListeners()) + : null); nc.propertyValueChangeListeners = propertyValueChangeListeners != null ? (LinkedList) propertyValueChangeListeners .clone() @@ -1012,7 +1016,7 @@ public class IndexedContainer if (items == null) { nc.items = null; } else { - nc.items = new Hashtable<>(); + nc.items = new Hashtable>(); for (final Iterator i = items.keySet().iterator(); i .hasNext();) { final Object id = i.next(); 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 7dbb40f1a0..4a6de4529b 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 @@ -40,22 +40,22 @@ public class ListSet extends ArrayList { * Contains a map from an element to the number of duplicates it has. Used * to temporarily allow duplicates in the list. */ - private HashMap duplicates = new HashMap<>(); + private HashMap duplicates = new HashMap(); public ListSet() { super(); - itemSet = new HashSet<>(); + itemSet = new HashSet(); } public ListSet(Collection c) { super(c); - itemSet = new HashSet<>(c.size()); + itemSet = new HashSet(c.size()); itemSet.addAll(c); } public ListSet(int initialCapacity) { super(initialCapacity); - itemSet = new HashSet<>(initialCapacity); + itemSet = new HashSet(initialCapacity); } // Delegate contains operations to the set @@ -185,7 +185,7 @@ public class ListSet extends ArrayList { @Override protected void removeRange(int fromIndex, int toIndex) { - HashSet toRemove = new HashSet<>(); + HashSet toRemove = new HashSet(); for (int idx = fromIndex; idx < toIndex; idx++) { toRemove.add(get(idx)); } @@ -270,7 +270,7 @@ public class ListSet extends ArrayList { @Override public Object clone() { ListSet v = (ListSet) super.clone(); - v.itemSet = new HashSet<>(itemSet); + v.itemSet = new HashSet(itemSet); return v; } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java index ab23d07551..de1561034c 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedMethodProperty.java @@ -125,7 +125,7 @@ public class NestedMethodProperty extends AbstractProperty { private void initialize(Class beanClass, String propertyName) throws IllegalArgumentException { - List getMethods = new ArrayList<>(); + List getMethods = new ArrayList(); String lastSimplePropertyName = propertyName; Class lastClass = beanClass; @@ -270,7 +270,7 @@ public class NestedMethodProperty extends AbstractProperty { /** * The instance used by this property - * + * * @return the instance used for fetching the property value */ public Object getInstance() { @@ -284,7 +284,7 @@ public class NestedMethodProperty extends AbstractProperty { *

* To be consistent with {@link #setValue(Object)}, this method will fire a * value change event even if the value stays the same - * + * * @param instance * the instance to use */ diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedPropertyDescriptor.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedPropertyDescriptor.java index e0c4e23d4b..a0cfae040c 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedPropertyDescriptor.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/NestedPropertyDescriptor.java @@ -50,7 +50,7 @@ public class NestedPropertyDescriptor public NestedPropertyDescriptor(String name, Class beanType) throws IllegalArgumentException { this.name = name; - NestedMethodProperty property = new NestedMethodProperty<>( + NestedMethodProperty property = new NestedMethodProperty( beanType, name); this.propertyType = property.getType(); } @@ -67,7 +67,7 @@ public class NestedPropertyDescriptor @Override public Property createProperty(BT bean) { - return new NestedMethodProperty<>(bean, name); + return new NestedMethodProperty(bean, name); } } 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 1725be692a..05a2b55ea7 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 @@ -45,12 +45,12 @@ public class PropertysetItem /** * Mapping from property id to property. */ - private HashMap> map = new HashMap<>(); + private HashMap> map = new HashMap>(); /** * List of all property ids to maintain the order. */ - private LinkedList list = new LinkedList<>(); + private LinkedList list = new LinkedList(); /** * List of property set modification listeners. @@ -205,7 +205,7 @@ public class PropertysetItem public void addPropertySetChangeListener( Item.PropertySetChangeListener listener) { if (propertySetChangeListeners == null) { - propertySetChangeListeners = new LinkedList<>(); + propertySetChangeListeners = new LinkedList(); } propertySetChangeListeners.add(listener); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/DefaultConverterFactory.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/DefaultConverterFactory.java index 6c8cdeb454..4f9fe0fc29 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/DefaultConverterFactory.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/DefaultConverterFactory.java @@ -58,7 +58,7 @@ public class DefaultConverterFactory implements ConverterFactory { if (reverseConverter != null) { log.finest(getClass().getName() + " created a reverse " + reverseConverter.getClass()); - return new ReverseConverter<>(reverseConverter); + return new ReverseConverter(reverseConverter); } log.finest(getClass().getName() + " could not find a converter for " diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/CacheFlushNotifier.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/CacheFlushNotifier.java index 6c6096a884..e858ae7f5a 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/CacheFlushNotifier.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/CacheFlushNotifier.java @@ -35,8 +35,8 @@ class CacheFlushNotifier implements Serializable { * SQLContainer instance reference list and dead reference queue. Used for * the cache flush notification feature. */ - private static List> allInstances = new ArrayList<>(); - private static ReferenceQueue deadInstances = new ReferenceQueue<>(); + private static List> allInstances = new ArrayList>(); + private static ReferenceQueue deadInstances = new ReferenceQueue(); /** * Adds the given SQLContainer to the cache flush notification receiver list @@ -47,7 +47,7 @@ class CacheFlushNotifier implements Serializable { public static void addInstance(SQLContainer c) { removeDeadReferences(); if (c != null) { - allInstances.add(new WeakReference<>(c, deadInstances)); + allInstances.add(new WeakReference(c, deadInstances)); } } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java index cf92fee19c..a0e7b7d993 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java @@ -75,7 +75,7 @@ public final class RowItem implements Item { @Override public Collection getItemPropertyIds() { - Collection ids = new ArrayList<>(properties.size()); + Collection ids = new ArrayList(properties.size()); for (ColumnProperty cp : properties) { ids.add(cp.getPropertyId()); } 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 408321bfff..f18940da8b 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 @@ -66,20 +66,20 @@ public class SQLContainer implements Container, Container.Filterable, private int cacheOverlap = pageLength; /** Item and index caches */ - private final Map itemIndexes = new HashMap<>(); - private final CacheMap cachedItems = new CacheMap<>(); + private final Map itemIndexes = new HashMap(); + private final CacheMap cachedItems = new CacheMap(); /** Container properties = column names, data types and statuses */ - private final List propertyIds = new ArrayList<>(); - private final Map> propertyTypes = new HashMap<>(); - private final Map propertyReadOnly = new HashMap<>(); - private final Map propertyPersistable = new HashMap<>(); - private final Map propertyNullable = new HashMap<>(); - private final Map propertyPrimaryKey = new HashMap<>(); + private final List propertyIds = new ArrayList(); + private final Map> propertyTypes = new HashMap>(); + private final Map propertyReadOnly = new HashMap(); + private final Map propertyPersistable = new HashMap(); + private final Map propertyNullable = new HashMap(); + private final Map propertyPrimaryKey = new HashMap(); /** Filters (WHERE) and sorters (ORDER BY) */ - private final List filters = new ArrayList<>(); - private final List sorters = new ArrayList<>(); + private final List filters = new ArrayList(); + private final List sorters = new ArrayList(); /** * Total number of items available in the data source using the current @@ -104,12 +104,12 @@ public class SQLContainer implements Container, Container.Filterable, /** * Temporary storage for modified items and items to be removed and added */ - private final Map removedItems = new HashMap<>(); - private final List addedItems = new ArrayList<>(); - private final List modifiedItems = new ArrayList<>(); + private final Map removedItems = new HashMap(); + private final List addedItems = new ArrayList(); + private final List modifiedItems = new ArrayList(); /** List of references to other SQLContainers */ - private final Map references = new HashMap<>(); + private final Map references = new HashMap(); /** Cache flush notification system enabled. Disabled by default. */ private boolean notificationsEnabled; @@ -157,7 +157,7 @@ public class SQLContainer implements Container, Container.Filterable, .size()]; RowId itemId = new TemporaryRowId(emptyKey); // Create new empty column properties for the row item. - List itemProperties = new ArrayList<>(); + List itemProperties = new ArrayList(); for (String propertyId : propertyIds) { /* Default settings for new item properties. */ ColumnProperty cp = new ColumnProperty(propertyId, @@ -307,7 +307,7 @@ public class SQLContainer implements Container, Container.Filterable, @Override public Collection getItemIds() { updateCount(); - ArrayList ids = new ArrayList<>(); + ArrayList ids = new ArrayList(); ResultSet rs = null; try { // Load ALL rows :( @@ -536,7 +536,7 @@ public class SQLContainer implements Container, Container.Filterable, * {@inheritDoc} */ public void removeContainerFilters(Object propertyId) { - ArrayList toRemove = new ArrayList<>(); + ArrayList toRemove = new ArrayList(); for (Filter f : filters) { if (f.appliesToProperty(propertyId)) { toRemove.add(f); @@ -1200,7 +1200,7 @@ public class SQLContainer implements Container, Container.Filterable, setPageLengthInternal(size); } while (rs.next()) { - List itemProperties = new ArrayList<>(); + List itemProperties = new ArrayList(); /* Generate row itemId based on primary key(s) */ Object[] itemId = new Object[pKeys.size()]; for (int i = 0; i < pKeys.size(); i++) { @@ -1212,7 +1212,8 @@ public class SQLContainer implements Container, Container.Filterable, } else { id = new RowId(itemId); } - List propertiesToAdd = new ArrayList<>(propertyIds); + List propertiesToAdd = new ArrayList( + propertyIds); if (!removedItems.containsKey(id)) { for (int i = 1; i <= rsmd.getColumnCount(); i++) { if (!isColumnIdentifierValid(rsmd.getColumnLabel(i))) { @@ -1315,7 +1316,7 @@ public class SQLContainer implements Container, Container.Filterable, } private List getFilteredAddedItems() { - ArrayList filtered = new ArrayList<>(addedItems); + ArrayList filtered = new ArrayList(addedItems); if (filters != null && !filters.isEmpty()) { for (RowItem item : addedItems) { if (!itemPassesFilters(item)) { @@ -1418,7 +1419,7 @@ public class SQLContainer implements Container, Container.Filterable, public void addItemSetChangeListener( Container.ItemSetChangeListener listener) { if (itemSetChangeListeners == null) { - itemSetChangeListeners = new LinkedList<>(); + itemSetChangeListeners = new LinkedList(); } itemSetChangeListeners.add(listener); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java index 524bca2de9..b9f46fec94 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java @@ -86,8 +86,8 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool { } private void initializeConnections() throws SQLException { - availableConnections = new HashSet<>(initialConnections); - reservedConnections = new HashSet<>(initialConnections); + availableConnections = new HashSet(initialConnections); + reservedConnections = new HashSet(initialConnections); for (int i = 0; i < initialConnections; i++) { availableConnections.add(createConnection()); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java index 078ec637a8..caa4c9f6bd 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/FreeformQuery.java @@ -69,7 +69,7 @@ public class FreeformQuery extends AbstractTransactionalQuery JDBCConnectionPool connectionPool) { super(connectionPool); if (primaryKeyColumns == null) { - primaryKeyColumns = new ArrayList<>(); + primaryKeyColumns = new ArrayList(); } if (primaryKeyColumns.contains("")) { throw new IllegalArgumentException( 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 dcd0258f49..7356801550 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 @@ -80,7 +80,7 @@ public class TableQuery extends AbstractTransactionalQuery /** Row ID change listeners */ private LinkedList rowIdChangeListeners; /** Row ID change events, stored until commit() is called */ - private final List bufferedEvents = new ArrayList<>(); + private final List bufferedEvents = new ArrayList(); /** Set to true to output generated SQL Queries to System.out */ private final boolean debug = false; @@ -230,7 +230,7 @@ public class TableQuery extends AbstractTransactionalQuery * first primary key column. */ if (orderBys == null || orderBys.isEmpty()) { - List ob = new ArrayList<>(); + List ob = new ArrayList(); for (int i = 0; i < primaryKeyColumns.size(); i++) { ob.add(new OrderBy(primaryKeyColumns.get(i), true)); } @@ -573,7 +573,7 @@ public class TableQuery extends AbstractTransactionalQuery } tables.close(); rs = dbmd.getPrimaryKeys(catalogName, schemaName, tableName); - List names = new ArrayList<>(); + List names = new ArrayList(); while (rs.next()) { names.add(rs.getString("COLUMN_NAME")); } @@ -618,7 +618,7 @@ public class TableQuery extends AbstractTransactionalQuery private RowId getNewRowId(RowItem row, ResultSet genKeys) { try { /* Fetch primary key values and generate a map out of them. */ - Map values = new HashMap<>(); + Map values = new HashMap(); ResultSetMetaData rsmd = genKeys.getMetaData(); int colCount = rsmd.getColumnCount(); if (genKeys.next()) { @@ -627,7 +627,7 @@ public class TableQuery extends AbstractTransactionalQuery } } /* Generate new RowId */ - List newRowId = new ArrayList<>(); + List newRowId = new ArrayList(); if (values.size() == 1) { if (primaryKeyColumns.size() == 1) { newRowId.add(values.get(values.keySet().iterator().next())); @@ -677,7 +677,7 @@ public class TableQuery extends AbstractTransactionalQuery @Override public boolean containsRowWithKey(Object... keys) throws SQLException { - ArrayList filtersAndKeys = new ArrayList<>(); + ArrayList filtersAndKeys = new ArrayList(); if (filters != null) { filtersAndKeys.addAll(filters); } @@ -757,7 +757,7 @@ public class TableQuery extends AbstractTransactionalQuery @Override public void addRowIdChangeListener(RowIdChangeListener listener) { if (rowIdChangeListeners == null) { - rowIdChangeListeners = new LinkedList<>(); + rowIdChangeListeners = new LinkedList(); } rowIdChangeListeners.add(listener); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java index b1f4dd011d..37b0b15b27 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java @@ -328,7 +328,7 @@ public class DefaultSQLGenerator implements SQLGenerator { } protected Map generateColumnToValueMap(RowItem item) { - Map columnToValueMap = new HashMap<>(); + Map columnToValueMap = new HashMap(); for (Object id : item.getItemPropertyIds()) { ColumnProperty cp = (ColumnProperty) item.getItemProperty(id); /* Prevent "rownum" usage as a column name if MSSQL or ORACLE */ @@ -345,7 +345,7 @@ public class DefaultSQLGenerator implements SQLGenerator { } protected Map generateRowIdentifiers(RowItem item) { - Map rowIdentifiers = new HashMap<>(); + Map rowIdentifiers = new HashMap(); for (Object id : item.getItemPropertyIds()) { ColumnProperty cp = (ColumnProperty) item.getItemProperty(id); /* Prevent "rownum" usage as a column name if MSSQL or ORACLE */ diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/StatementHelper.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/StatementHelper.java index 42bd3c6700..ad54208fa5 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/StatementHelper.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/StatementHelper.java @@ -42,8 +42,8 @@ public class StatementHelper implements Serializable { private String queryString; - private List parameters = new ArrayList<>(); - private Map> dataTypes = new HashMap<>(); + private List parameters = new ArrayList(); + private Map> dataTypes = new HashMap>(); public StatementHelper() { } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java index 608f0597dc..26effae012 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java @@ -26,7 +26,7 @@ import com.vaadin.v7.data.util.sqlcontainer.query.generator.StatementHelper; @Deprecated public class QueryBuilder implements Serializable { - private static ArrayList filterTranslators = new ArrayList<>(); + private static ArrayList filterTranslators = new ArrayList(); private static StringDecorator stringDecorator = new StringDecorator("\"", "\""); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/validator/CompositeValidator.java b/compatibility-server/src/main/java/com/vaadin/v7/data/validator/CompositeValidator.java index 006a14fabd..eac5b3152f 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/validator/CompositeValidator.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/validator/CompositeValidator.java @@ -74,7 +74,7 @@ public class CompositeValidator implements Validator { /** * List of contained validators. */ - private final List validators = new LinkedList<>(); + private final List validators = new LinkedList(); /** * Construct a composite validator in AND mode without error @@ -240,7 +240,7 @@ public class CompositeValidator implements Validator { return null; } - final HashSet found = new HashSet<>(); + final HashSet found = new HashSet(); for (Validator v : validators) { if (validatorType.isAssignableFrom(v.getClass())) { found.add(v); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/event/SelectionEvent.java b/compatibility-server/src/main/java/com/vaadin/v7/event/SelectionEvent.java index b2378b01f1..01fb94b879 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/event/SelectionEvent.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/event/SelectionEvent.java @@ -38,8 +38,8 @@ public class SelectionEvent extends EventObject { public SelectionEvent(Object source, Collection oldSelection, Collection newSelection) { super(source); - this.oldSelection = new LinkedHashSet<>(oldSelection); - this.newSelection = new LinkedHashSet<>(newSelection); + this.oldSelection = new LinkedHashSet(oldSelection); + this.newSelection = new LinkedHashSet(newSelection); } /** @@ -80,7 +80,7 @@ public class SelectionEvent extends EventObject { if (set2.isEmpty()) { return set1; } else { - LinkedHashSet set = new LinkedHashSet<>(set1); + LinkedHashSet set = new LinkedHashSet(set1); set.removeAll(set2); return set; } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/server/communication/data/RpcDataProviderExtension.java b/compatibility-server/src/main/java/com/vaadin/v7/server/communication/data/RpcDataProviderExtension.java index bc3c81a17a..b0c1b5ed21 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/server/communication/data/RpcDataProviderExtension.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/server/communication/data/RpcDataProviderExtension.java @@ -72,9 +72,9 @@ public class RpcDataProviderExtension extends AbstractExtension { */ private class ActiveItemHandler implements Serializable, DataGenerator { - private final Map activeItemMap = new HashMap<>(); - private final KeyMapper keyMapper = new KeyMapper<>(); - private final Set droppedItems = new HashSet<>(); + private final Map activeItemMap = new HashMap(); + private final KeyMapper keyMapper = new KeyMapper(); + private final Set droppedItems = new HashSet(); /** * Registers ValueChangeListeners for given item ids. @@ -118,7 +118,7 @@ public class RpcDataProviderExtension extends AbstractExtension { * @return collection of item ids */ public Collection getActiveItemIds() { - return new HashSet<>(activeItemMap.keySet()); + return new HashSet(activeItemMap.keySet()); } /** @@ -127,7 +127,7 @@ public class RpcDataProviderExtension extends AbstractExtension { * @return collection of value change listeners */ public Collection getValueChangeListeners() { - return new HashSet<>(activeItemMap.values()); + return new HashSet(activeItemMap.values()); } @Override @@ -245,7 +245,7 @@ public class RpcDataProviderExtension extends AbstractExtension { else { // Remove obsolete value change listeners. - Set keySet = new HashSet<>( + Set keySet = new HashSet( activeItemHandler.activeItemMap.keySet()); for (Object itemId : keySet) { activeItemHandler.removeListener(itemId); @@ -273,7 +273,7 @@ public class RpcDataProviderExtension extends AbstractExtension { /** Size possibly changed with a bare ItemSetChangeEvent */ private boolean bareItemSetTriggeredSizeChange = false; - private final Set dataGenerators = new LinkedHashSet<>(); + private final Set dataGenerators = new LinkedHashSet(); private final ActiveItemHandler activeItemHandler = new ActiveItemHandler(); @@ -458,7 +458,7 @@ public class RpcDataProviderExtension extends AbstractExtension { */ private void insertRowData(final int index, final int count) { if (rowChanges == null) { - rowChanges = new ArrayList<>(); + rowChanges = new ArrayList(); } if (rowChanges.isEmpty()) { @@ -491,7 +491,7 @@ public class RpcDataProviderExtension extends AbstractExtension { */ private void removeRowData(final int index, final int count) { if (rowChanges == null) { - rowChanges = new ArrayList<>(); + rowChanges = new ArrayList(); } if (rowChanges.isEmpty()) { @@ -516,7 +516,7 @@ public class RpcDataProviderExtension extends AbstractExtension { */ public void updateRowData(Object itemId) { if (updatedItemIds == null) { - updatedItemIds = new LinkedHashSet<>(); + updatedItemIds = new LinkedHashSet(); } if (updatedItemIds.isEmpty()) { 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 extends AbstractLegacyComponent @Override public void addValidator(Validator validator) { if (validators == null) { - validators = new LinkedList<>(); + validators = new LinkedList(); } validators.add(validator); markAsDirty(); @@ -962,7 +962,7 @@ public abstract class AbstractField extends AbstractLegacyComponent } } - List validationExceptions = new ArrayList<>(); + List validationExceptions = new ArrayList(); 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 implements /** * Keymapper used to map key values. */ - protected KeyMapper itemIdMapper = new KeyMapper<>(); + protected KeyMapper itemIdMapper = new KeyMapper(); /** * Item icons. */ - private final HashMap itemIcons = new HashMap<>(); + private final HashMap itemIcons = new HashMap(); /** * Item captions. */ - private final HashMap itemCaptions = new HashMap<>(); + private final HashMap itemCaptions = new HashMap(); /** * Item caption mode. @@ -471,7 +471,7 @@ public abstract class AbstractSelect extends AbstractField implements // TODO Optimize by adding repaintNotNeeded when applicable // Converts the key-array to id-set - final LinkedList acceptedSelections = new LinkedList<>(); + final LinkedList acceptedSelections = new LinkedList(); 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 implements @SuppressWarnings("unchecked") Set newsel = (Set) getValue(); if (newsel == null) { - newsel = new LinkedHashSet<>(); + newsel = new LinkedHashSet(); } else { - newsel = new LinkedHashSet<>(newsel); + newsel = new LinkedHashSet(newsel); } newsel.removeAll(visibleNotSelected); newsel.addAll(acceptedSelections); @@ -657,14 +657,14 @@ public abstract class AbstractSelect extends AbstractField implements // If the return value is not a set if (retValue == null) { - return new HashSet<>(); + return new HashSet(); } if (retValue instanceof Set) { return Collections.unmodifiableSet((Set) retValue); } else if (retValue instanceof Collection) { return new HashSet((Collection) retValue); } else { - final Set s = new HashSet<>(); + final Set s = new HashSet(); if (items.containsId(retValue)) { s.add(retValue); } @@ -722,7 +722,7 @@ public abstract class AbstractSelect extends AbstractField implements ConversionException, InvalidValueException { if (isMultiSelect()) { if (newFieldValue == null) { - super.setValue(new LinkedHashSet<>(), repaintIsNotNeeded, + super.setValue(new LinkedHashSet(), repaintIsNotNeeded, ignoreReadOnly); } else if (Collection.class .isAssignableFrom(newFieldValue.getClass())) { @@ -974,7 +974,7 @@ public abstract class AbstractSelect extends AbstractField implements if (isMultiSelect()) { Collection valueAsCollection = (Collection) value; - List newSelection = new ArrayList<>( + List newSelection = new ArrayList( valueAsCollection.size()); for (Object subValue : valueAsCollection) { if (containsId(subValue)) { @@ -1125,7 +1125,7 @@ public abstract class AbstractSelect extends AbstractField implements // Convert the value type if (multiSelect) { - final Set s = new HashSet<>(); + final Set s = new HashSet(); if (oldValue != null) { s.add(oldValue); } @@ -1530,7 +1530,7 @@ public abstract class AbstractSelect extends AbstractField implements setValue(itemId); } else if (!isSelected(itemId) && itemId != null && items.containsId(itemId)) { - final Set s = new HashSet<>((Set) getValue()); + final Set s = new HashSet((Set) getValue()); s.add(itemId); setValue(s); } @@ -1548,7 +1548,7 @@ public abstract class AbstractSelect extends AbstractField implements public void unselect(Object itemId) { if (isSelected(itemId)) { if (isMultiSelect()) { - final Set s = new HashSet<>((Set) getValue()); + final Set s = new HashSet((Set) getValue()); s.remove(itemId); setValue(s); } else { @@ -1577,7 +1577,7 @@ public abstract class AbstractSelect extends AbstractField implements public void addPropertySetChangeListener( Container.PropertySetChangeListener listener) { if (propertySetEventListeners == null) { - propertySetEventListeners = new LinkedHashSet<>(); + propertySetEventListeners = new LinkedHashSet(); } propertySetEventListeners.add(listener); } @@ -1627,7 +1627,7 @@ public abstract class AbstractSelect extends AbstractField implements public void addItemSetChangeListener( Container.ItemSetChangeListener listener) { if (itemSetEventListeners == null) { - itemSetEventListeners = new LinkedHashSet<>(); + itemSetEventListeners = new LinkedHashSet(); } itemSetEventListeners.add(listener); } @@ -1914,7 +1914,7 @@ public abstract class AbstractSelect extends AbstractField implements // TODO clean this up - type is either Item.PropertySetChangeNotifier or // Property.ValueChangeNotifier - HashSet captionChangeNotifiers = new HashSet<>(); + HashSet captionChangeNotifiers = new HashSet(); public void addNotifierForItem(Object itemId) { switch (getItemCaptionMode()) { @@ -2038,7 +2038,7 @@ public abstract class AbstractSelect extends AbstractField implements */ private static abstract class AbstractItemSetCriterion extends ClientSideCriterion { - protected final Collection itemIds = new HashSet<>(); + protected final Collection itemIds = new HashSet(); protected AbstractSelect select; public AbstractItemSetCriterion(AbstractSelect select, @@ -2213,7 +2213,7 @@ public abstract class AbstractSelect extends AbstractField implements } protected void readItems(Element design, DesignContext context) { - Set selected = new HashSet<>(); + Set selected = new HashSet(); 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(); setDefaultHandlers(); currentCalendar.setTime(new Date()); setEventProvider(eventProvider); @@ -467,7 +467,7 @@ public class Calendar extends AbstractLegacyComponent events = getEventProvider().getEvents(firstDateToShow, lastDateToShow); cacheMinMaxTimeOfDay(events); - List calendarStateEvents = new ArrayList<>(); + List calendarStateEvents = new ArrayList(); 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> actionMap = new HashMap<>(); + Map> actionMap = new HashMap>(); - List days = new ArrayList<>(); + List days = new ArrayList(); // 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 actionSet = new LinkedHashSet<>( + Set actionSet = new LinkedHashSet( 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 actionSet = new LinkedHashSet<>(Arrays.asList(actions)); + Set actionSet = new LinkedHashSet( + Arrays.asList(actions)); actionMap.put(range, actionSet); } } @@ -730,7 +731,7 @@ public class Calendar extends AbstractLegacyComponent return null; } - List calendarActions = new ArrayList<>(); + List calendarActions = new ArrayList(); SimpleDateFormat formatter = new SimpleDateFormat( DateConstants.ACTION_DATE_FORMAT_PATTERN); @@ -1519,7 +1520,7 @@ public class Calendar extends AbstractLegacyComponent @Override public TargetDetails translateDropTargetDetails( Map clientVariables) { - Map serverVariables = new HashMap<>(); + Map serverVariables = new HashMap(); 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(); + actionMapper = new KeyMapper(); } 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(getItemIds()); return filteredOptions; } @@ -689,7 +689,7 @@ public class ComboBox extends AbstractSelect } prevfilterstring = filterstring; - filteredOptions = new LinkedList<>(); + filteredOptions = new LinkedList(); 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 implements private TimeZone timeZone = null; - private static Map variableNameForResolution = new HashMap<>(); + private static Map variableNameForResolution = new HashMap(); private String dateOutOfRangeMessage = "Date is out of allowed range"; @@ -502,7 +502,7 @@ public class DateField extends AbstractField implements // Gets the new date in parts boolean hasChanges = false; - Map calendarFieldChanges = new HashMap<>(); + Map calendarFieldChanges = new HashMap(); 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 /** * Ordered list of property ids in this editor. */ - private final LinkedList propertyIds = new LinkedList<>(); + private final LinkedList propertyIds = new LinkedList(); /** * Current buffered source exception. @@ -113,12 +113,12 @@ public class Form extends AbstractField /** * Mapping from propertyName to corresponding field. */ - private final HashMap> fields = new HashMap<>(); + private final HashMap> fields = new HashMap>(); /** * Form may act as an Item, its own properties are stored here. */ - private final HashMap> ownProperties = new HashMap<>(); + private final HashMap> ownProperties = new HashMap>(); /** * Field factory for this form. @@ -345,7 +345,7 @@ public class Form extends AbstractField } } catch (final Buffered.SourceException e) { if (problems == null) { - problems = new LinkedList<>(); + problems = new LinkedList(); } problems.add(e); } @@ -389,7 +389,7 @@ public class Form extends AbstractField fields.get(i.next()).discard(); } catch (final Buffered.SourceException e) { if (problems == null) { - problems = new LinkedList<>(); + problems = new LinkedList(); } problems.add(e); } @@ -1105,7 +1105,7 @@ public class Form extends AbstractField if (data instanceof Item) { item = (Item) data; } else if (data != null) { - item = new BeanItem<>(data); + item = new BeanItem(data); } // Sets the datasource to form @@ -1149,7 +1149,7 @@ public class Form extends AbstractField * the visibleProperties to set. */ public void setVisibleItemProperties(Object... visibleProperties) { - LinkedList v = new LinkedList<>(); + LinkedList v = new LinkedList(); 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 itemIdToDetailsComponent = new HashMap<>(); + private final Map itemIdToDetailsComponent = new HashMap(); /** * Set of item ids that got null from DetailsGenerator when * {@link DetailsGenerator#getDetails(RowReference)} was called. */ - private final Set emptyDetails = new HashSet<>(); + private final Set emptyDetails = new HashSet(); /** * Set of item IDs for all open details rows. Contains even the ones * that are not currently visible on the client. */ - private final Set openDetails = new HashSet<>(); + private final Set openDetails = new HashSet(); 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 visibleItemIds = new HashSet<>( + Set visibleItemIds = new HashSet( itemIdToDetailsComponent.keySet()); for (Object itemId : visibleItemIds) { destroyDetails(itemId); @@ -572,7 +572,7 @@ public class Grid extends AbstractComponent @Override protected void bindFields() { - List> fields = new ArrayList<>(getFields()); + List> fields = new ArrayList>(getFields()); Item itemDataSource = getItemDataSource(); if (itemDataSource == null) { @@ -746,7 +746,7 @@ public class Grid extends AbstractComponent private CommitException cause; - private Set errorColumns = new HashSet<>(); + private Set errorColumns = new HashSet(); 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 selection = new LinkedHashSet<>(); + protected final LinkedHashSet selection = new LinkedHashSet(); @Override public boolean isSelected(final Object itemId) { @@ -1417,7 +1417,7 @@ public class Grid extends AbstractComponent @Override public Collection getSelectedRows() { - return new ArrayList<>(selection); + return new ArrayList(selection); } @Override @@ -1657,7 +1657,7 @@ public class Grid extends AbstractComponent @Override public void select(List rowKeys) { - List items = new ArrayList<>(); + List items = new ArrayList(); for (String rowKey : rowKeys) { items.add(getItemId(rowKey)); } @@ -1666,7 +1666,7 @@ public class Grid extends AbstractComponent @Override public void deselect(List rowKeys) { - List items = new ArrayList<>(); + List items = new ArrayList(); 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 oldSelection = new HashSet<>(selection); + final HashSet oldSelection = new HashSet( + 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 oldSelection = new HashSet<>(selection); + final HashSet oldSelection = new HashSet( + selection); selection.removeAll(itemIds); fireSelectionEvent(oldSelection, selection); } @@ -1890,7 +1892,7 @@ public class Grid extends AbstractComponent checkItemIdsExist(itemIds); boolean changed = false; - Set selectedRows = new HashSet<>(itemIds); + Set selectedRows = new HashSet(itemIds); final Collection oldSelection = getSelectedRows(); Set added = getDifference(selectedRows, selection); if (!added.isEmpty()) { @@ -1931,7 +1933,7 @@ public class Grid extends AbstractComponent */ private static Set getDifference(Set set1, Set set2) { - Set diff = new HashSet<>(set1); + Set diff = new HashSet(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 cells = new LinkedHashMap<>(); - private Map, CELLTYPE> cellGroups = new HashMap<>(); + private Map cells = new LinkedHashMap(); + private Map, CELLTYPE> cellGroups = new HashMap, 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 cells = new HashSet<>(); + Set cells = new HashSet(); 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(Arrays.asList(cells))); } protected CELLTYPE join(Set cells) { @@ -2432,7 +2434,7 @@ public class Grid extends AbstractComponent // Create new cell data for the group CELLTYPE newCell = createCell(); - Set columnGroup = new HashSet<>(); + Set columnGroup = new HashSet(); 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 visited = new HashSet<>(); + Set visited = new HashSet(); 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 cells = new HashSet<>(); + Set cells = new HashSet(); 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 rows = new ArrayList<>(); + protected List rows = new ArrayList(); /** * 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 columns = new HashMap<>(); + private final Map columns = new HashMap(); /** * Key generator for column server-to-client communication */ - private final KeyMapper columnKeys = new KeyMapper<>(); + private final KeyMapper columnKeys = new KeyMapper(); /** * The current sort order */ - private final List sortOrder = new ArrayList<>(); + private final List sortOrder = new ArrayList(); /** * 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 removedColumns = new LinkedList<>(); + List removedColumns = new LinkedList(); 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 addedColumns = new LinkedList<>(); + List addedColumns = new LinkedList(); 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> editorFields = new HashMap<>(); + private Map> editorFields = new HashMap>(); private CellStyleGenerator cellStyleGenerator; private RowStyleGenerator rowStyleGenerator; @@ -4643,7 +4645,7 @@ public class Grid extends AbstractComponent private DetailComponentManager detailComponentManager = null; - private Set extensionComponents = new HashSet<>(); + private Set extensionComponents = new HashSet(); 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 order = new ArrayList<>(columnIds.length); + List order = new ArrayList( + 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(); 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 getColumns() { - List columns = new ArrayList<>(); + List columns = new ArrayList(); 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 addedColumns = new ArrayList<>(); + List addedColumns = new ArrayList(); 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 removed = new ArrayList<>(columns.values()); - Set properties = new HashSet<>(columns.keySet()); + List removed = new ArrayList(columns.values()); + Set properties = new HashSet(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 removed = new ArrayList<>(); + List removed = new ArrayList(); 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(columns.keySet()); removePids.removeAll(Arrays.asList(propertyIds)); for (Object removePid : removePids) { removeColumn(removePid); } - Set addPids = new HashSet<>(Arrays.asList(propertyIds)); + Set addPids = new HashSet(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 columnOrder = new ArrayList<>(); + List columnOrder = new ArrayList(); 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), userOriginated)); } else { throw new IllegalStateException( @@ -6579,7 +6582,7 @@ public class Grid extends AbstractComponent public Iterator iterator() { // This is a hash set to avoid adding header/footer components inside // merged cells multiple times - LinkedHashSet componentList = new LinkedHashSet<>(); + LinkedHashSet componentList = new LinkedHashSet(); 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 disabledItemIds = new HashSet<>(); + private Set disabledItemIds = new HashSet(); 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 columnIdMap = new KeyMapper<>(); + private final KeyMapper columnIdMap = new KeyMapper(); /** * Holds visible column propertyIds - in order. */ - private LinkedList visibleColumns = new LinkedList<>(); + private LinkedList visibleColumns = new LinkedList(); /** * Holds noncollapsible columns. */ - private HashSet noncollapsibleColumns = new HashSet<>(); + private HashSet noncollapsibleColumns = new HashSet(); /** * Holds propertyIds of currently collapsed columns. */ - private final HashSet collapsedColumns = new HashSet<>(); + private final HashSet collapsedColumns = new HashSet(); /** * Holds headers for visible columns (by propertyId). */ - private final HashMap columnHeaders = new HashMap<>(); + private final HashMap columnHeaders = new HashMap(); /** * Holds footers for visible columns (by propertyId). */ - private final HashMap columnFooters = new HashMap<>(); + private final HashMap columnFooters = new HashMap(); /** * Holds icons for visible columns (by propertyId). */ - private final HashMap columnIcons = new HashMap<>(); + private final HashMap columnIcons = new HashMap(); /** * Holds alignments for visible columns (by propertyId). */ - private HashMap columnAlignments = new HashMap<>(); + private HashMap columnAlignments = new HashMap(); /** * Holds column widths in pixels for visible columns (by propertyId). */ - private final HashMap columnWidths = new HashMap<>(); + private final HashMap columnWidths = new HashMap(); /** * Holds column expand rations for visible columns (by propertyId). */ - private final HashMap columnExpandRatios = new HashMap<>(); + private final HashMap columnExpandRatios = new HashMap(); /** * Holds column generators */ - private final HashMap columnGenerators = new LinkedHashMap<>(); + private final HashMap columnGenerators = new LinkedHashMap(); /** * 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, Property> associatedProperties = new HashMap<>(); + private final Map, Property> associatedProperties = new HashMap, Property>(); private boolean painted = false; - private HashMap> propertyValueConverters = new HashMap<>(); + private HashMap> propertyValueConverters = new HashMap>(); /** * 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 exceptionsDuringCachePopulation = new ArrayList<>(); + private List exceptionsDuringCachePopulation = new ArrayList(); 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 newVC = new LinkedList<>(); + final LinkedList newVC = new LinkedList(); // 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 newCA = new HashMap<>(); + final HashMap newCA = new HashMap(); int i = 0; for (final Iterator 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 newOrder = new LinkedList<>(); + final LinkedList newOrder = new LinkedList(); 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>(); + visibleComponents = new HashSet(); } 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 availableCols = new LinkedList<>(); + final LinkedList availableCols = new LinkedList(); for (Iterator 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 visibleIds = new ArrayList<>(); + List visibleIds = new ArrayList(); 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(); } // 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 retainableValueConverters = new LinkedList<>(); + LinkedList retainableValueConverters = new LinkedList(); for (Object propertyId : newPropertyIds) { Converter 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 col = new LinkedList<>(); + Collection col = new LinkedList(); 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 getItemIdsInRange(Object itemId, final int length) { - LinkedHashSet ids = new LinkedHashSet<>(); + LinkedHashSet ids = new LinkedHashSet(); 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 renderedButNotSelectedItemIds = getCurrentlyRenderedItemIds(); @SuppressWarnings("unchecked") - HashSet newValue = new LinkedHashSet<>( + HashSet newValue = new LinkedHashSet( (Collection) getValue()); if (variables.containsKey("clearSelections")) { @@ -2938,7 +2938,7 @@ public class Table extends AbstractSelect implements Action.Container, } private Set getCurrentlyRenderedItemIds() { - HashSet ids = new HashSet<>(); + HashSet ids = new HashSet(); 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(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(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 idSet = new HashSet<>(); + Set idSet = new HashSet(); 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 collapsedCols = new HashSet<>(); + final HashSet collapsedCols = new HashSet(); 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 visibleColOrder = new ArrayList<>(); + final ArrayList visibleColOrder = new ArrayList(); 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 findAndPaintBodyActions(PaintTarget target) { - Set actionSet = new LinkedHashSet<>(); + Set actionSet = new LinkedHashSet(); if (actionHandlers != null) { - final ArrayList keys = new ArrayList<>(); + final ArrayList keys = new ArrayList(); 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 selectedKeys = new LinkedList<>(); + LinkedList selectedKeys = new LinkedList(); if (isMultiSelect()) { HashSet sel = new HashSet((Set) getValue()); Collection vids = getVisibleItemIds(); @@ -4002,7 +4002,7 @@ public class Table extends AbstractSelect implements Action.Container, // Actions if (actionHandlers != null) { - final ArrayList keys = new ArrayList<>(); + final ArrayList keys = new ArrayList(); 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(); + actionMapper = new KeyMapper(); } if (!actionHandlers.contains(actionHandler)) { @@ -4534,7 +4534,7 @@ public class Table extends AbstractSelect implements Action.Container, @Override public Collection getVisibleItemIds() { - final LinkedList visible = new LinkedList<>(); + final LinkedList visible = new LinkedList(); 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 newVisibleColumns = new LinkedList<>(visibleColumns); + LinkedList newVisibleColumns = new LinkedList( + visibleColumns); for (Iterator 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 pIds = new ArrayList<>(); + List pIds = new ArrayList(); 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 selected = new HashSet<>(); + Set selected = new HashSet(); 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 itemIconAlts = new HashMap<>(); + private final HashMap itemIconAlts = new HashMap(); /** * Set of expanded nodes. */ - private HashSet expanded = new HashSet<>(); + private HashSet expanded = new HashSet(); /** * List of action handlers. @@ -375,7 +375,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, boolean result = true; // Initial stack - final Stack todo = new Stack<>(); + final Stack todo = new Stack(); todo.add(startItemId); // Expands recursively @@ -428,7 +428,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, boolean result = true; // Initial stack - final Stack todo = new Stack<>(); + final Stack todo = new Stack(); 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(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(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 s = new LinkedList<>(); + final LinkedList s = new LinkedList(); 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 actionSet = new LinkedHashSet<>(); + final Set actionSet = new LinkedHashSet(); // rendered selectedKeys - LinkedList selectedKeys = new LinkedList<>(); + LinkedList selectedKeys = new LinkedList(); - final LinkedList expandedKeys = new LinkedList<>(); + final LinkedList expandedKeys = new LinkedList(); // Iterates through hierarchical tree using a stack of iterators - final Stack> iteratorStack = new Stack<>(); + final Stack> iteratorStack = new Stack>(); 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 keys = new ArrayList<>(); + final ArrayList keys = new ArrayList(); 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 keys = new ArrayList<>(); + final ArrayList keys = new ArrayList(); final Iterator 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(); + actionMapper = new KeyMapper(); } if (!actionHandlers.contains(actionHandler)) { @@ -1291,10 +1291,10 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, @Override public Collection getVisibleItemIds() { - final LinkedList visible = new LinkedList<>(); + final LinkedList visible = new LinkedList(); // Iterates trough hierarchical tree using a stack of iterators - final Stack> iteratorStack = new Stack<>(); + final Stack> iteratorStack = new Stack>(); 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 removedItemIds = new HashSet<>(); + Set removedItemIds = new HashSet(); 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 openItems = new HashSet<>(); + private final HashSet openItems = new HashSet(); @Override public boolean isNodeOpen(Object itemId) { @@ -286,7 +286,7 @@ public class TreeTable extends Table implements Hierarchical { */ private List getPreOrder() { if (preOrder == null) { - preOrder = new ArrayList<>(); + preOrder = new ArrayList(); Collection rootItemIds = getContainerDataSource() .rootItemIds(); for (Object id : rootItemIds) { @@ -896,7 +896,7 @@ public class TreeTable extends Table implements Hierarchical { @Override protected List getItemIds(int firstIndex, int rows) { - List itemIds = new ArrayList<>(); + List itemIds = new ArrayList(); 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 selected = new HashSet<>(); - Stack parents = new Stack<>(); + Set selected = new HashSet(); + Stack parents = new Stack(); 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(); } 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 eventSetChangeListeners = new LinkedList<>(); - private final List eventChangeListeners = new LinkedList<>(); + private final List eventSetChangeListeners = new LinkedList(); + private final List eventChangeListeners = new LinkedList(); /** * The event cache contains the events previously created by * {@link #getEvents(Date, Date)} */ - private final List eventCache = new LinkedList<>(); + private final List eventCache = new LinkedList(); /** * 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 listeners = new ArrayList<>(); + private transient List listeners = new ArrayList(); 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 eventList = new ArrayList<>(); + protected List eventList = new ArrayList(); - private List listeners = new ArrayList<>(); + private List listeners = new ArrayList(); /* * (non-Javadoc) @@ -59,7 +59,7 @@ public class BasicEventProvider implements CalendarEditableEventProvider, */ @Override public List getEvents(Date startDate, Date endDate) { - ArrayList activeEvents = new ArrayList<>(); + ArrayList activeEvents = new ArrayList(); 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 changedColors = new HashMap<>(); + private final Map changedColors = new HashMap(); /** * 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 tempHistory = new ArrayBlockingQueue<>( + private ArrayBlockingQueue tempHistory = new ArrayBlockingQueue( rows * columns); /** The grid. */ @@ -83,7 +83,7 @@ public class ColorPickerHistory extends CustomComponent implements } private void createColorHistoryIfNecessary() { - List tempColors = new ArrayList<>(tempHistory); + List tempColors = new ArrayList(tempHistory); if (getSession().getAttribute("colorPickerHistory") == null) { getSession().setAttribute("colorPickerHistory", new ArrayBlockingQueue(rows * columns)); @@ -97,8 +97,8 @@ public class ColorPickerHistory extends CustomComponent implements @SuppressWarnings("unchecked") private ArrayBlockingQueue getColorHistory() { if (isAttached()) { - Object colorHistory = getSession().getAttribute( - "colorPickerHistory"); + Object colorHistory = getSession() + .getAttribute("colorPickerHistory"); if (colorHistory instanceof ArrayBlockingQueue) { return (ArrayBlockingQueue) colorHistory; } @@ -135,7 +135,7 @@ public class ColorPickerHistory extends CustomComponent implements } } - List colorList = new ArrayList<>(colorHistory); + List colorList = new ArrayList(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 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 selectors = new HashSet<>(); + private final Set selectors = new HashSet(); /** * 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 defaultColors = new ArrayList<>(); + List defaultColors = new ArrayList(); defaultColors.add(Color.BLACK); defaultColors.add(Color.WHITE); diff --git a/compatibility-server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java b/compatibility-server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java index 0d6166b2d9..66e68573d8 100644 --- a/compatibility-server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java +++ b/compatibility-server/src/test/java/com/vaadin/tests/server/component/AbstractListenerMethodsTestBase.java @@ -19,7 +19,7 @@ public abstract class AbstractListenerMethodsTestBase { } private static void findAllListenerMethods() { - Set> classes = new HashSet<>(); + Set> classes = new HashSet>(); for (Class c : VaadinClasses.getAllServerSideClasses()) { while (c != null && c.getName().startsWith("com.vaadin.")) { classes.add(c); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/VaadinClasses.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/VaadinClasses.java index 612f85cd33..fd2ae40cb5 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/tests/VaadinClasses.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/VaadinClasses.java @@ -17,7 +17,7 @@ import com.vaadin.v7.ui.Field; @SuppressWarnings("deprecation") public class VaadinClasses { - private static final Set WHITE_LIST_FQNS = new HashSet<>(); + private static final Set WHITE_LIST_FQNS = new HashSet(); public static List> getFields() { return getServerClasses(Field.class::isAssignableFrom) diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/SerializationTest.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/SerializationTest.java index 23b3c4fc0d..2130fc493a 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/SerializationTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/SerializationTest.java @@ -34,7 +34,7 @@ public class SerializationTest { Form f = new Form(); String propertyId = "My property"; f.addItemProperty(propertyId, - new MethodProperty<>(new Data(), "dummyGetterAndSetter")); + new MethodProperty(new Data(), "dummyGetterAndSetter")); f.replaceWithSelect(propertyId, new Object[] { "a", "b", null }, new String[] { "Item a", "ITem b", "Null item" }); @@ -57,20 +57,22 @@ public class SerializationTest { @Test public void testMethodPropertyGetter() throws Exception { - MethodProperty mp = new MethodProperty<>(new Data(), "dummyGetter"); + MethodProperty mp = new MethodProperty(new Data(), + "dummyGetter"); serializeAndDeserialize(mp); } @Test public void testMethodPropertyGetterAndSetter() throws Exception { - MethodProperty mp = new MethodProperty<>(new Data(), + MethodProperty mp = new MethodProperty(new Data(), "dummyGetterAndSetter"); serializeAndDeserialize(mp); } @Test public void testMethodPropertyInt() throws Exception { - MethodProperty mp = new MethodProperty<>(new Data(), "dummyInt"); + MethodProperty mp = new MethodProperty(new Data(), + "dummyInt"); serializeAndDeserialize(mp); } diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/calendar/ContainerDataSourceTest.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/calendar/ContainerDataSourceTest.java index d707680082..a504d64a13 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/calendar/ContainerDataSourceTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/calendar/ContainerDataSourceTest.java @@ -279,7 +279,7 @@ public class ContainerDataSourceTest { // Use a container data source calendar.setEventProvider(new ContainerEventProvider( - new BeanItemContainer<>(BasicEvent.class))); + new BeanItemContainer(BasicEvent.class))); // Start and end dates to query for java.util.Calendar cal = java.util.Calendar.getInstance(); @@ -307,7 +307,7 @@ public class ContainerDataSourceTest { // Use a container data source calendar.setEventProvider(new ContainerEventProvider( - new BeanItemContainer<>(BasicEvent.class))); + new BeanItemContainer(BasicEvent.class))); // Start and end dates to query for java.util.Calendar cal = java.util.Calendar.getInstance(); @@ -366,7 +366,7 @@ public class ContainerDataSourceTest { @Test public void testAutomaticScaleVisibleHoursOfDay() { - BeanItemContainer container = new BeanItemContainer<>( + BeanItemContainer container = new BeanItemContainer( CalendarEvent.class); java.util.Calendar start = java.util.Calendar.getInstance(); java.util.Calendar end = java.util.Calendar.getInstance(); @@ -416,7 +416,7 @@ public class ContainerDataSourceTest { } private static Indexed createTestBeanItemContainer() { - BeanItemContainer eventContainer = new BeanItemContainer<>( + BeanItemContainer eventContainer = new BeanItemContainer( CalendarEvent.class); java.util.Calendar cal = java.util.Calendar.getInstance(); for (int i = 1; i <= 10; i++) { diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/datefield/DateFieldConverterTest.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/datefield/DateFieldConverterTest.java index 35e8a93929..91bc1a5939 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/datefield/DateFieldConverterTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/datefield/DateFieldConverterTest.java @@ -35,7 +35,7 @@ public class DateFieldConverterTest { @Before public void setUp() { - date = new ObjectProperty<>(0L); + date = new ObjectProperty(0L); datefield = new DateField(); datefield.setBuffered(false); datefield.setConverter(new Converter() { diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/fieldgroup/FieldGroupTest.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/fieldgroup/FieldGroupTest.java index 99a2daa547..bd44a18c1a 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/fieldgroup/FieldGroupTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/fieldgroup/FieldGroupTest.java @@ -81,7 +81,8 @@ public class FieldGroupTest { field2.setRequired(true); fieldGroup.bind(field2, "prop2"); - Set set = new HashSet<>(Arrays.asList(field1, field2)); + Set set = new HashSet( + Arrays.asList(field1, field2)); try { fieldGroup.commit(); diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/GridEditorMissingPropertyTest.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/GridEditorMissingPropertyTest.java index be6334f8cc..e35e807fe6 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/GridEditorMissingPropertyTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/GridEditorMissingPropertyTest.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 @@ -59,8 +59,8 @@ public class GridEditorMissingPropertyTest { @Before public void setup() throws SecurityException, NoSuchMethodException { - final BeanItem folderItem = new BeanItem<>(folder); - final BeanItem childItem = new BeanItem<>(file); + final BeanItem folderItem = new BeanItem(folder); + final BeanItem childItem = new BeanItem(file); @SuppressWarnings("unchecked") TestContainer container = new TestContainer( @@ -252,7 +252,7 @@ public class GridEditorMissingPropertyTest { @Override protected List getAllItemIds() { - List ids = new ArrayList<>(); + List ids = new ArrayList(); for (BeanItem item : items) { ids.add(item.getBean()); } diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/components/ComboBoxValueChangeTest.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/components/ComboBoxValueChangeTest.java index e62358f272..d4516521f3 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/components/ComboBoxValueChangeTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/components/ComboBoxValueChangeTest.java @@ -27,7 +27,7 @@ public class ComboBoxValueChangeTest @Override protected void setValue(AbstractField field) { - Map variables = new HashMap<>(); + Map variables = new HashMap(); variables.put("selected", new String[] { "myvalue" }); ((ComboBox) field).changeVariables(field, variables); } diff --git a/compatibility-server/src/test/java/com/vaadin/v7/ui/ComboBoxTest.java b/compatibility-server/src/test/java/com/vaadin/v7/ui/ComboBoxTest.java index 62a0c0bdbd..16f7eb2423 100644 --- a/compatibility-server/src/test/java/com/vaadin/v7/ui/ComboBoxTest.java +++ b/compatibility-server/src/test/java/com/vaadin/v7/ui/ComboBoxTest.java @@ -64,7 +64,7 @@ public class ComboBoxTest { private static void setFilterAndCurrentPage(ComboBox comboBox, String filterString, int currentPage) { - Map variables = new HashMap<>(); + Map variables = new HashMap(); variables.put("filter", filterString); variables.put("page", currentPage); comboBox.changeVariables(null, variables); -- cgit v1.2.3