]> source.dussan.org Git - vaadin-framework.git/commitdiff
Construct array inline (#10068)
authorAhmed Ashour <asashour@yahoo.com>
Sat, 23 Sep 2017 06:45:49 +0000 (08:45 +0200)
committerHenri Sara <henri.sara@gmail.com>
Sat, 23 Sep 2017 06:45:49 +0000 (09:45 +0300)
And some trivial test enhancements

113 files changed:
buildhelpers/src/main/java/com/vaadin/buildhelpers/CompileTheme.java
client-compiler/src/main/java/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
client/src/main/java/com/vaadin/client/Profiler.java
client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java
client/src/main/java/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java
client/src/main/java/com/vaadin/client/ui/VDragAndDropWrapper.java
client/src/main/java/com/vaadin/client/ui/layout/LayoutDependencyTree.java
client/src/main/java/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java
client/src/test/java/com/vaadin/client/ApplicationConnectionURLGenerationTest.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeekGrid.java
compatibility-client/src/main/java/com/vaadin/v7/client/ui/richtextarea/VRichTextToolbar.java
compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java
compatibility-server/src/main/java/com/vaadin/v7/data/fieldgroup/DefaultFieldGroupFieldFactory.java
compatibility-server/src/main/java/com/vaadin/v7/data/util/FilesystemContainer.java
compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractField.java
compatibility-server/src/main/java/com/vaadin/v7/util/SerializerHelper.java
compatibility-server/src/test/java/com/vaadin/tests/server/PropertyFormatterTest.java
compatibility-server/src/test/java/com/vaadin/v7/data/util/BeanItemContainerSortTest.java
compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTableQueryTest.java
compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/SQLContainerTest.java
compatibility-server/src/test/java/com/vaadin/v7/tests/data/converter/StringToByteConverterTest.java
compatibility-server/src/test/java/com/vaadin/v7/tests/data/converter/StringToIntegerConverterTest.java
compatibility-server/src/test/java/com/vaadin/v7/tests/data/converter/StringToShortConverterTest.java
compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/GridColumnsTest.java
compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/table/CacheUpdateExceptionCausesTest.java
compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/table/TableColumnAlignmentsTest.java
compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/table/TableVisibleColumnsTest.java
server/src/main/java/com/vaadin/ui/AbstractComponent.java
server/src/test/java/com/vaadin/data/provider/StrBean.java
server/src/test/java/com/vaadin/tests/data/converter/StringToIntegerConverterTest.java
server/src/test/java/com/vaadin/tests/server/component/abstractorderedlayout/AddComponentsTest.java
server/src/test/java/com/vaadin/tests/server/component/combobox/ComboBoxFilteringTest.java
server/src/test/java/com/vaadin/tests/server/component/csslayout/AddComponentsTest.java
server/src/test/java/com/vaadin/tests/server/component/gridlayout/GridLayoutTest.java
server/src/test/java/com/vaadin/tests/server/componentcontainer/FormLayoutTest.java
server/src/test/java/com/vaadin/tests/server/navigator/NavigatorTest.java
server/src/test/java/com/vaadin/ui/AbstractListingTest.java
uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java
uitest/src/main/java/com/vaadin/tests/TestForPreconfiguredComponents.java
uitest/src/main/java/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
uitest/src/main/java/com/vaadin/tests/TestForTrees.java
uitest/src/main/java/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java
uitest/src/main/java/com/vaadin/tests/UsingObjectsInSelect.java
uitest/src/main/java/com/vaadin/tests/actions/ActionsWithoutKeyCode.java
uitest/src/main/java/com/vaadin/tests/application/calculator/Calc.java
uitest/src/main/java/com/vaadin/tests/components/AbstractComponentContainerTest.java
uitest/src/main/java/com/vaadin/tests/components/DisableEnableCascade.java
uitest/src/main/java/com/vaadin/tests/components/TouchScrollables.java
uitest/src/main/java/com/vaadin/tests/components/caption/IconsInCaption.java
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java
uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxVaadinIcons.java
uitest/src/main/java/com/vaadin/tests/components/datefield/DateFields.java
uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java
uitest/src/main/java/com/vaadin/tests/components/grid/GridRefreshRow.java
uitest/src/main/java/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java
uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
uitest/src/main/java/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java
uitest/src/main/java/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java
uitest/src/main/java/com/vaadin/tests/components/table/SetDataSourceWithPropertyIds.java
uitest/src/main/java/com/vaadin/tests/components/table/TableToggleVisibility.java
uitest/src/main/java/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java
uitest/src/main/java/com/vaadin/tests/components/tabsheet/TabSheetTest.java
uitest/src/main/java/com/vaadin/tests/components/textfield/TextChangeEvents.java
uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldsValueChangeMode.java
uitest/src/main/java/com/vaadin/tests/components/tree/TreeBasicFeatures.java
uitest/src/main/java/com/vaadin/tests/components/uitest/components/TablesCssTest.java
uitest/src/main/java/com/vaadin/tests/components/uitest/components/TreeCssTest.java
uitest/src/main/java/com/vaadin/tests/components/uitest/components/TreeTableCssTest.java
uitest/src/main/java/com/vaadin/tests/components/upload/DragAndDropUploadAndInteractions.java
uitest/src/main/java/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
uitest/src/main/java/com/vaadin/tests/containers/TestItemSorter.java
uitest/src/main/java/com/vaadin/tests/dd/DDTest6.java
uitest/src/main/java/com/vaadin/tests/dd/TreeDragStart.java
uitest/src/main/java/com/vaadin/tests/elements/ComponentElementGetValue.java
uitest/src/main/java/com/vaadin/tests/elements/abstracttextfield/AbstractFieldElementSetValueReadOnly.java
uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBasicCrud.java
uitest/src/main/java/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java
uitest/src/main/java/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java
uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java
uitest/src/main/java/com/vaadin/tests/layouts/layouttester/BaseLayoutTestUI.java
uitest/src/main/java/com/vaadin/tests/push/PushErrorHandling.java
uitest/src/main/java/com/vaadin/tests/resources/ResourceDownload.java
uitest/src/main/java/com/vaadin/tests/themes/ButtonsTest.java
uitest/src/main/java/com/vaadin/tests/themes/valo/StringGenerator.java
uitest/src/main/java/com/vaadin/tests/themes/valo/ValoThemeUI.java
uitest/src/main/java/com/vaadin/tests/util/PersonContainer.java
uitest/src/main/java/com/vaadin/tests/util/TestUtils.java
uitest/src/main/java/com/vaadin/tests/validation/FieldErrorIndication.java
uitest/src/main/java/com/vaadin/tests/widgetset/client/grid/EscalatorBasicClientFeaturesWidget.java
uitest/src/main/java/com/vaadin/tests/widgetset/client/v7/grid/GridBasicClientFeaturesWidget.java
uitest/src/main/java/com/vaadin/tests/widgetset/client/v7/grid/GridRendererChangeWidget.java
uitest/src/main/java/com/vaadin/v7/tests/components/grid/GridThemeUI.java
uitest/src/main/java/com/vaadin/v7/tests/components/textarea/TextAreaCursorPosition.java
uitest/src/main/java/com/vaadin/v7/tests/components/textfield/TextChangeEvents.java
uitest/src/main/java/com/vaadin/v7/tests/components/textfield/TextChangeEvents2.java
uitest/src/main/java/com/vaadin/v7/tests/components/tree/SimpleTree.java
uitest/src/test/java/com/vaadin/tests/components/combobox/ComboBoxIdenticalItemsTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/GridDetailsLocationTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/basicfeatures/escalator/EscalatorSpacerTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridBasicDetailsTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorTest.java
uitest/src/test/java/com/vaadin/tests/components/grid/basics/GridEditorUnbufferedTest.java
uitest/src/test/java/com/vaadin/tests/components/nativeselect/NativeSelectCaptionGenerationTest.java
uitest/src/test/java/com/vaadin/tests/elements/combobox/ComboBoxInputNotAllowedTest.java
uitest/src/test/java/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java
uitest/src/test/java/com/vaadin/tests/tooltip/MenuBarTooltipTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/GridDetailsLocationTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridDetailsClientTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/client/GridEditorClientTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridColumnVisibilityTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridDetailsServerTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridEditorTest.java
uitest/src/test/java/com/vaadin/v7/tests/components/grid/basicfeatures/server/GridEditorUnbufferedTest.java

index 20fbe205b7247d48723f134c650f5cd320cd501d..1c6b02268c43946003a8342690c9cd91eacd5576 100644 (file)
@@ -147,7 +147,7 @@ public class CompileTheme {
             return;
         }
 
-        String[] parameters = new String[] { "--sprite-png-depth", "AUTO",
+        String[] parameters = { "--sprite-png-depth", "AUTO",
                 "--css-file-suffix", "-sprite", "--css-file-encoding", "UTF-8",
                 "--root-dir-path", themeFolder + File.separator + themeName,
                 "--log-level", "WARN" };
index d17dccbb3d08173753659d62e080bac805a57748..2f6460255782dfeb08e23edfecc93a7aeb4bd1c5 100644 (file)
@@ -145,7 +145,7 @@ public class ConnectorBundle {
 
         JClassType serializerInterface = oracle
                 .findType(JSONSerializer.class.getName());
-        JType[] deserializeParamTypes = new JType[] {
+        JType[] deserializeParamTypes = {
                 oracle.findType(
                         com.vaadin.client.metadata.Type.class.getName()),
                 oracle.findType(JsonValue.class.getName()),
index bc07836b89c941dd296ae04234a3b156d053c649..5ab6b8a64d68374e218eb7a85cc6890057521622 100644 (file)
@@ -569,7 +569,7 @@ public class Profiler {
         if (isEnabled()) {
             double now = Duration.currentTimeMillis();
 
-            String[] keys = new String[] { "navigationStart",
+            String[] keys = { "navigationStart",
                     "unloadEventStart", "unloadEventEnd", "redirectStart",
                     "redirectEnd", "fetchStart", "domainLookupStart",
                     "domainLookupEnd", "connectStart", "connectEnd",
index 3abc848187d63c7b77a41c4144c92eb4a1d86a44..274255554b99dfb567be3a6bd8fbeae64207dd7b 100644 (file)
@@ -786,12 +786,12 @@ public final class VDebugWindow extends VOverlay {
     protected class Menu extends VOverlay {
         FlowPanel content = new FlowPanel();
 
-        DebugButton[] sizes = new DebugButton[] {
+        DebugButton[] sizes = {
                 new DebugButton(null, "Small", "A"),
                 new DebugButton(null, "Medium", "A"),
                 new DebugButton(null, "Large", "A") };
 
-        DebugButton[] modes = new DebugButton[] {
+        DebugButton[] modes = {
                 new DebugButton(Icon.DEVMODE_OFF,
                         "Debug only (causes page reload)"),
                 new DebugButton(Icon.DEVMODE_ON,
index 386d1efc37fa979857b1317634c1e7071e515972..dc3933b2ffbef8905ec73001d447570ebaa24d26 100644 (file)
@@ -117,7 +117,7 @@ public class JavaScriptManagerConnector extends AbstractExtensionConnector {
     }-*/;
 
     public void sendRpc(String name, JsArray<JavaScriptObject> arguments) {
-        Object[] parameters = new Object[] { name, Util.jso2json(arguments) };
+        Object[] parameters = { name, Util.jso2json(arguments) };
 
         /*
          * Must invoke manually as the RPC interface can't be used in GWT
index d12a233e73b7f0110500e9f21a3a3f3e596a99da..8abc85209371be736e13f2ff6417579f4892091e 100644 (file)
@@ -448,7 +448,7 @@ public class VDragAndDropWrapper extends VCustomComponent
 
     }
 
-    protected String[] acceptedTypes = new String[] { "Text", "Url",
+    protected String[] acceptedTypes = { "Text", "Url",
             "text/html", "text/plain", "text/rtf" };
 
     private boolean isAcceptedType(String type) {
index c837570c85d8f00cd7c4bfbd3272bdc4672a5dda..f33b71841de67c9a5095b54b7320b9314e1c950f 100644 (file)
@@ -406,10 +406,10 @@ public class LayoutDependencyTree {
     private final FastStringMap<LayoutDependency>[] dependenciesInDirection = new FastStringMap[] {
             FastStringMap.create(), FastStringMap.create() };
 
-    private final FastStringSet[] measureQueueInDirection = new FastStringSet[] {
+    private final FastStringSet[] measureQueueInDirection = {
             FastStringSet.create(), FastStringSet.create() };
 
-    private final FastStringSet[] layoutQueueInDirection = new FastStringSet[] {
+    private final FastStringSet[] layoutQueueInDirection = {
             FastStringSet.create(), FastStringSet.create() };
 
     private final ApplicationConnection connection;
index 10c1de75e6451727e07e76e1d2eb391e255ec0de..d235ddeca39eb0cd4e6e1e5c3820ec75b405c1eb 100644 (file)
@@ -275,7 +275,7 @@ public class VRichTextToolbar extends Composite {
         }
     }
 
-    private static final RichTextArea.FontSize[] fontSizesConstants = new RichTextArea.FontSize[] {
+    private static final RichTextArea.FontSize[] fontSizesConstants = {
             RichTextArea.FontSize.XX_SMALL, RichTextArea.FontSize.X_SMALL,
             RichTextArea.FontSize.SMALL, RichTextArea.FontSize.MEDIUM,
             RichTextArea.FontSize.LARGE, RichTextArea.FontSize.X_LARGE,
index 1473af44ae3ce5f01986dd688375b18c9625e517..b901cadf241022d5adb8efc2d9630dba5c1a442b 100644 (file)
@@ -8,7 +8,7 @@ import com.vaadin.shared.util.SharedUtil;
 
 public class ApplicationConnectionURLGenerationTest {
 
-    private static final String[] URIS = new String[] {
+    private static final String[] URIS = {
             "http://demo.vaadin.com/", //
             "https://demo.vaadin.com/", "http://demo.vaadin.com/foo",
             "http://demo.vaadin.com/foo?f", "http://demo.vaadin.com/foo?f=1",
@@ -20,7 +20,7 @@ public class ApplicationConnectionURLGenerationTest {
             "http://vaadin.com/directory?p_p_id=Directory_WAR_Directory&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=UIDL&p_p_cacheability=cacheLevelPage&p_p_col_id=row-1&p_p_col_count=1",
 
     };
-    private static final String[] URIS_WITH_ABCD_PARAM = new String[] {
+    private static final String[] URIS_WITH_ABCD_PARAM = {
             "http://demo.vaadin.com/?a=b&c=d",
             "https://demo.vaadin.com/?a=b&c=d",
             "http://demo.vaadin.com/foo?a=b&c=d",
@@ -33,7 +33,7 @@ public class ApplicationConnectionURLGenerationTest {
 
     };
 
-    private static final String[] URIS_WITH_ABCD_PARAM_AND_FRAGMENT = new String[] {
+    private static final String[] URIS_WITH_ABCD_PARAM_AND_FRAGMENT = {
             "http://demo.vaadin.com/?a=b&c=d#fragment",
             "https://demo.vaadin.com/?a=b&c=d#fragment",
             "http://demo.vaadin.com/foo?a=b&c=d#fragment",
index 736c5d873fd9697e03e2c3f7952d96fc594abd6f..9ef922b364877b2eaaec8c3a6c9379851a7a9f70 100644 (file)
@@ -592,7 +592,7 @@ public class WeekGrid extends SimplePanel {
             } else {
                 // FIXME Use dts.getAmPmStrings(); and make sure that
                 // DateTimeService has a some Locale set.
-                String[] ampm = new String[] { "AM", "PM" };
+                String[] ampm = { "AM", "PM" };
 
                 int amStop = (lastHour < 11) ? lastHour : 11;
                 int pmStart = (firstHour > 11) ? firstHour % 11 : 0;
index fcb189dfd7ea30c518f034c04a1e72ad7e223f24..8f52f281f9a57edc44b42f45cb3cb7dbba8f8f84 100644 (file)
@@ -275,7 +275,7 @@ public class VRichTextToolbar extends Composite {
         }
     }
 
-    private static final RichTextArea.FontSize[] fontSizesConstants = new RichTextArea.FontSize[] {
+    private static final RichTextArea.FontSize[] fontSizesConstants = {
             RichTextArea.FontSize.XX_SMALL, RichTextArea.FontSize.X_SMALL,
             RichTextArea.FontSize.SMALL, RichTextArea.FontSize.MEDIUM,
             RichTextArea.FontSize.LARGE, RichTextArea.FontSize.X_LARGE,
index e11e0d11aa60dfa93e67e36182c203dde721e8b3..b38cc404d885ee44acf1fd2444557b8683344ce7 100644 (file)
@@ -2751,7 +2751,7 @@ public class Escalator extends Widget
                  *
                  * If more rows were added than the new escalator rows can
                  * account for, we need to start to spin the escalator to update
-                 * the remaining rows aswell.
+                 * the remaining rows as well.
                  */
                 final int rowsStillNeeded = numberOfRows - addedRows.size();
 
index 33635004ef8581a0fc4d083291e6e0a11c9283c8..d672ad5b82a8dd0cd5d8f536f53483ebbaa13c0c 100644 (file)
@@ -116,9 +116,10 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory {
         return null;
     }
 
+    @SuppressWarnings("unchecked")
     private <T extends Field> T createDateField(Class<?> type,
             Class<T> fieldType) {
-        AbstractField field;
+        AbstractField<?> field;
 
         if (InlineDateField.class.isAssignableFrom(fieldType)) {
             field = new InlineDateField();
index dd1f28305d9c3b4e9bca30f93f3e3d6f092dd73a..1799bdc72e9b84fc627faff5a50d56dc413f48ca 100644 (file)
@@ -103,7 +103,7 @@ public class FilesystemContainer implements Container.Hierarchical {
         }
     }
 
-    private File[] roots = new File[] {};
+    private File[] roots = {};
 
     private FilenameFilter filter = null;
 
index 4eb44994aa30d65dcd5c64ab1d1d88e164475bbb..653ad3f6bf0bc2417d49912fe599533553f43306 100644 (file)
@@ -1766,7 +1766,7 @@ public abstract class AbstractField<T> extends AbstractLegacyComponent
     @Override
     public void writeDesign(Element design, DesignContext designContext) {
         super.writeDesign(design, designContext);
-        AbstractField def = (AbstractField) designContext
+        AbstractField<?> def = designContext
                 .getDefaultInstance(this);
         Attributes attr = design.attributes();
         // handle readonly
index d0ad5699883b8e05af95a235b6fa7f931c9611e2..62452e974d577dd2fd9d15c6c7d1d3da4641df52 100644 (file)
@@ -107,7 +107,7 @@ public class SerializerHelper {
      * List of primitive classes. Google App Engine has problems
      * serializing/deserializing these (#3064).
      */
-    private static final Class<?>[] primitiveClasses = new Class<?>[] {
+    private static final Class<?>[] primitiveClasses = {
             byte.class, short.class, int.class, long.class, float.class,
             double.class, boolean.class, char.class };
 
index 775018642a53381cf1ed5bec4f06b1f91dfa6995..2d49ea52750e1a813360843548a1c8b6604ac068 100644 (file)
@@ -46,10 +46,10 @@ public class PropertyFormatterTest {
     @SuppressWarnings({ "rawtypes" })
     public void testCorrectTypeForFormat()
             throws InstantiationException, IllegalAccessException {
-        Class[] testedTypes = new Class[] { Integer.class, Boolean.class,
+        Class[] testedTypes = { Integer.class, Boolean.class,
                 Double.class, String.class, Date.class };
-        Object[] testValues = new Object[] { new Integer(3), Boolean.FALSE,
-                new Double(3.3), "bar", new Date() };
+        Object[] testValues = { 3, false,
+                3.3D, "bar", new Date() };
 
         int i = 0;
         for (Class class1 : testedTypes) {
index d9544e3e8223c14bb60596c43a67801c7c27b1b0..9ad0c65f1a9ae1fd7c4993047d9d4b38a67c6fd4 100644 (file)
@@ -45,10 +45,10 @@ public class BeanItemContainerSortTest {
         }
     }
 
-    String[] names = new String[] { "Antti", "Ville", "Sirkka", "Jaakko",
+    String[] names = { "Antti", "Ville", "Sirkka", "Jaakko",
             "Pekka", "John" };
-    int[] ages = new int[] { 10, 20, 50, 12, 64, 67 };
-    String[] sortedByAge = new String[] { names[0], names[3], names[1],
+    int[] ages = { 10, 20, 50, 12, 64, 67 };
+    String[] sortedByAge = { names[0], names[3], names[1],
             names[2], names[4], names[5] };
 
     public BeanItemContainer<Person> getContainer() {
index d39d6048526092a4c9dc4e1f6dec25e88a6112bb..431829554798c475f30b906fa4e0a0731156fbdb 100644 (file)
@@ -222,7 +222,7 @@ public class SQLContainerTableQueryTest {
         RowId two = new RowId(new Object[] { 2 + offset });
         RowId three = new RowId(new Object[] { 3 + offset });
         if (SQLTestsConstants.db == DB.ORACLE) {
-            String[] correct = new String[] { "1", "2", "3", "4" };
+            String[] correct = { "1", "2", "3", "4" };
             List<String> oracle = new ArrayList<String>();
             for (Object o : itemIds) {
                 oracle.add(o.toString());
index 3346bd245aa7c2f848a2468583c389f092208ecf..f858bde4ac61efc0b94ceaa5c7b16209ba0051e6 100644 (file)
@@ -211,7 +211,7 @@ public class SQLContainerTest {
         RowId two = new RowId(new Object[] { 2 + offset });
         RowId three = new RowId(new Object[] { 3 + offset });
         if (SQLTestsConstants.db == DB.ORACLE) {
-            String[] correct = new String[] { "1", "2", "3", "4" };
+            String[] correct = { "1", "2", "3", "4" };
             List<String> oracle = new ArrayList<String>();
             for (Object o : itemIds) {
                 oracle.add(o.toString());
index 1ffc7a020eb53cfe91b7cd9513dbe8640a6c7a8f..334114a41ad710d2e287a05e8ebac5eb4bb3ef24 100644 (file)
@@ -58,7 +58,7 @@ public class StringToByteConverterTest {
 
     @Test
     public void testValueOutOfRange() {
-        Double[] values = new Double[] { Byte.MAX_VALUE * 2.0,
+        Double[] values = { Byte.MAX_VALUE * 2.0,
                 Byte.MIN_VALUE * 2.0, Long.MAX_VALUE * 2.0,
                 Long.MIN_VALUE * 2.0 };
 
index 0cc8e646dcdbf9db1f596284c876a96f3b9c73f8..7d2f9c8d7d526f9b55a1573b4737bd70fc425927 100644 (file)
@@ -24,7 +24,7 @@ public class StringToIntegerConverterTest {
 
     @Test
     public void testValueOutOfRange() {
-        Double[] values = new Double[] { Integer.MAX_VALUE * 2.0,
+        Double[] values = { Integer.MAX_VALUE * 2.0,
                 Integer.MIN_VALUE * 2.0, Long.MAX_VALUE * 2.0,
                 Long.MIN_VALUE * 2.0 };
 
index a2a7332fd1e128eee7994abebfec4bb9609d1e9e..fed000555cb6ee23d49f8d288f09a5dbdc5d1758 100644 (file)
@@ -58,7 +58,7 @@ public class StringToShortConverterTest {
 
     @Test
     public void testValueOutOfRange() {
-        Double[] values = new Double[] { Integer.MAX_VALUE * 2.0,
+        Double[] values = { Integer.MAX_VALUE * 2.0,
                 Integer.MIN_VALUE * 2.0, Long.MAX_VALUE * 2.0,
                 Long.MIN_VALUE * 2.0 };
 
index 48d6baeaf660c5c54850c9c5006db0c73a3f30d9..2c14fb9512ebacbc2eb483a6d5ea94002a72b1bc 100644 (file)
@@ -234,7 +234,7 @@ public class GridColumnsTest {
     public void testReorderColumns() {
         Set<?> containerProperties = new LinkedHashSet<Object>(
                 grid.getContainerDataSource().getContainerPropertyIds());
-        Object[] properties = new Object[] { "column3", "column2", "column6" };
+        Object[] properties = { "column3", "column2", "column6" };
         grid.setColumnOrder(properties);
 
         int i = 0;
index ebe6d37deca6696421dd36fe99560f35bb2bfa5d..ee3afb1268369a9109e3593ae5fcf9c78e4ec488 100644 (file)
@@ -26,7 +26,7 @@ public class CacheUpdateExceptionCausesTest {
     @Test
     public void testSingleCauseException() {
         Table table = new Table();
-        Throwable[] causes = new Throwable[] {
+        Throwable[] causes = {
                 new RuntimeException("Broken in one way.") };
 
         CacheUpdateException exception = new CacheUpdateException(table,
@@ -40,7 +40,7 @@ public class CacheUpdateExceptionCausesTest {
     @Test
     public void testMultipleCauseException() {
         Table table = new Table();
-        Throwable[] causes = new Throwable[] {
+        Throwable[] causes = {
                 new RuntimeException("Broken in the first way."),
                 new RuntimeException("Broken in the second way.") };
 
index 11fd3429dbfc798f4babf6ef5ec709e80c95fd6c..a8cd0bf44af1af76779b6c9a13a4d08ece4a587f 100644 (file)
@@ -28,7 +28,7 @@ public class TableColumnAlignmentsTest {
         int properties = 5;
         Table t = TableGeneratorTest.createTableWithDefaultContainer(properties,
                 10);
-        Align[] explicitAlignments = new Align[] { Align.CENTER, Align.LEFT,
+        Align[] explicitAlignments = { Align.CENTER, Align.LEFT,
                 Align.RIGHT, Align.RIGHT, Align.LEFT };
 
         t.setColumnAlignments(explicitAlignments);
@@ -40,7 +40,7 @@ public class TableColumnAlignmentsTest {
     @Test
     public void invalidColumnAlignmentStrings() {
         Table t = TableGeneratorTest.createTableWithDefaultContainer(3, 7);
-        Align[] defaultAlignments = new Align[] { Align.LEFT, Align.LEFT,
+        Align[] defaultAlignments = { Align.LEFT, Align.LEFT,
                 Align.LEFT };
         try {
             t.setColumnAlignments(new Align[] { Align.RIGHT, Align.RIGHT });
@@ -58,7 +58,7 @@ public class TableColumnAlignmentsTest {
     @Test
     public void columnAlignmentForPropertyNotInContainer() {
         Table t = TableGeneratorTest.createTableWithDefaultContainer(3, 7);
-        Align[] defaultAlignments = new Align[] { Align.LEFT, Align.LEFT,
+        Align[] defaultAlignments = { Align.LEFT, Align.LEFT,
                 Align.LEFT };
         try {
             t.setColumnAlignment("Property 1200", Align.LEFT);
@@ -82,7 +82,7 @@ public class TableColumnAlignmentsTest {
     @Test
     public void invalidColumnAlignmentsLength() {
         Table t = TableGeneratorTest.createTableWithDefaultContainer(7, 7);
-        Align[] defaultAlignments = new Align[] { Align.LEFT, Align.LEFT,
+        Align[] defaultAlignments = { Align.LEFT, Align.LEFT,
                 Align.LEFT, Align.LEFT, Align.LEFT, Align.LEFT, Align.LEFT };
 
         try {
@@ -124,10 +124,10 @@ public class TableColumnAlignmentsTest {
         int properties = 5;
         Table t = TableGeneratorTest.createTableWithDefaultContainer(properties,
                 10);
-        Align[] explicitAlignments = new Align[] { Align.CENTER, Align.LEFT,
+        Align[] explicitAlignments = { Align.CENTER, Align.LEFT,
                 Align.RIGHT, Align.RIGHT, Align.LEFT };
 
-        Align[] currentAlignments = new Align[] { Align.LEFT, Align.LEFT,
+        Align[] currentAlignments = { Align.LEFT, Align.LEFT,
                 Align.LEFT, Align.LEFT, Align.LEFT };
 
         for (int i = 0; i < properties; i++) {
index 5e7fb81848d1003439b338b06eae25db168cf612..7190203aa935c1961abfca1403fb8e27894fcacb 100644 (file)
@@ -8,7 +8,7 @@ import com.vaadin.v7.ui.Table;
 
 public class TableVisibleColumnsTest {
 
-    String[] defaultColumns3 = new String[] { "Property 0", "Property 1",
+    String[] defaultColumns3 = { "Property 0", "Property 1",
             "Property 2" };
 
     @Test
@@ -28,7 +28,7 @@ public class TableVisibleColumnsTest {
     @Test
     public void explicitVisibleColumns() {
         Table t = TableGeneratorTest.createTableWithDefaultContainer(5, 10);
-        Object[] newVisibleColumns = new Object[] { "Property 1",
+        Object[] newVisibleColumns = { "Property 1",
                 "Property 2" };
         t.setVisibleColumns(newVisibleColumns);
         assertArrayEquals("Explicit visible columns, 5 properties",
index 70e77e71f7380e7fa6f80d285d8851c09574e757..a0bb648ffb188155575fccd300d4555df3846acb 100644 (file)
@@ -1257,7 +1257,7 @@ public abstract class AbstractComponent extends AbstractClientConnector
         return l;
     }
 
-    private static final String[] customAttributes = new String[] { "width",
+    private static final String[] customAttributes = { "width",
             "height", "debug-id", "error", "width-auto", "height-auto",
             "width-full", "height-full", "size-auto", "size-full", "immediate",
             "locale", "read-only", "_id" };
index 6deb1c1af67fc46221e849b0f9efe314cb9b54f6..0004421f8c13ab52230382f132dafc35a1351c5a 100644 (file)
@@ -8,7 +8,7 @@ import java.util.Random;
 
 public class StrBean implements Serializable {
 
-    private static final String[] values = new String[] { "Foo", "Bar", "Baz" };
+    private static final String[] values = { "Foo", "Bar", "Baz" };
 
     private String value;
     private final int id;
index dbcb9d6ba0fba06136e73d1b7a137d184573925b..8ea4e7a558c03dd186c2cd18411926e26f480131 100644 (file)
@@ -22,7 +22,7 @@ public class StringToIntegerConverterTest extends AbstractConverterTest {
 
     @Test
     public void testValueOutOfRange() {
-        Double[] values = new Double[] { Integer.MAX_VALUE * 2.0,
+        Double[] values = { Integer.MAX_VALUE * 2.0,
                 Integer.MIN_VALUE * 2.0, Long.MAX_VALUE * 2.0,
                 Long.MIN_VALUE * 2.0 };
 
index 36e54a2826e4ec732072b6217050564c2bab0ff8..7ea028a594ca552b3087dfaa400611fb41b690bb 100644 (file)
@@ -18,7 +18,7 @@ import com.vaadin.ui.VerticalLayout;
 
 public class AddComponentsTest {
 
-    Component[] children = new Component[] { new Label("A"), new Label("B"),
+    Component[] children = { new Label("A"), new Label("B"),
             new Label("C"), new Label("D") };
 
     @Test
index f2c4b116898dd26f78b5ff7d7b4a793588746f24..35c28eba17dc480f2024a5bfddf3cf9973503921 100644 (file)
@@ -42,7 +42,7 @@ import com.vaadin.ui.ComboBox;
  * @author Vaadin Ltd
  */
 public class ComboBoxFilteringTest {
-    private static final String[] PERSON_NAMES = new String[] {
+    private static final String[] PERSON_NAMES = {
             "Enrique Iglesias", "Henry Dunant", "Erwin Engelbrecht" };
 
     private ComboBox<Person> comboBox;
index 9fe1e4210ae474029191545f8c352d5771d5c66a..ac571fd7ace199f3f5b305e3efc0e85f0b9c2815 100644 (file)
@@ -16,7 +16,7 @@ import com.vaadin.ui.Layout;
 
 public class AddComponentsTest {
 
-    private final Component[] children = new Component[] { new Label("A"),
+    private final Component[] children = { new Label("A"),
             new Label("B"), new Label("C"), new Label("D") };
 
     @Test
index 64b466612f9aeb299c3b8508b84d193ead3209ac..414768d028ad3dcfd0b6c6f5dc73cbf27e367cdc 100644 (file)
@@ -16,7 +16,7 @@ import com.vaadin.ui.Label;
 import com.vaadin.ui.Layout;
 
 public class GridLayoutTest {
-    Component[] children = new Component[] { new Label("A"), new Label("B"),
+    Component[] children = { new Label("A"), new Label("B"),
             new Label("C"), new Label("D") };
 
     @Test
index 29dfd08212065f68510527ce12211a4a633321d7..53bb87717f1c74c59414aa72ec0262590930a44d 100644 (file)
@@ -43,7 +43,7 @@ public class FormLayoutTest extends AbstractIndexedLayoutTestBase {
         return getLayout().getComponentCount();
     }
 
-    Component[] children = new Component[] { new Label("A"), new Label("B"),
+    Component[] children = { new Label("A"), new Label("B"),
             new Label("C"), new Label("D") };
 
     @Test
index 31e1c53ec6c6c16939b0e8efc27c4111ae83e8dc..636c226e6613cb8242532142fc1cb8f9d9f4faff 100644 (file)
@@ -898,7 +898,7 @@ public class NavigatorTest {
 
         };
 
-        final int[] count = new int[] { 0 };
+        final int[] count = { 0 };
         Navigator navigator = new Navigator(createMockUI(), manager,
                 EasyMock.createMock(ViewDisplay.class)) {
             @Override
index 400105567d33b7850e78bb4079e973e4de78532e..deafe8368e27d69b226d02f57629844d0a59f080 100644 (file)
@@ -73,7 +73,7 @@ public class AbstractListingTest {
         }
     }
 
-    private static final String[] ITEM_ARRAY = new String[] { "Foo", "Bar",
+    private static final String[] ITEM_ARRAY = { "Foo", "Bar",
             "Baz" };
 
     private TestListing listing;
index cbf8d676dd6afa64b0ae7dbaa68f8a4c5d6d1922..9403b5a82e6846cbab2237c1da2e0d39f9ef4e1e 100644 (file)
@@ -64,7 +64,7 @@ public class StressComponentsInTable extends CustomComponent {
         return t;
     }
 
-    static String[] testString = new String[] { "Jacob", "Michael", "Joshua",
+    static String[] testString = { "Jacob", "Michael", "Joshua",
             "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher",
             "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas",
             "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel",
index d96ef91672e42863c566c68f48950ce20ce9f137..b8d498ef7ca2d180ee38275ab66a98555b31dfa6 100644 (file)
@@ -37,10 +37,10 @@ import com.vaadin.v7.ui.TwinColSelect;
  */
 public class TestForPreconfiguredComponents extends CustomComponent {
 
-    private static final String[] firstnames = new String[] { "John", "Mary",
+    private static final String[] firstnames = { "John", "Mary",
             "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
 
-    private static final String[] lastnames = new String[] { "Torvalds",
+    private static final String[] lastnames = { "Torvalds",
             "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding",
             "Einstein" };
 
index 017e1b54c68e2de445ab78c9f60c35f69cd04094..bec14f12ef9a4a362b60e88cc57f98ca62d2322c 100644 (file)
@@ -155,7 +155,7 @@ public class TestForTablesInitialColumnWidthLogicRendering
         return t;
     }
 
-    static String[] testString = new String[] { "Jacob", "Michael", "Joshua",
+    static String[] testString = { "Jacob", "Michael", "Joshua",
             "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher",
             "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas",
             "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel",
index 418fd08592030cc723293272e9d3855bde08f53e..c5e8376c0f6ec434620c1ed1039089cf5f881e14 100644 (file)
@@ -37,16 +37,16 @@ import com.vaadin.v7.ui.Tree;
  */
 public class TestForTrees extends CustomComponent implements Handler {
 
-    private static final String[] firstnames = new String[] { "John", "Mary",
+    private static final String[] firstnames = { "John", "Mary",
             "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
 
-    private static final String[] lastnames = new String[] { "Torvalds",
+    private static final String[] lastnames = { "Torvalds",
             "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding",
             "Einstein" };
 
     private final VerticalLayout main = new VerticalLayout();
 
-    private final Action[] actions = new Action[] { new Action("edit"),
+    private final Action[] actions = { new Action("edit"),
             new Action("delete") };
 
     private VerticalLayout al;
index 50d491ae9653621f0a0e05ea7d0965e93276d390..dccfbaa1e1116f89fa8aace0173cc7213909ff91 100644 (file)
@@ -54,7 +54,7 @@ public class UsingCustomNewItemHandlerInSelect extends CustomComponent {
     }
 
     public void populateSelect() {
-        final String[] names = new String[] { "John", "Mary", "Joe", "Sarah",
+        final String[] names = { "John", "Mary", "Joe", "Sarah",
                 "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
         for (int j = 0; j < 4; j++) {
             Integer id = new Integer(sequence++);
index a296e3342de02e2e5f3d7bd08bab04c5b74987f1..76396799bb0743863375b8f7360b90d6214da74f 100644 (file)
@@ -64,9 +64,9 @@ public class UsingObjectsInSelect extends com.vaadin.server.LegacyApplication
     }
 
     public void createExampleTasks() {
-        final String[] assignedTo = new String[] { "John", "Mary", "Joe",
+        final String[] assignedTo = { "John", "Mary", "Joe",
                 "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
-        final String[] type = new String[] { "Enhancement", "Bugfix", "Testing",
+        final String[] type = { "Enhancement", "Bugfix", "Testing",
                 "Task" };
         for (int j = 0; j < 100; j++) {
             final Task task = new Task(
index dac4584a631b2252a7b623ea16ed26209b81dbbe..d5fe3fe6a0241f27a45849466934ad8e0bc8b379 100644 (file)
@@ -18,10 +18,7 @@ public class ActionsWithoutKeyCode extends AbstractTestUIWithLog {
 
         addActionHandler(new Action.Handler() {
 
-            private Action[] actions;
-            {
-                actions = new Action[] { new Action("test1") };
-            }
+            private Action[] actions = { new Action("test1") };
 
             @Override
             public Action[] getActions(Object target, Object sender) {
index dccb25c3810be31c5b89794de8f2cdc54b34903a..9ce27212e775ffc85e721e503f8abb30027f2c12 100644 (file)
@@ -223,7 +223,7 @@ public class Calc extends AbstractReindeerTestUI {
 
         // The operations for the calculator in the order they appear on the
         // screen (left to right, top to bottom)
-        String[] operations = new String[] { "7", "8", "9", "/", "4", "5", "6",
+        String[] operations = { "7", "8", "9", "/", "4", "5", "6",
                 "*", "1", "2", "3", "-", "0", "=", "C", "+" };
 
         for (String caption : operations) {
index c3a8fcbbf5769a9a42a31ebdf5f814d611440945..b34fcad46d9fbec603c8ab820718e695691381bc 100644 (file)
@@ -313,7 +313,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
         // addCommands.put("HorizontalLayout", addHorizontalLayoutCommand);
         // addCommands.put("VerticalLayout", addVerticalLayoutCommand);
 
-        ComponentSize[] sizes = new ComponentSize[] {
+        ComponentSize[] sizes = {
                 new ComponentSize(null, null), new ComponentSize("200px", null),
                 new ComponentSize("100%", null),
                 new ComponentSize(null, "200px"),
@@ -344,7 +344,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
         String heightCategory = "Change component height";
         createCategory(heightCategory, category);
 
-        String[] options = new String[] { "100px", "200px", "50%", "100%" };
+        String[] options = { "100px", "200px", "50%", "100%" };
         for (int i = 0; i < 20; i++) {
             String componentWidthCategory = "Component " + i + " width";
             String componentHeightCategory = "Component " + i + " height";
index 95f3138e69b1583dd1b86ecbc2ab48595504d710..bcb899c66ca6cf0d06b2c5b0a8ffef949605d563 100644 (file)
@@ -82,7 +82,7 @@ public class DisableEnableCascade extends TestBase {
 
     @Override
     protected String getDescription() {
-        return "Tests the disable state is cascaded correctly to children. Disabling a parent should disabled its children aswell. The buttons only toggle the state of the target component.";
+        return "Tests the disable state is cascaded correctly to children. Disabling a parent should disabled its children as well. The buttons only toggle the state of the target component.";
     }
 
     @Override
index 3b331a23df454692cdce0f7c7e7d6c54e54feb71..44ba18cb8bb27f33bf9bb14cac2a7128f02db884 100644 (file)
@@ -189,7 +189,7 @@ public class TouchScrollables extends TestBase {
 
         table.addActionHandler(new Handler() {
 
-            Action[] actions = new Action[] { new Action("FOO"),
+            Action[] actions = { new Action("FOO"),
                     new Action("BAR"), new Action("CAR") };
 
             @Override
index c97e69bd68c408b1939ba112f806cfe7c520a59e..e25ab542e61cded5b2f296859712503bfc89bc06 100644 (file)
@@ -16,7 +16,7 @@ public class IconsInCaption extends TestBase {
     private static final String TYPE_EMBEDDED = "Embedded";
     private static final String TYPE_CAPTION = "In caption";
 
-    private static final String[] icons = new String[] { "arrow-down.png",
+    private static final String[] icons = { "arrow-down.png",
             "arrow-left.png", "arrow-right.png", "arrow-up.png",
             "attention.png", "calendar.png", "cancel.png", "document.png",
             "document-add.png", "document-delete.png", "document-doc.png",
@@ -27,7 +27,7 @@ public class IconsInCaption extends TestBase {
             "lock.png", "note.png", "ok.png", "reload.png", "settings.png",
             "trash.png", "trash-full.png", "user.png", "users.png" };
 
-    private static final String[] sizes = new String[] { "16", "32", "64" };
+    private static final String[] sizes = { "16", "32", "64" };
 
     private ComponentContainer container = new VerticalLayout();
 
index 9ea835aac53665fba42e3aa9af7409b1e11b599d..c6655372503c185262c08212a6ac03faf02a3ea3 100644 (file)
@@ -9,7 +9,7 @@ import com.vaadin.v7.shared.ui.combobox.FilteringMode;
 import com.vaadin.v7.ui.ComboBox;
 
 public class ComboBoxCombinedWithEnterShortcut extends TestBase {
-    final String[] cities = new String[] { "Berlin", "Brussels", "Helsinki",
+    final String[] cities = { "Berlin", "Brussels", "Helsinki",
             "Madrid", "Oslo", "Paris", "Stockholm" };
 
     private Log log = new Log(5);
index c35aa2a06a0e7def2f37f68992e3b8928194e516..f43ba264be516375c5238f9781a89777c52ecef8 100644 (file)
@@ -11,7 +11,7 @@ import com.vaadin.ui.ComboBox;
 @Widgetset("com.vaadin.DefaultWidgetSet")
 public class ComboBoxVaadinIcons extends AbstractTestUI {
 
-    public static final VaadinIcons[] icons = new VaadinIcons[] {
+    public static final VaadinIcons[] icons = {
             VaadinIcons.AMBULANCE, VaadinIcons.PAPERPLANE,
             VaadinIcons.AIRPLANE };
 
index ac11263bfc8f24e697df768870ae9470127c3a42..daae32327a18f04538fc316d40517264fd21ce4f 100644 (file)
@@ -13,7 +13,7 @@ import com.vaadin.ui.DateField;
 @SuppressWarnings("serial")
 public class DateFields extends ComponentTestCase<DateField> {
 
-    private static final Locale[] LOCALES = new Locale[] { Locale.US,
+    private static final Locale[] LOCALES = { Locale.US,
             Locale.TAIWAN, new Locale("fi", "FI") };
 
     @Override
index a49edc1e699fe978fb3dde92e9175026d71d49d8..02da061d0814137b1a5606584738b9fb4e124329 100644 (file)
@@ -13,7 +13,7 @@ import com.vaadin.ui.InlineDateField;
 @SuppressWarnings("serial")
 public class InlineDateFields extends ComponentTestCase<InlineDateField> {
 
-    private static final Locale[] LOCALES = new Locale[] { Locale.US,
+    private static final Locale[] LOCALES = { Locale.US,
             Locale.TAIWAN, new Locale("fi", "FI") };
 
     @Override
index a22fc6aaea04d2e3b8225f63c7a898bc999e339c..05e82b71928a6100a01596eca6adacc9cfdd27cf 100644 (file)
@@ -23,7 +23,7 @@ public class GridRefreshRow extends AbstractTestUIWithLog {
     private PersonContainer container;
     private Grid grid;
 
-    private boolean styles[] = new boolean[] { false, false, false };
+    private boolean styles[] = { false, false, false };
 
     @Override
     protected void setup(VaadinRequest request) {
index 3d8b29a4c95d515ed0d9bb39c2c3bfd863be3eea..8ffe3abadd561707feddd64d10d0d58bdf187a44 100644 (file)
@@ -245,26 +245,26 @@ public class VaadinTunesLayout extends AbstractReindeerTestUI {
                 new NativeSelect());
 
         // Lets populate the table with random data
-        String[] tracks = new String[] { "Red Flag", "Millstone", "Not The Sun",
+        String[] tracks = { "Red Flag", "Millstone", "Not The Sun",
                 "Breath", "Here We Are", "Deep Heaven", "Her Voice Resides",
                 "Natural Tan", "End It All", "Kings", "Daylight Slaving",
                 "Mad Man", "Resolve", "Teargas", "African Air",
                 "Passing Bird" };
-        String[] times = new String[] { "4:12", "6:03", "5:43", "4:32", "3:42",
+        String[] times = { "4:12", "6:03", "5:43", "4:32", "3:42",
                 "4:45", "2:56", "9:34", "2:10", "3:44", "5:49", "6:30", "5:18",
                 "7:42", "3:13", "2:52" };
-        String[] artists = new String[] { "Billy Talent", "Brand New",
+        String[] artists = { "Billy Talent", "Brand New",
                 "Breaking Benjamin", "Becoming The Archetype",
                 "Bullet For My Valentine", "Chasing Victory", "Chimaira",
                 "Danko Jones", "Deadlock", "Deftones", "From Autumn To Ashes",
                 "Haste The Day", "Four Year Strong", "In Flames", "Kemopetrol",
                 "John Legend" };
-        String[] albums = new String[] { "Once Again", "The Caitiff Choir",
+        String[] albums = { "Once Again", "The Caitiff Choir",
                 "The Devil And God", "Light Grenades", "Dicthonomy",
                 "Back In Black", "Dreamer", "Come Clarity", "Year Zero",
                 "Frames", "Fortress", "Phobia", "The Poison", "Manifesto",
                 "White Pony", "The Big Dirty" };
-        String[] genres = new String[] { "Rock", "Metal", "Hardcore", "Indie",
+        String[] genres = { "Rock", "Metal", "Hardcore", "Indie",
                 "Pop", "Alternative", "Blues", "Jazz", "Hip Hop", "Electronica",
                 "Punk", "Hard Rock", "Dance", "R'n'B", "Gospel", "Country" };
         for (int i = 0; i < 1000; i++) {
index 863fb5aea70a6981aaa31e62cc0299037bd0310d..428b125a8b60ce1df8f0f1fc65a38b0e9dc42d9d 100644 (file)
@@ -19,7 +19,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase {
     private Handler actionHandler = new Handler() {
 
         ShortcutAction save = new ShortcutAction("^Save");
-        private Action[] actions = new Action[] { save };
+        private Action[] actions = { save };
 
         @Override
         public void handleAction(Action action, Object sender, Object target) {
index 5d9e72ea24845df50a99fe2adccd30532cc61503..e784f9b1252ffc9bf93cc41ee988a05aced9de69 100644 (file)
@@ -30,7 +30,7 @@ public class ColumnCollapsingAndColumnExpansion
         table.addActionHandler(new Handler() {
 
             final Action H = new Action("Toggle Col2");
-            final Action[] actions = new Action[] { H };
+            final Action[] actions = { H };
 
             @Override
             public Action[] getActions(Object target, Object sender) {
index d965f654d47305ae402aa855b8745d7a591f0fa7..936289223dc3b5119ecfd1bbd3e97368c80f7b7d 100644 (file)
@@ -53,8 +53,8 @@ public class HiddenColumnsExpandRatios extends TestBase {
 
     private String genValue() {
         Random rnd = new Random();
-        StringBuffer str = new StringBuffer("");
-        String[] strings = new String[] { "foo", "bar", "baz" };
+        StringBuffer str = new StringBuffer();
+        String[] strings = { "foo", "bar", "baz" };
         for (int i = 0; i < 5; i++) {
             str.append(strings[Math.abs(rnd.nextInt() % strings.length)])
                     .append(" ");
index 5732f79b951d258bd722aab329cd540fdce0bc15..4c3dba7ee0c8b897a8289c75d1d50302c03a4814 100644 (file)
@@ -27,7 +27,7 @@ public class SetDataSourceWithPropertyIds extends AbstractReindeerTestUI {
     }
 
     private static final String TABLE_NAME = "JOBS";
-    private static final String[] PK_COLUMN_NAMES = new String[] { "JOB_ID" };
+    private static final String[] PK_COLUMN_NAMES = { "JOB_ID" };
     private static final String SEQUENCE_NAME = "";
     private static final String VERSION_COLUMN_NAME = "";
 
index 0410b23996ef71b3de592bceaa08b29fdc08ca7d..dd88b6cf72c356e466b9cbd5be42a15e3139f985 100644 (file)
@@ -13,7 +13,7 @@ import com.vaadin.v7.ui.Table;
 
 public class TableToggleVisibility extends AbstractTestCase {
 
-    private static final int[] LENGTHS = new int[] { 20, 22, 10 };
+    private static final int[] LENGTHS = { 20, 22, 10 };
 
     @Override
     public void init() {
index 00a5f2311a09030ffe849d048305d9e4d2e744ba..d0d032bf57b5d5b07af4ba7299908f330b82725b 100644 (file)
@@ -9,8 +9,8 @@ import com.vaadin.v7.ui.Table;
 
 public class TableVisibleColumnsUpdate extends AbstractReindeerTestUI {
 
-    private String[] cols1 = new String[] { "p1", "p2", "p3" };
-    private String[] cols2 = new String[] { "p1", "p4", "p3" };
+    private String[] cols1 = { "p1", "p2", "p3" };
+    private String[] cols2 = { "p1", "p4", "p3" };
     private Table table;
 
     @Override
index 3910b3a4f1ab40b968c6f80c11a5c963992bfce6..6fa8511b0aa032e57e5066c76772d1df913a0330 100644 (file)
@@ -158,7 +158,7 @@ public class TabSheetTest<T extends TabSheet> extends
         createCategory(captionCategory, category);
         createCategory(iconCategory, category);
 
-        String captionOptions[] = new String[] { "", "{id}", "Tab {id}",
+        String captionOptions[] = { "", "{id}", "Tab {id}",
                 "A long caption for tab {id}" };
         LinkedHashMap<String, Resource> iconOptions = new LinkedHashMap<>();
         iconOptions.put("-", null);
index c8945e0e389bcc98921028b1b8cc252bb21657d7..815ebc519742518c21f1de9bb14833883a94ace3 100644 (file)
@@ -69,7 +69,7 @@ public class TextChangeEvents extends AbstractTestUIWithLog {
      */
     private class VaadinDeveloperNameField extends TextField
             implements HasValue.ValueChangeListener<String> {
-        private String[] names = new String[] { "Matti Tahvonen",
+        private String[] names = { "Matti Tahvonen",
                 "Marc Englund", "Joonas Lehtinen", "Jouni Koivuviita",
                 "Marko Grönroos", "Artur Signell" };
 
index cef3749a5078678dafc1718b4ade46f17ca5b44e..5c9847663039ba997c586764f961345d213a3e13 100644 (file)
@@ -100,7 +100,7 @@ public class TextFieldsValueChangeMode extends AbstractTestUIWithLog {
      *
      */
     private class VaadinDeveloperNameField extends TextField {
-        private String[] names = new String[] { "Matti Tahvonen",
+        private String[] names = { "Matti Tahvonen",
                 "Marc Englund", "Joonas Lehtinen", "Jouni Koivuviita",
                 "Marko Grönroos", "Artur Signell" };
 
index b18364ccb845916baf3734d7b5cb6a5fdf71d3a3..8796e724bedfee6d516044812150bc6d56e0f282 100644 (file)
@@ -29,7 +29,7 @@ import com.vaadin.ui.VerticalLayout;
 @Widgetset("com.vaadin.DefaultWidgetSet")
 public class TreeBasicFeatures extends AbstractTestUIWithLog {
 
-    public static final double[] ROW_HEIGHTS = new double[] { 35.5d, 72.78d };
+    public static final double[] ROW_HEIGHTS = { 35.5d, 72.78d };
 
     private Tree<HierarchicalTestBean> tree;
     private TreeDataProvider<HierarchicalTestBean> inMemoryDataProvider;
index 4771df9f3ab0386ac035f432c47c3b4030d4a238..2ccb8a821a030a1802f78afa32489485e4d85a3f 100644 (file)
@@ -19,9 +19,9 @@ public class TablesCssTest extends GridLayout {
     private final Action ACTION_MARK = new Action("Mark");
     private final Action ACTION_UNMARK = new Action("Unmark");
     private final Action ACTION_LOG = new Action("Save");
-    private final Action[] ACTIONS_UNMARKED = new Action[] { ACTION_MARK,
+    private final Action[] ACTIONS_UNMARKED = { ACTION_MARK,
             ACTION_LOG };
-    private final Action[] ACTIONS_MARKED = new Action[] { ACTION_UNMARK,
+    private final Action[] ACTIONS_MARKED = { ACTION_UNMARK,
             ACTION_LOG };
 
     public TablesCssTest(TestSampler parent) {
index 2043faa760452b3f195c25404c9daa2a8b09d0e0..25f475018bb33c8361cba766caa81a6cac1ce8a6 100644 (file)
@@ -13,7 +13,7 @@ public class TreeCssTest {
         // Actions for the context menu
         final Action ACTION_ADD = new Action("Add child item");
         final Action ACTION_DELETE = new Action("Delete");
-        final Action[] ACTIONS = new Action[] { ACTION_ADD, ACTION_DELETE };
+        final Action[] ACTIONS = { ACTION_ADD, ACTION_DELETE };
 
         final Tree tree = new Tree();
         tree.setId("tree" + debugIdCounter++);
@@ -48,7 +48,7 @@ public class TreeCssTest {
     }
 
     private HierarchicalContainer createHierarchicalContainer() {
-        String[] itemNames = new String[] { "Foo", "Baar" };
+        String[] itemNames = { "Foo", "Baar" };
 
         HierarchicalContainer hc = new HierarchicalContainer();
         hc.addContainerProperty("NAME", String.class, null);
index 23ef7d5a6dd0920b94235aade4cad96374bcce55..097fa979e06812c67237b231a262895d6454203d 100644 (file)
@@ -24,7 +24,7 @@ public class TreeTableCssTest {
     }
 
     private HierarchicalContainer createHierarchicalContainer() {
-        String[] itemNames = new String[] { "Foo", "Baar" };
+        String[] itemNames = { "Foo", "Baar" };
 
         HierarchicalContainer hc = new HierarchicalContainer();
         hc.addContainerProperty("NAME", String.class, null);
index 683d9b7deb4142b328f65dec12fbd9c16ebee24e..b1843169a29b4b736400d132bf9a0b5a6c380d9f 100644 (file)
@@ -141,7 +141,7 @@ public class DragAndDropUploadAndInteractions extends AbstractTestUIWithLog {
     protected String formatSize(double contentLength) {
         double d = contentLength;
         int suffix = 0;
-        String[] suffixes = new String[] { "B", "KB", "MB", "GB", "TB" };
+        String[] suffixes = { "B", "KB", "MB", "GB", "TB" };
         while (d > 1024) {
             suffix++;
             d /= 1024.0;
index 6b621653d5b6bfccc8f68ec77756a25f3530db2d..9510348c3189fc96707821a50ec87f7d3724d91a 100644 (file)
@@ -55,7 +55,7 @@ public class SubWindowFocusAndBlurListeners extends TestBase {
 
         window.addActionHandler(new Handler() {
 
-            private Action[] s = new Action[] { new ShortcutAction("^Save") };
+            private Action[] s = { new ShortcutAction("^Save") };
 
             @Override
             public Action[] getActions(Object target, Object sender) {
index ecec34905e101fe595a61a760806bc345af57740..4af48db20a1f29e654603f2fcdb04aa41c77c0fa 100644 (file)
@@ -54,7 +54,7 @@ public class TestItemSorter extends TestBase {
 
     private static void populateContainer(IndexedContainer container) {
         container.removeAllItems();
-        String[] strings = new String[] { "Text 1", "Text 2", "true", "false",
+        String[] strings = { "Text 1", "Text 2", "true", "false",
                 "Caption 1", "Caption 2" };
         for (String s : strings) {
             Object id = container.addItem();
index e132712e9edb5b58e726f4491202949ee2a5be52..9087b809441ec733b95165eb801086dd54d9c06f 100644 (file)
@@ -53,7 +53,7 @@ public class DDTest6 extends TestBase {
 
     java.util.Random r = new java.util.Random(1);
 
-    File[] files = new File[] { new Folder("Docs"), new Folder("Music"),
+    File[] files = { new Folder("Docs"), new Folder("Music"),
             new Folder("Images"), new File("document.doc"),
             new File("song.mp3"), new File("photo.jpg") };
 
@@ -130,7 +130,7 @@ public class DDTest6 extends TestBase {
 
         Handler actionHandler = new Handler() {
 
-            private Action[] actions = new Action[] { new Action("Remove") };
+            private Action[] actions = { new Action("Remove") };
 
             @Override
             public void handleAction(Action action, Object sender,
@@ -515,7 +515,7 @@ public class DDTest6 extends TestBase {
 
                 }
 
-                String[] knownTypes = new String[] { "image/png", "text/csv" };
+                String[] knownTypes = { "image/png", "text/csv" };
 
                 private boolean canDisplay(String type) {
                     if (type != null) {
index 3c4e56e9332d751bf145537087939426f033fefd..92f18ceffefbb77a39e22925e8e8c07055c6a6ab 100644 (file)
@@ -241,7 +241,7 @@ public class TreeDragStart extends TestBase {
     HashMap<String, InventoryObject> inventoryStore = new HashMap<>();
 
     public HierarchicalContainer createTreeContent() {
-        final Object[] inventory = new Object[] {
+        final Object[] inventory = {
                 new InventoryObject("root", 0.0, true),
                 new InventoryObject("+5 Quarterstaff (blessed)", 3.5, false),
                 new InventoryObject("+3 Elven Dagger (blessed)", 0.2, false),
index 819548cff81fa868f596f8e11e0e4ce55d5b1ead..0b4a110ef7d41e9562f238cae0d60ba5b1732ec3 100644 (file)
@@ -94,9 +94,9 @@ public class ComponentElementGetValue extends AbstractTestUI {
     private void addMultiSelectComponents() {
 
         List<MultiSelect<String>> components = new ArrayList<>();
-        components.add(new ListSelect("", createData()));
-        components.add(new CheckBoxGroup("", createData()));
-        components.add(new TwinColSelect("", createData()));
+        components.add(new ListSelect<>("", createData()));
+        components.add(new CheckBoxGroup<>("", createData()));
+        components.add(new TwinColSelect<>("", createData()));
         components.forEach(c -> {
             c.select(TEST_STRING_VALUE);
             c.addValueChangeListener(event -> {
index 01f9eedda954acab70a50226e205c4492851b30c..ebd26a4a5397a948fbf78569bcb985245e132364 100644 (file)
@@ -24,22 +24,22 @@ public class AbstractFieldElementSetValueReadOnly extends AbstractTestUI {
     private AbstractField<?>[] fields = { new TextArea(), new TextField(),
             new DateField(), new PasswordField(), new CheckBox(),
             new RichTextArea(), new Slider() };
-    private AbstractMultiSelect<?>[] multiSelects = { new ListSelect(),
-            new CheckBoxGroup(), new TwinColSelect() };
-    private AbstractSingleSelect<?>[] singleSelects = { new ComboBox(),
-            new NativeSelect(), new RadioButtonGroup() };
+    private AbstractMultiSelect<?>[] multiSelects = { new ListSelect<Object>(),
+            new CheckBoxGroup<Object>(), new TwinColSelect<Object>() };
+    private AbstractSingleSelect<?>[] singleSelects = { new ComboBox<Object>(),
+            new NativeSelect<Object>(), new RadioButtonGroup<Object>() };
 
     @Override
     protected void setup(VaadinRequest request) {
-        for (AbstractField field : fields) {
+        for (AbstractField<?> field : fields) {
             field.setReadOnly(true);
             addComponent(field);
         }
-        for (AbstractMultiSelect multiSelect : multiSelects) {
+        for (AbstractMultiSelect<?> multiSelect : multiSelects) {
             multiSelect.setReadOnly(true);
             addComponent(multiSelect);
         }
-        for (AbstractSingleSelect singleSelect : singleSelects) {
+        for (AbstractSingleSelect<?> singleSelect : singleSelects) {
             singleSelect.setReadOnly(true);
             addComponent(singleSelect);
         }
index 39d7f0d5a53caa7547deaed867648fa302d3663a..c8f761e237d4a6f0a03dd213d4ed565c4d7fc89a 100644 (file)
@@ -50,7 +50,7 @@ import com.vaadin.v7.ui.TextField;
 public abstract class AbstractBasicCrud extends AbstractTestUIWithLog {
 
     protected AbstractForm form;
-    protected static String[] columns = new String[] { "firstName", "lastName",
+    protected static String[] columns = { "firstName", "lastName",
             "gender", "birthDate", "age", "alive", "address.streetAddress",
             "address.postalCode", "address.city", "address.country" };
     protected BeanItemContainer<ComplexPerson> container = ComplexPerson
index 9795973e9340ad09d9aee06b5d71f2bdd890e289..1b2ec56599fc7ab42b858a0f403433c6e9709cf2 100644 (file)
@@ -9,14 +9,14 @@ import com.vaadin.ui.Notification;
 import com.vaadin.v7.data.fieldgroup.BeanFieldGroup;
 import com.vaadin.v7.data.fieldgroup.FieldGroup.CommitException;
 
-public abstract class AbstractBeanFieldGroupTest extends TestBase {
+public abstract class AbstractBeanFieldGroupTest<T> extends TestBase {
 
     private Button commitButton;
     protected Log log = new Log(5);
 
     private Button discardButton;
     private Button showBeanButton;
-    private BeanFieldGroup fieldBinder;
+    private BeanFieldGroup<T> fieldBinder;
 
     @Override
     protected void setup() {
@@ -76,11 +76,11 @@ public abstract class AbstractBeanFieldGroupTest extends TestBase {
         return commitButton;
     }
 
-    protected BeanFieldGroup getFieldBinder() {
+    protected BeanFieldGroup<T> getFieldBinder() {
         return fieldBinder;
     }
 
-    protected void setFieldBinder(BeanFieldGroup beanFieldBinder) {
+    protected void setFieldBinder(BeanFieldGroup<T> beanFieldBinder) {
         fieldBinder = beanFieldBinder;
     }
 
index 8605c76f46e979e4baa6926f479b9e77c56e3913..dfbb7c33f87a12050ce08416834bf46015a03986 100644 (file)
@@ -11,7 +11,7 @@ import com.vaadin.v7.data.fieldgroup.BeanFieldGroup;
 import com.vaadin.v7.ui.NativeSelect;
 import com.vaadin.v7.ui.TextField;
 
-public class FormWithNestedProperties extends AbstractBeanFieldGroupTest {
+public class FormWithNestedProperties extends AbstractBeanFieldGroupTest<Person> {
 
     private Log log = new Log(5);
 
index 112965d06a48b15010cec0b8f43fbcd3f874938e..7a51c201d622fd9df726b9d24c9801702778d5de 100644 (file)
@@ -24,7 +24,7 @@ import com.vaadin.v7.ui.ListSelect;
 
 public class OrderedLayoutBasics extends TestBase {
 
-    String valignName[] = new String[] { "top", "middle", "bottom" };
+    String valignName[] = { "top", "middle", "bottom" };
 
     Set<AbstractOrderedLayout> layouts = new HashSet<>();
     private AbstractOrderedLayout layoutContainer;
index b15a7c004a34d2fd74813fcecfbab8228d27ec90..76d3e921d7a00e2e35c6e4ac7e61f9e4d7a0d5e5 100644 (file)
@@ -45,16 +45,16 @@ public abstract class BaseLayoutTestUI extends AbstractReindeerTestUI {
     protected static final String CALENDAR_32_PNG = "../runo/icons/16/calendar.png";
     protected static final String LOCK_16_PNG = "../runo/icons/16/lock.png";
     protected static final String GLOBE_16_PNG = "../runo/icons/16/globe.png";
-    public Alignment[] alignments = new Alignment[] { Alignment.TOP_CENTER,
+    public Alignment[] alignments = { Alignment.TOP_CENTER,
             Alignment.TOP_LEFT, Alignment.TOP_RIGHT, Alignment.BOTTOM_CENTER,
             Alignment.BOTTOM_LEFT, Alignment.BOTTOM_RIGHT,
             Alignment.MIDDLE_CENTER, Alignment.MIDDLE_LEFT,
             Alignment.MIDDLE_RIGHT };
 
-    public final String[] CAPTIONS = new String[] { "",
+    public final String[] CAPTIONS = { "",
             "VeryLongOneWordCaption",
             "Very long caption of 50 approximately symbols aaaaaaaaaaaa aaaaaa aaa " };
-    Resource[] ICONS = new Resource[] { new ThemeResource(CALENDAR_32_PNG),
+    Resource[] ICONS = { new ThemeResource(CALENDAR_32_PNG),
             new ThemeResource(LOCK_16_PNG), new ThemeResource(GLOBE_16_PNG) };
     public AbstractComponent[] components = new AbstractComponent[alignments.length];
 
index 155e24b561ac744949644f74dc2ea383ea95a158..92f073aad4f587a491daf440f3e6ff5990006037 100644 (file)
@@ -56,7 +56,8 @@ public class PushErrorHandling extends AbstractReindeerTestUI {
 
             @Override
             public void itemClick(ItemClickEvent event) {
-                BeanContainer<String, AbstractInMemoryContainer> metaContainer = new BeanContainer<String, AbstractInMemoryContainer>(
+                BeanContainer<String, AbstractInMemoryContainer<?, ?, ?>> metaContainer
+                        = new BeanContainer<String, AbstractInMemoryContainer<?, ?, ?>>(
                         AbstractInMemoryContainer.class) {
                     @Override
                     public Collection<String> getContainerPropertyIds() {
index 40e5192c87fca927961f6bf9ed23d6076a88630a..c73f104e8d68367eeed9bbca841cd43ab272965b 100644 (file)
@@ -85,7 +85,7 @@ public class ResourceDownload extends TestBase {
 
     @Override
     protected String getDescription() {
-        return "Downloading with target _new should work, aswell as with target _blank and _top.";
+        return "Downloading with target _new should work, as well as with target _blank and _top.";
     }
 
     @Override
index 81c5a07261ee68578a0f02b1f752c0be66eee2ef..1e7b310c53bb2c7c9eaa07fa94ab836ec1fedf97 100644 (file)
@@ -112,7 +112,7 @@ public class ButtonsTest extends com.vaadin.server.LegacyApplication {
     private Layout buildButtons(boolean disabled, boolean icon, boolean error,
             boolean sized) {
 
-        String[] buttonStyles = new String[] { "Normal", "Primary", "Small",
+        String[] buttonStyles = { "Normal", "Primary", "Small",
                 "Link" };
 
         HorizontalLayout hl = new HorizontalLayout();
index 8982a01a4e5b817e4ff10cc570e3562a45a93480..fd5b00e6a2de3df82e154455dac0c116c13e8849 100644 (file)
@@ -18,7 +18,7 @@ package com.vaadin.tests.themes.valo;
 import com.vaadin.shared.util.SharedUtil;
 
 public class StringGenerator {
-    static String[] strings = new String[] { "lorem", "ipsum", "dolor", "sit",
+    static String[] strings = { "lorem", "ipsum", "dolor", "sit",
             "amet", "consectetur", "quid", "securi", "etiam", "tamquam", "eu",
             "fugiat", "nulla", "pariatur" };
     int stringCount = -1;
index c45b99df3771c41669bc96b6cb49d07af0916bed..4f9046b485cd933550ecdce09323b8455619b1db 100644 (file)
@@ -372,7 +372,7 @@ public class ValoThemeUI extends UI {
         private final Action ACTION_ONE = new Action("Action One");
         private final Action ACTION_TWO = new Action("Action Two");
         private final Action ACTION_THREE = new Action("Action Three");
-        private final Action[] ACTIONS = new Action[] { ACTION_ONE, ACTION_TWO,
+        private final Action[] ACTIONS = { ACTION_ONE, ACTION_TWO,
                 ACTION_THREE };
 
         @Override
index caedc9f299a4a7bfc1fcad12f62f6a066e009cd9..a94e53a92434979b7ab3579834050dda10f5d177 100644 (file)
@@ -14,7 +14,7 @@ public class PersonContainer extends BeanItemContainer<Person>
     /**
      * Natural property order for Person bean. Used in tables and forms.
      */
-    public static final Object[] NATURAL_COL_ORDER = new Object[] { "firstName",
+    public static final Object[] NATURAL_COL_ORDER = { "firstName",
             "lastName", "email", "phoneNumber", "address.streetAddress",
             "address.postalCode", "address.city" };
 
@@ -22,7 +22,7 @@ public class PersonContainer extends BeanItemContainer<Person>
      * "Human readable" captions for properties in same order as in
      * NATURAL_COL_ORDER.
      */
-    public static final String[] COL_HEADERS_ENGLISH = new String[] {
+    public static final String[] COL_HEADERS_ENGLISH = {
             "First name", "Last name", "Email", "Phone number",
             "Street Address", "Postal Code", "City" };
 
index 69589cec9e6db5db19a9f430e00a436f7b733efc..650e01a168889939d9dc6db1c60778a22223e02b 100644 (file)
@@ -11,7 +11,7 @@ public class TestUtils {
     public static final Object iso3166_PROPERTY_NAME = "name";
     public static final Object iso3166_PROPERTY_SHORT = "short";
 
-    private static final String[] iso3166 = new String[] { "AFGHANISTAN", "AF",
+    private static final String[] iso3166 = { "AFGHANISTAN", "AF",
             "Ã…LAND ISLANDS", "AX", "ALBANIA", "AL", "ALGERIA", "DZ",
             "AMERICAN SAMOA", "AS", "ANDORRA", "AD", "ANGOLA", "AO", "ANGUILLA",
             "AI", "ANTARCTICA", "AQ", "ANTIGUA AND BARBUDA", "AG", "ARGENTINA",
index 31718c643202ddd745ff1a1a3909fe496c6fd9fa..b971f1cc94b5099db30d03d59f0f8730600f202b 100644 (file)
@@ -89,7 +89,7 @@ public class FieldErrorIndication extends AbstractReindeerTestUI {
                 PasswordField.class };
         vl = new VerticalLayout();
         hl.addComponent(vl);
-        for (Class<? extends Field> fieldClass : textFields) {
+        for (Class<? extends AbstractField> fieldClass : textFields) {
             vl.addComponent(getField(fieldClass));
         }
 
@@ -100,10 +100,9 @@ public class FieldErrorIndication extends AbstractReindeerTestUI {
      * @param fieldClass
      * @return
      */
-    private Component getField(Class<? extends Field> fieldClass) {
-        AbstractField f;
+    private Component getField(Class<? extends AbstractField> fieldClass) {
         try {
-            f = (AbstractField) fieldClass.newInstance();
+            AbstractField<?> f = fieldClass.newInstance();
             f.setCaption(fieldClass.getSimpleName());
             f.setComponentError(new UserError("fail"));
             return f;
index 23ff82cb1024c2c2077d95efa1636e4cd677b8d1..77f9a18dd48dc8e6c38d0693f29485e4da13e833 100644 (file)
@@ -434,7 +434,7 @@ public class EscalatorBasicClientFeaturesWidget
     }
 
     private void createSizeMenu() {
-        String[] menupath = new String[] { "General", "Size" };
+        String[] menupath = { "General", "Size" };
 
         addSizeMenuItem(null, "height", menupath);
         addSizeMenuItem("200px", "height", menupath);
index e70c7c87f6782f3c0884a5c65cd909b936dc9686..806c639998e23cfcb521d5e491576f55d63b875f 100644 (file)
@@ -821,7 +821,7 @@ public class GridBasicClientFeaturesWidget
     }
 
     private void createScrollToRowMenu() {
-        String[] menupath = new String[] { "Component", "State", "Scroll to...",
+        String[] menupath = { "Component", "State", "Scroll to...",
                 null };
 
         for (int i = 0; i < ROWS; i += 100) {
@@ -1450,7 +1450,7 @@ public class GridBasicClientFeaturesWidget
     }
 
     private void createDetailsMenu() {
-        String[] menupath = new String[] { "Component", "Row details" };
+        String[] menupath = { "Component", "Row details" };
         addMenuCommand("Set generator", new ScheduledCommand() {
             @Override
             public void execute() {
@@ -1509,7 +1509,7 @@ public class GridBasicClientFeaturesWidget
             }
         }, menupath);
 
-        String[] togglemenupath = new String[] { menupath[0], menupath[1],
+        String[] togglemenupath = { menupath[0], menupath[1],
                 "Toggle details for..." };
         for (int i : new int[] { 0, 1, 100, 200, 300, 400, 500, 600, 700, 800,
                 900, 999 }) {
@@ -1532,7 +1532,7 @@ public class GridBasicClientFeaturesWidget
     }
 
     private void createSidebarMenu() {
-        String[] menupath = new String[] { "Component", "Sidebar" };
+        String[] menupath = { "Component", "Sidebar" };
 
         final List<MenuItem> customMenuItems = new ArrayList<>();
         final List<MenuItemSeparator> separators = new ArrayList<>();
index 854a08202cfec7de04072c56d400761bba1ea637..45ef510a05ac421ea2614e1ac89a393603ed5418 100644 (file)
@@ -94,7 +94,7 @@ public class GridRendererChangeWidget
 
     public GridRendererChangeWidget() {
         super(new Grid<String[]>());
-        String[] strArr = new String[] { "foo", "bar" };
+        String[] strArr = { "foo", "bar" };
         ListDataSource<String[]> ds = new ListDataSource<String[]>(strArr);
         final Grid<String[]> grid = getTestedWidget();
         grid.setDataSource(ds);
index e03339467b2ba07ef0018088212030e99a063020..815b48eda1620b550689bb67ff6359a90d6aa94e 100644 (file)
@@ -40,7 +40,7 @@ public class GridThemeUI extends AbstractTestUIWithLog {
 
     private Grid grid;
 
-    protected static String[] columns = new String[] { "firstName", "lastName",
+    protected static String[] columns = { "firstName", "lastName",
             "gender", "birthDate", "age", "alive", "address.streetAddress",
             "address.postalCode", "address.city", "address.country" };
 
index f5f0b6890bc8e5c0a13581391109701bad6de2d9..7834bf96ee3d6304ef3b4ffd71b96934f0ee9e8f 100644 (file)
@@ -26,7 +26,7 @@ public class TextAreaCursorPosition extends TestBase {
         addComponent(new Button("Force position update"));
     }
 
-    public void addListener(AbstractField newField) {
+    public void addListener(AbstractField<?> newField) {
         AbstractTextField newTextField = (AbstractTextField) newField;
         newTextField.setValueChangeMode(ValueChangeMode.EAGER);
         newTextField.addValueChangeListener(event -> {
index 406309f4712cc354bd99a772c5b97ef36916795f..207d62d15722d0cbc3a47343217ed04a4cda6b32 100644 (file)
@@ -81,7 +81,7 @@ public class TextChangeEvents extends TestBase {
      */
     private class VaadinDeveloperNameField extends TextField
             implements TextChangeListener {
-        private String[] names = new String[] { "Matti Tahvonen",
+        private String[] names = { "Matti Tahvonen",
                 "Marc Englund", "Joonas Lehtinen", "Jouni Koivuviita",
                 "Marko Grönroos", "Artur Signell" };
 
index 4cface820c0ffe058b0f50d5c92d51e9e138ec54..4dd7dfd5278efeb3ff5557d8c0013c30af3ab822 100644 (file)
@@ -122,7 +122,7 @@ public class TextChangeEvents2 extends TestBase {
         }
 
         {
-            final TextField[] tfs = new TextField[] { new TextField(),
+            final TextField[] tfs = { new TextField(),
                     new TextField(), new TextField(), new TextField() };
             HorizontalLayout hl = new HorizontalLayout();
             hl.setCaption("Blää");
index 49b790e85aaa2d072e437fda832307d1a08f8934..934c25f33069857cdc7929033adfe6721d4c61da 100644 (file)
@@ -28,7 +28,7 @@ public class SimpleTree extends TestBase implements Action.Handler {
     // Actions for the context menu
     private static final Action ACTION_ADD = new Action("Add child item");
     private static final Action ACTION_DELETE = new Action("Delete");
-    private static final Action[] ACTIONS = new Action[] { ACTION_ADD,
+    private static final Action[] ACTIONS = { ACTION_ADD,
             ACTION_DELETE };
 
     private Tree tree;
index c26e51e89cbdb8f86c1371c65cf7b2e585fbbd6a..830009918193edec084fd8099bde11ff189d9ae9 100644 (file)
@@ -42,7 +42,7 @@ public class ComboBoxIdenticalItemsTest extends MultiBrowserTest {
         combobox.sendKeys(delay, Keys.ARROW_DOWN, getReturn());
         waitUntilLogText("1. Item one-1 selected");
 
-        Keys[] downDownEnter = new Keys[] { Keys.ARROW_DOWN, Keys.ARROW_DOWN,
+        Keys[] downDownEnter = { Keys.ARROW_DOWN, Keys.ARROW_DOWN,
                 getReturn() };
 
         combobox.sendKeys(delay, downDownEnter);
index e54fe8b0d34c1f118e0b2e252e1ece0d4c029857..530d7ddda5ab7aaf89d52721055a8641e653448c 100644 (file)
@@ -64,7 +64,7 @@ public class GridDetailsLocationTest extends MultiBrowserTest {
     public static Collection<Param> parameters() {
         List<Param> data = new ArrayList<>();
 
-        int[] params = new int[] { 0, 500, 999 };
+        int[] params = { 0, 500, 999 };
 
         for (int rowIndex : params) {
 
index 449a9528724523973c53654c9e4e25ebcb58a3d8..0277657aa2f9f2a90f5c2248e0257534a67720d1 100644 (file)
@@ -517,7 +517,7 @@ public class EscalatorSpacerTest extends EscalatorBasicClientFeaturesTest {
             return getTranslateValues(transform);
         }
 
-        double[] result = new double[] { -1, -1 };
+        double[] result = { -1, -1 };
         String left = getLeftFromStyle(style);
         if (left != null) {
             result[0] = getPixelValue(left);
index c1f28e27cff7366ee4ac118b40ae6a9460282b06..32b7cf4b92b76181b0e1a7850f838512f38e8106 100644 (file)
@@ -23,19 +23,19 @@ public class GridBasicDetailsTest extends GridBasicsTest {
      * awkward with two scroll commands back to back.
      */
     private static final int ALMOST_LAST_INDEX = 995;
-    private static final String[] OPEN_ALMOST_LAST_ITEM_DETAILS = new String[] {
+    private static final String[] OPEN_ALMOST_LAST_ITEM_DETAILS = {
             "Component", "Details", "Open " + ALMOST_LAST_INDEX };
-    private static final String[] OPEN_FIRST_ITEM_DETAILS = new String[] {
+    private static final String[] OPEN_FIRST_ITEM_DETAILS = {
             "Component", "Details", "Open First" };
-    private static final String[] TOGGLE_FIRST_ITEM_DETAILS = new String[] {
+    private static final String[] TOGGLE_FIRST_ITEM_DETAILS = {
             "Component", "Details", "Toggle First" };
-    private static final String[] DETAILS_GENERATOR_NULL = new String[] {
+    private static final String[] DETAILS_GENERATOR_NULL = {
             "Component", "Details", "Generators", "NULL" };
-    private static final String[] DETAILS_GENERATOR_WATCHING = new String[] {
+    private static final String[] DETAILS_GENERATOR_WATCHING = {
             "Component", "Details", "Generators", "\"Watching\"" };
-    private static final String[] DETAILS_GENERATOR_PERSISTING = new String[] {
+    private static final String[] DETAILS_GENERATOR_PERSISTING = {
             "Component", "Details", "Generators", "Persisting" };
-    private static final String[] CHANGE_HIERARCHY = new String[] { "Component",
+    private static final String[] CHANGE_HIERARCHY = { "Component",
             "Details", "Generators", "- Change Component" };
 
     @Override
index bd8d0d1ea9c66c82d66905892f7f06253121bcc0..d8a49a59384018c9770fbdecad45393131ca9b0b 100644 (file)
@@ -37,7 +37,7 @@ public abstract class GridEditorTest extends GridBasicsTest {
             .className("v-grid-editor-cancel");
     protected static final org.openqa.selenium.By BY_EDITOR_SAVE = By
             .className("v-grid-editor-save");
-    protected static final String[] TOGGLE_EDIT_ENABLED = new String[] {
+    protected static final String[] TOGGLE_EDIT_ENABLED = {
             "Component", "Editor", "Enabled" };
 
     @Override
index 1d32e91d43eb0cd800f27c4eef9d52a8d0103446..9eacb3832e5e3e546e31b5294214a9b1073759d4 100644 (file)
@@ -32,9 +32,9 @@ import com.vaadin.testbench.elements.GridElement.GridCellElement;
 
 public class GridEditorUnbufferedTest extends GridEditorTest {
 
-    private static final String[] TOGGLE_EDITOR_BUFFERED = new String[] {
+    private static final String[] TOGGLE_EDITOR_BUFFERED = {
             "Component", "Editor", "Buffered mode" };
-    private static final String[] CANCEL_EDIT = new String[] { "Component",
+    private static final String[] CANCEL_EDIT = { "Component",
             "Editor", "Cancel edit" };
 
     @Override
index 8eecbc456341ef9ef1d63618992126be97ed5fd9..2e7accac48b1af1e7bcadc5fe97fe1ea955001a2 100644 (file)
@@ -12,7 +12,7 @@ import com.vaadin.tests.tb3.SingleBrowserTest;
 
 public class NativeSelectCaptionGenerationTest extends SingleBrowserTest {
 
-    private static final String[] value = new String[] { "Foo", "Bar", "Baz",
+    private static final String[] value = { "Foo", "Bar", "Baz",
             "Spam", "Eggs" };
 
     @Test
index 7aae9441af0f474c034f35bd5aeb640c7e083b5c..b2e4ee0151a8edfc901c8e4edbef068a1dbd64e8 100644 (file)
@@ -23,7 +23,7 @@ public class ComboBoxInputNotAllowedTest extends MultiBrowserTest {
         openTestURL();
         ComboBoxElement cb = $(ComboBoxElement.class).first();
 
-        String[] optionsToTest = new String[] {
+        String[] optionsToTest = {
                 ComboBoxInputNotAllowed.ITEM_ON_FIRST_PAGE,
                 ComboBoxInputNotAllowed.ITEM_ON_SECOND_PAGE,
                 ComboBoxInputNotAllowed.ITEM_ON_LAST_PAGE,
index 51f281f6de460c23f18d3397f11bf2278e283121..4098a28af9808f595ecc39d6434d0efad3d3054b 100755 (executable)
@@ -33,7 +33,7 @@ public abstract class MultiBrowserTestWithProxy extends MultiBrowserTest {
     private Integer proxyPort = null;
     private JSch jsch;
     private static String sshDir = System.getProperty("user.home") + "/.ssh/";
-    private String[] publicKeys = new String[] {
+    private String[] publicKeys = {
             System.getProperty("sshkey.file"), sshDir + "id_rsa",
             sshDir + "id_dsa", sshDir + "id_rsa2" };
 
index e28db240e29f4639698c2a069a23c789ce1080ce..c7fa0e15aae75c65d98a1a4d8442b6020d1c7214 100644 (file)
@@ -17,7 +17,7 @@ public class MenuBarTooltipTest extends MultiBrowserTest {
 
     @Test
     public void toolTipShouldBeOnTopOfMenuItem() {
-        String[] themes = new String[] { ValoTheme.THEME_NAME,
+        String[] themes = { ValoTheme.THEME_NAME,
                 Reindeer.THEME_NAME, Runo.THEME_NAME,
                 ChameleonTheme.THEME_NAME };
 
index 3f97a248eb3662b8436ab92fe0acd010173b617a..947539855fb2165bf7c5e93ca6f986456bd877aa 100644 (file)
@@ -80,7 +80,7 @@ public class GridDetailsLocationTest extends MultiBrowserTest {
     public static Collection<Param> parameters() {
         List<Param> data = new ArrayList<>();
 
-        int[] params = new int[] { 0, 500, 999 };
+        int[] params = { 0, 500, 999 };
 
         for (int rowIndex : params) {
 
index d96fd18567f40e599a5a2bf12de57c8547f9ae55..e97fea8ddf6cc8d8fdbca2945bdd58b730184a14 100644 (file)
@@ -40,11 +40,11 @@ import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicClientFeatures
 
 public class GridDetailsClientTest extends GridBasicClientFeaturesTest {
 
-    private static final String[] SET_GENERATOR = new String[] { "Component",
+    private static final String[] SET_GENERATOR = { "Component",
             "Row details", "Set generator" };
-    private static final String[] SET_FAULTY_GENERATOR = new String[] {
+    private static final String[] SET_FAULTY_GENERATOR = {
             "Component", "Row details", "Set faulty generator" };
-    private static final String[] SET_EMPTY_GENERATOR = new String[] {
+    private static final String[] SET_EMPTY_GENERATOR = {
             "Component", "Row details", "Set empty generator" };
 
     @Before
index aaa2bd66f983b8e6782f4ac618a816083d833f48..8313aaf0c5f962b6ab78270d4c9fc427c88cac91 100644 (file)
@@ -41,9 +41,9 @@ import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicFeatures;
 
 public class GridEditorClientTest extends GridBasicClientFeaturesTest {
 
-    private static final String[] EDIT_ROW_100 = new String[] { "Component",
+    private static final String[] EDIT_ROW_100 = { "Component",
             "Editor", "Edit row 100" };
-    private static final String[] EDIT_ROW_5 = new String[] { "Component",
+    private static final String[] EDIT_ROW_5 = { "Component",
             "Editor", "Edit row 5" };
 
     @Before
index b63da5ce30a6e3260f248dd11f54337a34059455..f02c88f0e8a09adee577a02b0081139d91450428 100644 (file)
@@ -32,9 +32,9 @@ import com.vaadin.v7.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
 @TestCategory("grid")
 public class GridColumnVisibilityTest extends GridBasicFeaturesTest {
 
-    private static final String[] TOGGLE_LISTENER = new String[] { "Component",
+    private static final String[] TOGGLE_LISTENER = { "Component",
             "State", "ColumnVisibilityChangeListener" };
-    private static final String[] TOGGLE_HIDE_COLUMN_0 = new String[] {
+    private static final String[] TOGGLE_HIDE_COLUMN_0 = {
             "Component", "Columns", "Column 0", "Hidden" };
 
     private static final String COLUMN_0_BECAME_HIDDEN_MSG = "Visibility "
index d1225a8b1bc4fb80ea4287dfaebedae8f69813dd..282a28df8568a80c314eb5f24d5029d5b5a37cdf 100644 (file)
@@ -38,19 +38,19 @@ public class GridDetailsServerTest extends GridBasicFeaturesTest {
      * awkward with two scroll commands back to back.
      */
     private static final int ALMOST_LAST_INDEX = 995;
-    private static final String[] OPEN_ALMOST_LAST_ITEM_DETAILS = new String[] {
+    private static final String[] OPEN_ALMOST_LAST_ITEM_DETAILS = {
             "Component", "Details", "Open " + ALMOST_LAST_INDEX };
-    private static final String[] OPEN_FIRST_ITEM_DETAILS = new String[] {
+    private static final String[] OPEN_FIRST_ITEM_DETAILS = {
             "Component", "Details", "Open firstItemId" };
-    private static final String[] TOGGLE_FIRST_ITEM_DETAILS = new String[] {
+    private static final String[] TOGGLE_FIRST_ITEM_DETAILS = {
             "Component", "Details", "Toggle firstItemId" };
-    private static final String[] DETAILS_GENERATOR_NULL = new String[] {
+    private static final String[] DETAILS_GENERATOR_NULL = {
             "Component", "Details", "Generators", "NULL" };
-    private static final String[] DETAILS_GENERATOR_WATCHING = new String[] {
+    private static final String[] DETAILS_GENERATOR_WATCHING = {
             "Component", "Details", "Generators", "\"Watching\"" };
-    private static final String[] DETAILS_GENERATOR_PERSISTING = new String[] {
+    private static final String[] DETAILS_GENERATOR_PERSISTING = {
             "Component", "Details", "Generators", "Persisting" };
-    private static final String[] CHANGE_HIERARCHY = new String[] { "Component",
+    private static final String[] CHANGE_HIERARCHY = { "Component",
             "Details", "Generators", "- Change Component" };
 
     @Before
index 33c543bb200d2cf0956cab37acb9c11eb4fd761c..f751e60c2c0c75cabbf87854e477e24c2f31cc42 100644 (file)
@@ -42,11 +42,11 @@ public abstract class GridEditorTest extends GridBasicFeaturesTest {
             .className("v-grid-editor-cancel");
     protected static final By BY_EDITOR_SAVE = By
             .className("v-grid-editor-save");
-    protected static final String[] EDIT_ITEM_5 = new String[] { "Component",
+    protected static final String[] EDIT_ITEM_5 = { "Component",
             "Editor", "Edit item 5" };
-    protected static final String[] EDIT_ITEM_100 = new String[] { "Component",
+    protected static final String[] EDIT_ITEM_100 = { "Component",
             "Editor", "Edit item 100" };
-    protected static final String[] TOGGLE_EDIT_ENABLED = new String[] {
+    protected static final String[] TOGGLE_EDIT_ENABLED = {
             "Component", "Editor", "Enabled" };
 
     @Before
index 312c0a3e63096f1caa892c45b7d5f8ff5cc8da72..74cf478291eb59dce192281d9dceb15b3e73beda 100644 (file)
@@ -31,9 +31,9 @@ import com.vaadin.testbench.elements.GridElement.GridCellElement;
 
 public class GridEditorUnbufferedTest extends GridEditorTest {
 
-    private static final String[] TOGGLE_EDITOR_BUFFERED = new String[] {
+    private static final String[] TOGGLE_EDITOR_BUFFERED = {
             "Component", "Editor", "Buffered mode" };
-    private static final String[] CANCEL_EDIT = new String[] { "Component",
+    private static final String[] CANCEL_EDIT = { "Component",
             "Editor", "Cancel edit" };
 
     @Override