From 1290426ff3b3137a7afd586594d884228e9309fe Mon Sep 17 00:00:00 2001 From: Ahmed Ashour Date: Tue, 7 Mar 2017 12:15:05 +0100 Subject: Fix some generics warnings in Eclipse --- .../v7/data/util/converter/StringToCollectionConverter.java | 6 +++--- uitest/src/main/java/com/vaadin/tests/RandomLayoutStress.java | 7 ++++--- uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java | 2 +- uitest/src/main/java/com/vaadin/tests/TestDateField.java | 10 +++++----- uitest/src/main/java/com/vaadin/tests/TestForAlignments.java | 4 ++-- .../java/com/vaadin/tests/TestForBasicApplicationLayout.java | 3 ++- .../com/vaadin/tests/components/FocusAndBlurListeners.java | 2 +- .../abstractfield/AbstractComponentDataBindingTest.java | 2 +- .../tests/components/gridlayout/LayoutAfterHidingError.java | 2 +- .../tests/components/table/TableChildMeasurementHint.java | 2 +- .../tests/components/uitest/components/DatesCssTest.java | 5 +++-- .../src/main/java/com/vaadin/tests/themes/valo/DateFields.java | 6 +++--- uitest/src/main/java/com/vaadin/tests/themes/valo/Forms.java | 3 ++- uitest/src/main/java/com/vaadin/tests/themes/valo/Tables.java | 2 +- 14 files changed, 30 insertions(+), 26 deletions(-) diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/StringToCollectionConverter.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/StringToCollectionConverter.java index 96a35b25ab..ff4ec95b4d 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/StringToCollectionConverter.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/converter/StringToCollectionConverter.java @@ -210,9 +210,9 @@ public class StringToCollectionConverter public Collection createCollection( Class type) { if (type.isAssignableFrom(ArrayList.class)) { - return new ArrayList(); + return new ArrayList(); } else if (type.isAssignableFrom(HashSet.class)) { - return new HashSet(); + return new HashSet(); } else if (!type.isInterface() && !Modifier.isAbstract(type.getModifiers())) { try { @@ -221,7 +221,7 @@ public class StringToCollectionConverter } catch (IllegalAccessException ignore) { } } - return new ArrayList(); + return new ArrayList(); } } diff --git a/uitest/src/main/java/com/vaadin/tests/RandomLayoutStress.java b/uitest/src/main/java/com/vaadin/tests/RandomLayoutStress.java index 61f9127df5..dbef899fd5 100644 --- a/uitest/src/main/java/com/vaadin/tests/RandomLayoutStress.java +++ b/uitest/src/main/java/com/vaadin/tests/RandomLayoutStress.java @@ -20,6 +20,7 @@ import java.time.LocalDate; import java.util.Random; import com.vaadin.server.ExternalResource; +import com.vaadin.shared.ui.datefield.DateResolution; import com.vaadin.tests.components.TestDateField; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractDateField; @@ -184,14 +185,14 @@ public class RandomLayoutStress extends com.vaadin.server.LegacyApplication { case 6: // Datefield result = new TestDateField(); - ((AbstractDateField) result).setStyleName("calendar"); - ((AbstractDateField) result).setValue(LocalDate.now()); + ((AbstractDateField) result).setStyleName("calendar"); + ((AbstractDateField) result).setValue(LocalDate.now()); result.setCaption("Calendar component " + caption); break; case 7: // Datefield result = new TestDateField(); - ((AbstractDateField) result).setValue(LocalDate.now()); + ((AbstractDateField) result).setValue(LocalDate.now()); result.setCaption("Calendar component " + caption); break; } diff --git a/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java b/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java index 016a2d3d84..6cde5ad294 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java +++ b/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java @@ -120,7 +120,7 @@ public class TestCaptionWrapper extends CustomComponent implements Listener { test(layout, button); button.addListener(this); - final AbstractDateField df = new TestDateField("DateField " + count++); + final AbstractDateField df = new TestDateField("DateField " + count++); test(layout, df); final CheckBox cb = new CheckBox("Checkbox " + count++); diff --git a/uitest/src/main/java/com/vaadin/tests/TestDateField.java b/uitest/src/main/java/com/vaadin/tests/TestDateField.java index c0df8484ec..0befb03475 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestDateField.java +++ b/uitest/src/main/java/com/vaadin/tests/TestDateField.java @@ -34,7 +34,7 @@ public class TestDateField extends CustomComponent { VerticalLayout main = new VerticalLayout(); - AbstractDateField df; + AbstractDateField df; public TestDateField() { setCompositionRoot(main); @@ -57,22 +57,22 @@ public class TestDateField extends CustomComponent { df.addStyleName("thisShouldBeHarmless"); // Another test: locale - final AbstractDateField df1 = new com.vaadin.tests.components.TestDateField( + final AbstractDateField df1 = new com.vaadin.tests.components.TestDateField( "US locale"); main.addComponent(df1); df1.setLocale(new Locale("en", "US")); - final AbstractDateField df2 = new com.vaadin.tests.components.TestDateField( + final AbstractDateField df2 = new com.vaadin.tests.components.TestDateField( "DE locale"); main.addComponent(df2); df2.setLocale(new Locale("de", "DE")); - final AbstractDateField df3 = new com.vaadin.tests.components.TestDateField( + final AbstractDateField df3 = new com.vaadin.tests.components.TestDateField( "RU locale"); main.addComponent(df3); df3.setLocale(new Locale("ru", "RU")); - final AbstractDateField df4 = new com.vaadin.tests.components.TestDateField( + final AbstractDateField df4 = new com.vaadin.tests.components.TestDateField( "FI locale"); main.addComponent(df4); df4.setLocale(new Locale("fi", "FI")); diff --git a/uitest/src/main/java/com/vaadin/tests/TestForAlignments.java b/uitest/src/main/java/com/vaadin/tests/TestForAlignments.java index 149017911f..74a31e1200 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForAlignments.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForAlignments.java @@ -37,8 +37,8 @@ public class TestForAlignments extends CustomComponent { final Button b4 = new Button("Top"); final TextField t1 = new TextField("Right aligned"); final TextField t2 = new TextField("Bottom aligned"); - final AbstractDateField d1 = new TestDateField("Center aligned"); - final AbstractDateField d2 = new TestDateField("Center aligned"); + final AbstractDateField d1 = new TestDateField("Center aligned"); + final AbstractDateField d2 = new TestDateField("Center aligned"); final VerticalLayout vert = new VerticalLayout(); vert.addComponent(b1); diff --git a/uitest/src/main/java/com/vaadin/tests/TestForBasicApplicationLayout.java b/uitest/src/main/java/com/vaadin/tests/TestForBasicApplicationLayout.java index d4d6fa90e5..9463d3820d 100644 --- a/uitest/src/main/java/com/vaadin/tests/TestForBasicApplicationLayout.java +++ b/uitest/src/main/java/com/vaadin/tests/TestForBasicApplicationLayout.java @@ -16,6 +16,7 @@ package com.vaadin.tests; +import java.time.LocalDate; import java.util.Locale; import com.vaadin.server.Sizeable; @@ -82,7 +83,7 @@ public class TestForBasicApplicationLayout extends CustomComponent { controls.addComponent(click); controls.addComponent(click2); reportLayout.addComponent(controls); - final AbstractDateField cal = new TestDateField(); + final AbstractDateField cal = new TestDateField(); cal.setResolution(DateResolution.DAY); cal.setLocale(new Locale("en", "US")); reportLayout.addComponent(cal); diff --git a/uitest/src/main/java/com/vaadin/tests/components/FocusAndBlurListeners.java b/uitest/src/main/java/com/vaadin/tests/components/FocusAndBlurListeners.java index 3a27561284..7bf144c8d7 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/FocusAndBlurListeners.java +++ b/uitest/src/main/java/com/vaadin/tests/components/FocusAndBlurListeners.java @@ -48,7 +48,7 @@ public class FocusAndBlurListeners extends TestBase { TextField tf = new TextField("TextField"); l.addComponent(tf); - AbstractDateField df = new TestDateField("DateField"); + AbstractDateField df = new TestDateField("DateField"); l.addComponent(df); ComboBox cb = new ComboBox("ComboBox"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java index db6479bb0e..e0b6a074b6 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java @@ -95,7 +95,7 @@ public abstract class AbstractComponentDataBindingTest extends TestBase @Override public void valueChange(ValueChangeEvent event) { - AbstractField field = (AbstractField) event.getProperty(); + AbstractField field = (AbstractField) event.getProperty(); // if (field == localeSelect) { // return; // } diff --git a/uitest/src/main/java/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java b/uitest/src/main/java/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java index 477fd5ae96..1e63a375c4 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java +++ b/uitest/src/main/java/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java @@ -39,7 +39,7 @@ public class LayoutAfterHidingError extends AbstractReindeerTestUI { gl.setWidth("100%"); panel.setContent(gl); - final AbstractDateField df = new TestDateField(); + final AbstractDateField df = new TestDateField(); df.setWidth("100%"); gl.addComponent(df); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/TableChildMeasurementHint.java b/uitest/src/main/java/com/vaadin/tests/components/table/TableChildMeasurementHint.java index 7d4126f38f..7cb90b1cd5 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/TableChildMeasurementHint.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/TableChildMeasurementHint.java @@ -152,7 +152,7 @@ public class TableChildMeasurementHint extends AbstractReindeerTestUI { table.addGeneratedColumn("First_Name" + 4, new Table.ColumnGenerator() { @Override public Object generateCell(Table components, Object o, Object o2) { - AbstractDateField b = new TestDateField("DateField"); + AbstractDateField b = new TestDateField("DateField"); b.setWidthUndefined(); return b; } diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/DatesCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/DatesCssTest.java index 485bf9cafc..39d9544c53 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/DatesCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/DatesCssTest.java @@ -2,6 +2,7 @@ package com.vaadin.tests.components.uitest.components; import java.time.LocalDate; +import com.vaadin.shared.ui.datefield.DateResolution; import com.vaadin.tests.components.TestDateField; import com.vaadin.tests.components.uitest.TestSampler; import com.vaadin.ui.AbstractDateField; @@ -28,7 +29,7 @@ public class DatesCssTest extends GridLayout { createDateFieldWith("Small", ChameleonTheme.DATEFIELD_SMALL, null); createDateFieldWith("Big", ChameleonTheme.DATEFIELD_BIG, null); - AbstractDateField df = new DateField("Popup date field"); + AbstractDateField df = new DateField("Popup date field"); df.setId("datefield" + debugIdCounter++); df.setValue(date); addComponent(df); @@ -47,7 +48,7 @@ public class DatesCssTest extends GridLayout { private void createDateFieldWith(String caption, String primaryStyleName, String width) { - AbstractDateField df = new TestDateField("Date field"); + AbstractDateField df = new TestDateField("Date field"); df.setId("datefield" + debugIdCounter++); df.setValue(date); diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/DateFields.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/DateFields.java index dc6f5ccf48..33776be726 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/DateFields.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/DateFields.java @@ -51,7 +51,7 @@ public class DateFields extends VerticalLayout implements View { row.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING); addComponent(row); - AbstractDateField date = new TestDateField("Default resolution"); + AbstractDateField date = new TestDateField("Default resolution"); setDate(date); row.addComponent(date); @@ -188,14 +188,14 @@ public class DateFields extends VerticalLayout implements View { row.addComponent(form); } - private void setDateRange(AbstractDateField date) { + private void setDateRange(AbstractDateField date) { date.setRangeStart(getDefaultDate()); LocalDate endDate = getDefaultDate(); date.setRangeEnd(endDate.plusMonths(1)); } - private void setDate(AbstractDateField date) { + private void setDate(AbstractDateField date) { date.setValue(getDefaultDate()); } diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/Forms.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/Forms.java index 3a7df7cd90..2533e7bb02 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/Forms.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/Forms.java @@ -21,6 +21,7 @@ import com.vaadin.navigator.View; import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; import com.vaadin.server.UserError; import com.vaadin.shared.ui.MarginInfo; +import com.vaadin.shared.ui.datefield.DateResolution; import com.vaadin.tests.components.TestDateField; import com.vaadin.ui.AbstractDateField; import com.vaadin.ui.Alignment; @@ -73,7 +74,7 @@ public class Forms extends VerticalLayout implements View { name.setWidth("50%"); form.addComponent(name); - AbstractDateField birthday = new TestDateField("Birthday"); + AbstractDateField birthday = new TestDateField("Birthday"); birthday.setValue(LocalDate.of(1980, 1, 31)); form.addComponent(birthday); diff --git a/uitest/src/main/java/com/vaadin/tests/themes/valo/Tables.java b/uitest/src/main/java/com/vaadin/tests/themes/valo/Tables.java index bce3d32161..c07fbc3e27 100644 --- a/uitest/src/main/java/com/vaadin/tests/themes/valo/Tables.java +++ b/uitest/src/main/java/com/vaadin/tests/themes/valo/Tables.java @@ -199,7 +199,7 @@ public class Tables extends VerticalLayout implements View { @Override public Object generateCell(Table source, Object itemId, Object columnId) { - AbstractDateField tf = new TestDateField(); + AbstractDateField tf = new TestDateField(); tf.addStyleName(ValoTheme.TABLE_COMPACT); if ((Integer) itemId % 2 == 0) { tf.addStyleName(ValoTheme.DATEFIELD_BORDERLESS); -- cgit v1.2.3