@@ -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" }; |
@@ -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()), |
@@ -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", |
@@ -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, |
@@ -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 |
@@ -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) { |
@@ -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; |
@@ -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, |
@@ -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", |
@@ -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; |
@@ -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, |
@@ -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(); | |||
@@ -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(); |
@@ -103,7 +103,7 @@ public class FilesystemContainer implements Container.Hierarchical { | |||
} | |||
} | |||
private File[] roots = new File[] {}; | |||
private File[] roots = {}; | |||
private FilenameFilter filter = null; | |||
@@ -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 |
@@ -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 }; | |||
@@ -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) { |
@@ -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() { |
@@ -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()); |
@@ -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()); |
@@ -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 }; | |||
@@ -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 }; | |||
@@ -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 }; | |||
@@ -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; |
@@ -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.") }; | |||
@@ -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++) { |
@@ -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", |
@@ -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" }; |
@@ -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; |
@@ -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 }; | |||
@@ -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 |
@@ -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; |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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 |
@@ -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; |
@@ -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", |
@@ -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" }; | |||
@@ -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", |
@@ -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; |
@@ -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++); |
@@ -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( |
@@ -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) { |
@@ -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) { |
@@ -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"; |
@@ -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 |
@@ -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 |
@@ -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(); | |||
@@ -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); |
@@ -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 }; | |||
@@ -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 |
@@ -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 |
@@ -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) { |
@@ -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++) { |
@@ -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) { |
@@ -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) { |
@@ -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(" "); |
@@ -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 = ""; | |||
@@ -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() { |
@@ -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 |
@@ -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); |
@@ -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" }; | |||
@@ -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" }; | |||
@@ -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; |
@@ -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) { |
@@ -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); |
@@ -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); |
@@ -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; |
@@ -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) { |
@@ -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(); |
@@ -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) { |
@@ -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), |
@@ -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 -> { |
@@ -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); | |||
} |
@@ -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 |
@@ -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; | |||
} | |||
@@ -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); | |||
@@ -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; |
@@ -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]; | |||
@@ -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() { |
@@ -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 |
@@ -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(); |
@@ -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; |
@@ -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 |
@@ -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" }; | |||
@@ -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", |
@@ -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; |
@@ -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); |
@@ -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<>(); |
@@ -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); |
@@ -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" }; | |||
@@ -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 -> { |
@@ -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" }; | |||
@@ -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ää"); |
@@ -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; |
@@ -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); |
@@ -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) { | |||
@@ -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); |