aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-10-10 12:06:27 +0200
committerHenri Sara <henri.sara@gmail.com>2017-10-10 13:06:27 +0300
commitab18b6c58ef819dbc0049c4713cf06209d5abc47 (patch)
tree84aec85fe2dbeae4b9b340481c5a18228c4ec296
parent802bb98b851ab9b15617b283ccdba3dbc517ada6 (diff)
downloadvaadin-framework-ab18b6c58ef819dbc0049c4713cf06209d5abc47.tar.gz
vaadin-framework-ab18b6c58ef819dbc0049c4713cf06209d5abc47.zip
Remove unneeded .toString() (#10141)
-rw-r--r--client-compiler/src/main/java/com/vaadin/tools/ReportUsage.java4
-rw-r--r--client/src/main/java/com/vaadin/client/MeasuredSize.java2
-rw-r--r--client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java6
-rw-r--r--client/src/main/java/com/vaadin/client/metadata/Type.java2
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VAccordion.java2
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VTabsheet.java2
-rw-r--r--client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java2
-rwxr-xr-xclient/src/main/java/com/vaadin/client/widgets/Grid.java15
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/connectors/GridConnector.java3
-rw-r--r--compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java7
-rw-r--r--compatibility-server-gae/src/main/java/com/vaadin/server/GAEVaadinServlet.java10
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/data/util/PropertyFormatter.java4
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/data/util/TextFileProperty.java2
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java6
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/MSSQLGenerator.java2
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java6
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java10
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java10
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/DateRenderer.java2
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/NumberRenderer.java8
-rw-r--r--compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/FreeformQueryUtil.java2
-rw-r--r--compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridDeclarativeTestBase.java18
-rw-r--r--server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java6
-rw-r--r--server/src/main/java/com/vaadin/ui/AbstractSingleComponentContainer.java5
-rw-r--r--server/src/main/java/com/vaadin/ui/ComboBox.java9
-rw-r--r--server/src/main/java/com/vaadin/ui/Grid.java8
-rw-r--r--server/src/main/java/com/vaadin/ui/UI.java3
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/DesignContext.java4
-rw-r--r--server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java17
-rw-r--r--server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java2
-rw-r--r--server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java8
-rw-r--r--server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java4
-rw-r--r--server/src/test/java/com/vaadin/data/provider/hierarchical/Node.java5
-rw-r--r--uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java3
-rw-r--r--uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/Parameters.java3
-rw-r--r--uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java30
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TestBench.java3
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java10
-rw-r--r--uitest/src/main/java/com/vaadin/tests/VaadinClasses.java3
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/abstractfield/LegacyAbstractFieldTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java3
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxBackEndRequests.java8
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java6
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java8
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/datefield/DateFields.java12
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java13
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroups.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java5
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/ColumnReorderEvent.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/table/KeyControl.java3
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/textarea/ScrollCursor.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java6
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/ui/PushStateAndReplaceState.java4
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/window/ShortcutInWindow.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java5
-rw-r--r--uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java7
-rw-r--r--uitest/src/main/java/com/vaadin/tests/dnd/DragImage.java8
-rw-r--r--uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java4
-rw-r--r--uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java2
-rw-r--r--uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java4
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldElementTest.java3
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldElementTest.java3
-rw-r--r--uitest/src/test/java/com/vaadin/tests/tb3/TB3TestLocator.java3
75 files changed, 179 insertions, 210 deletions
diff --git a/client-compiler/src/main/java/com/vaadin/tools/ReportUsage.java b/client-compiler/src/main/java/com/vaadin/tools/ReportUsage.java
index 4057c531d6..96020e5cb9 100644
--- a/client-compiler/src/main/java/com/vaadin/tools/ReportUsage.java
+++ b/client-compiler/src/main/java/com/vaadin/tools/ReportUsage.java
@@ -144,10 +144,10 @@ public class ReportUsage {
appendUserAgentProperty(extra, "os.version");
if (extra.length() != 0) {
- userAgent += " (" + extra.toString() + ")";
+ userAgent += " (" + extra + ")";
}
- return userAgent.toString();
+ return userAgent;
}
private static void appendUserAgentProperty(StringBuilder sb,
diff --git a/client/src/main/java/com/vaadin/client/MeasuredSize.java b/client/src/main/java/com/vaadin/client/MeasuredSize.java
index 2029fd9e4d..1fcdb9d17a 100644
--- a/client/src/main/java/com/vaadin/client/MeasuredSize.java
+++ b/client/src/main/java/com/vaadin/client/MeasuredSize.java
@@ -280,7 +280,7 @@ public class MeasuredSize {
String changedFrom, String changedTo) {
if (debugSizeChanges) {
getLogger().info(sizeChangeType + " has changed from " + changedFrom
- + " to " + changedTo + " for " + element.toString());
+ + " to " + changedTo + " for " + element);
}
}
diff --git a/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java b/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java
index 23b3490231..1460b978ac 100644
--- a/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java
+++ b/client/src/main/java/com/vaadin/client/communication/ServerRpcQueue.java
@@ -251,7 +251,7 @@ public class ServerRpcQueue {
String connectorId = invocation.getConnectorId();
if (!connectorExists(connectorId)) {
getLogger().info("Ignoring RPC for removed connector: "
- + connectorId + ": " + invocation.toString());
+ + connectorId + ": " + invocation);
continue;
}
@@ -269,8 +269,8 @@ public class ServerRpcQueue {
Method method = type.getMethod(invocation.getMethodName());
parameterTypes = method.getParameterTypes();
} catch (NoDataException e) {
- throw new RuntimeException(
- "No type data for " + invocation.toString(), e);
+ throw new RuntimeException("No type data for " + invocation,
+ e);
}
}
diff --git a/client/src/main/java/com/vaadin/client/metadata/Type.java b/client/src/main/java/com/vaadin/client/metadata/Type.java
index 587731aac6..408d085d3d 100644
--- a/client/src/main/java/com/vaadin/client/metadata/Type.java
+++ b/client/src/main/java/com/vaadin/client/metadata/Type.java
@@ -89,7 +89,7 @@ public class Type {
if (i != 0) {
string += ',';
}
- string += parameterTypes[i].toString();
+ string += parameterTypes[i];
}
string += '>';
}
diff --git a/client/src/main/java/com/vaadin/client/ui/VAccordion.java b/client/src/main/java/com/vaadin/client/ui/VAccordion.java
index 6bba4f22eb..9ad4ef4e96 100644
--- a/client/src/main/java/com/vaadin/client/ui/VAccordion.java
+++ b/client/src/main/java/com/vaadin/client/ui/VAccordion.java
@@ -152,7 +152,7 @@ public class VAccordion extends VTabsheetBase {
addStyleDependentName("loading");
connector.getRpcProxy(TabsheetServerRpc.class)
- .setSelected(tabKeys.get(index).toString());
+ .setSelected(tabKeys.get(index));
}
}
diff --git a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java
index 35c8c1c6fb..f5e137f6e4 100644
--- a/client/src/main/java/com/vaadin/client/ui/VTabsheet.java
+++ b/client/src/main/java/com/vaadin/client/ui/VTabsheet.java
@@ -828,7 +828,7 @@ public class VTabsheet extends VTabsheetBase
getCurrentlyDisplayedWidget().getElement().getParentElement()
.getStyle().setVisibility(Visibility.HIDDEN);
- getRpcProxy().setSelected(tabKeys.get(tabIndex).toString());
+ getRpcProxy().setSelected(tabKeys.get(tabIndex));
waitingForResponse = true;
diff --git a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java
index 69fe368768..47d2eb0f35 100644
--- a/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java
+++ b/client/src/main/java/com/vaadin/client/ui/menubar/MenuBarConnector.java
@@ -131,7 +131,7 @@ public class MenuBarConnector extends AbstractComponentConnector
}
}
- currentItem = currentMenu.addItem(itemHTML.toString(), cmd);
+ currentItem = currentMenu.addItem(itemHTML, cmd);
currentItem.updateFromUIDL(item, client);
if (item.getChildCount() > 0) {
diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java
index 2b623804cf..80c7e354c7 100755
--- a/client/src/main/java/com/vaadin/client/widgets/Grid.java
+++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java
@@ -3164,8 +3164,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
if (!columns.contains(column)) {
throw new IllegalArgumentException(
- "Given column is not a column in this grid. "
- + column.toString());
+ "Given column is not a column in this grid. " + column);
}
if (!column.isSortable()) {
@@ -4724,8 +4723,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
@Override
public void render(RendererCellReference cell, Object data) {
if (!warned && !(data instanceof String)) {
- getLogger().warning(Column.this.toString() + ": "
- + DEFAULT_RENDERER_WARNING);
+ getLogger().warning(
+ Column.this + ": " + DEFAULT_RENDERER_WARNING);
warned = true;
}
@@ -5599,7 +5598,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
boolean isSelected = hasData && isSelected(rowData);
if (Grid.this.selectionModel.isSelectionAllowed()) {
- rowElement.setAttribute("aria-selected", String.valueOf(isSelected));
+ rowElement.setAttribute("aria-selected",
+ String.valueOf(isSelected));
} else {
rowElement.removeAttribute("aria-selected");
}
@@ -6318,10 +6318,11 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
* Adds the given role as 'role="$param"' to the {@code <table />} element
* of the grid.
*
- * @param role the role param
+ * @param role
+ * the role param
* @since 8.2
*/
- protected void setAriaRole(String role){
+ protected void setAriaRole(String role) {
escalator.getTable().setAttribute("role", role);
}
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/connectors/GridConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/connectors/GridConnector.java
index 771f06881a..57179b678c 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/connectors/GridConnector.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/connectors/GridConnector.java
@@ -471,8 +471,7 @@ public class GridConnector extends AbstractHasComponentsConnector
} else {
getLogger().warning(
"Visibility changed for a unknown column type in Grid: "
- + column.toString() + ", type "
- + column.getClass());
+ + column + ", type " + column.getClass());
}
}
}
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java
index 3f5e798b7d..65d9adc3c1 100644
--- a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java
+++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java
@@ -3148,8 +3148,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
if (!columns.contains(column)) {
throw new IllegalArgumentException(
- "Given column is not a column in this grid. "
- + column.toString());
+ "Given column is not a column in this grid. " + column);
}
if (!column.isSortable()) {
@@ -4714,8 +4713,8 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
@Override
public void render(RendererCellReference cell, Object data) {
if (!warned && !(data instanceof String)) {
- getLogger().warning(Column.this.toString() + ": "
- + DEFAULT_RENDERER_WARNING);
+ getLogger().warning(
+ Column.this + ": " + DEFAULT_RENDERER_WARNING);
warned = true;
}
diff --git a/compatibility-server-gae/src/main/java/com/vaadin/server/GAEVaadinServlet.java b/compatibility-server-gae/src/main/java/com/vaadin/server/GAEVaadinServlet.java
index 5b25a48ba9..3c59e52c79 100644
--- a/compatibility-server-gae/src/main/java/com/vaadin/server/GAEVaadinServlet.java
+++ b/compatibility-server-gae/src/main/java/com/vaadin/server/GAEVaadinServlet.java
@@ -151,16 +151,14 @@ public class GAEVaadinServlet extends VaadinServlet {
VaadinServletResponse response) throws IOException {
criticalNotification(request, response, "NotSerializableException",
"I'm sorry, but there seems to be a serious problem, please contact the administrator. And please take note of any unsaved data...",
- "",
- getApplicationUrl(request).toString() + "?restartApplication");
+ "", getApplicationUrl(request) + "?restartApplication");
}
protected void sendCriticalErrorNotification(VaadinServletRequest request,
VaadinServletResponse response) throws IOException {
criticalNotification(request, response, "Critical error",
"I'm sorry, but there seems to be a serious problem, please contact the administrator. And please take note of any unsaved data...",
- "",
- getApplicationUrl(request).toString() + "?restartApplication");
+ "", getApplicationUrl(request) + "?restartApplication");
}
@Override
@@ -227,8 +225,8 @@ public class GAEVaadinServlet extends VaadinServlet {
try {
Thread.sleep(RETRY_AFTER_MILLISECONDS);
} catch (InterruptedException e) {
- getLogger()
- .finer("Thread.sleep() interrupted while waiting for lock. Trying again. "
+ getLogger().finer(
+ "Thread.sleep() interrupted while waiting for lock. Trying again. "
+ e);
}
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/PropertyFormatter.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/PropertyFormatter.java
index 2e1ac13e9a..223cf15098 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/PropertyFormatter.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/PropertyFormatter.java
@@ -31,7 +31,7 @@ import com.vaadin.v7.data.util.converter.Converter;
* For example <code>
* <pre>textfield.setPropertyDataSource(new PropertyFormatter(property) {
public String format(Object value) {
- return ((Double) value).toString() + "000000000";
+ return ((Double) value) + "000000000";
}
public Object parse(String formattedValue) throws Exception {
@@ -223,7 +223,7 @@ public abstract class PropertyFormatter<T> extends AbstractProperty<String>
}
} else {
try {
- dataSource.setValue(parse(newValue.toString()));
+ dataSource.setValue(parse(newValue));
if (!newValue.equals(getValue())) {
fireValueChange();
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/TextFileProperty.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/TextFileProperty.java
index 3dea636644..52065485e5 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/TextFileProperty.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/TextFileProperty.java
@@ -145,7 +145,7 @@ public class TextFileProperty extends AbstractProperty<String> {
? new OutputStreamWriter(fos)
: new OutputStreamWriter(fos, charset);
BufferedWriter w = new BufferedWriter(osw);
- w.append(newValue.toString());
+ w.append(newValue);
w.flush();
w.close();
osw.close();
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java
index 3cb4103521..78ef1f8d58 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/RowItem.java
@@ -127,13 +127,13 @@ public final class RowItem implements Item {
public String toString() {
StringBuilder s = new StringBuilder();
s.append("ID:");
- s.append(getId().toString());
+ s.append(getId());
for (Object propId : getItemPropertyIds()) {
s.append('|');
- s.append(propId.toString());
+ s.append(propId);
s.append(':');
Object value = getItemProperty(propId).getValue();
- s.append((null != value) ? value.toString() : null);
+ s.append(value);
}
return s.toString();
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/MSSQLGenerator.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/MSSQLGenerator.java
index fa607aeb5a..6385ad0767 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/MSSQLGenerator.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/sqlcontainer/query/generator/MSSQLGenerator.java
@@ -112,7 +112,7 @@ public class MSSQLGenerator extends DefaultSQLGenerator {
query.append(QueryBuilder.getWhereStringForFilters(filters, sh));
}
query.append(") AS a WHERE a.rownum BETWEEN ").append(offset)
- .append(" AND ").append(Integer.toString(offset + pagelength));
+ .append(" AND ").append(offset + pagelength);
sh.setQueryString(query.toString());
return sh;
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java
index 305859534a..aeb6d8154e 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/AbstractTextField.java
@@ -442,9 +442,9 @@ public abstract class AbstractTextField extends AbstractField<String> implements
lastKnownTextContent = getNullRepresentation();
textChangeEventPending = true;
} else if (newValue != null
- && !newValue.toString().equals(lastKnownTextContent)) {
+ && !newValue.equals(lastKnownTextContent)) {
// Value was changed to something else than null representation
- lastKnownTextContent = newValue.toString();
+ lastKnownTextContent = newValue;
textChangeEventPending = true;
}
firePendingTextChangeEvent();
@@ -652,7 +652,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements
* @since 6.4
*/
public void selectAll() {
- String text = getValue() == null ? "" : getValue().toString();
+ String text = getValue() == null ? "" : getValue();
setSelectionRange(0, text.length());
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java
index 747a0eea51..2e797cb7a9 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java
@@ -861,7 +861,7 @@ public class Form extends AbstractField<Object>
final Field<?> oldField = fields.get(propertyId);
if (oldField == null) {
throw new IllegalArgumentException("Field with given propertyid '"
- + propertyId.toString() + "' can not be found.");
+ + propertyId + "' can not be found.");
}
final Object value = oldField.getPropertyDataSource() == null
? oldField.getValue()
@@ -890,16 +890,14 @@ public class Form extends AbstractField<Object>
if (!found) {
throw new IllegalArgumentException(
"Currently selected value '" + val
- + "' of property '"
- + propertyId.toString()
+ + "' of property '" + propertyId
+ "' was not found");
}
}
isMultiselect = true;
} else {
- throw new IllegalArgumentException(
- "Current value '" + value + "' of property '"
- + propertyId.toString() + "' was not found");
+ throw new IllegalArgumentException("Current value '" + value
+ + "' of property '" + propertyId + "' was not found");
}
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java
index 9e8dd1086c..ded75d0755 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java
@@ -5265,13 +5265,11 @@ public class Grid extends AbstractComponent
addColumnProperty(propertyId, String.class, "");
} else {
if (columns.containsKey(propertyId)) {
- throw new IllegalStateException(
- "A column for property id '" + propertyId.toString()
- + "' already exists in this grid");
+ throw new IllegalStateException("A column for property id '"
+ + propertyId + "' already exists in this grid");
} else {
- throw new IllegalStateException(
- "Property id '" + propertyId.toString()
- + "' does not exist in the container");
+ throw new IllegalStateException("Property id '" + propertyId
+ + "' does not exist in the container");
}
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/DateRenderer.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/DateRenderer.java
index 95e22919ae..f6c1d87f93 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/DateRenderer.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/DateRenderer.java
@@ -231,7 +231,7 @@ public class DateRenderer extends AbstractRenderer<Date> {
public String toString() {
final String fieldInfo;
if (dateFormat != null) {
- fieldInfo = "dateFormat: " + dateFormat.toString();
+ fieldInfo = "dateFormat: " + dateFormat;
} else {
fieldInfo = "locale: " + locale + ", formatString: " + formatString;
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/NumberRenderer.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/NumberRenderer.java
index 871657411a..7a00fcc26c 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/NumberRenderer.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/renderers/NumberRenderer.java
@@ -180,9 +180,9 @@ public class NumberRenderer extends AbstractRenderer<Number> {
} else if (numberFormat != null) {
stringValue = numberFormat.format(value);
} else {
- throw new IllegalStateException(String.format(
- "Internal bug: " + "%s is in an illegal state: "
- + "[locale: %s, numberFormat: %s, formatString: %s]",
+ throw new IllegalStateException(String.format("Internal bug: "
+ + "%s is in an illegal state: "
+ + "[locale: %s, numberFormat: %s, formatString: %s]",
getClass().getSimpleName(), locale, numberFormat,
formatString));
}
@@ -193,7 +193,7 @@ public class NumberRenderer extends AbstractRenderer<Number> {
public String toString() {
final String fieldInfo;
if (numberFormat != null) {
- fieldInfo = "numberFormat: " + numberFormat.toString();
+ fieldInfo = "numberFormat: " + numberFormat;
} else {
fieldInfo = "locale: " + locale + ", formatString: " + formatString;
}
diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/FreeformQueryUtil.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/FreeformQueryUtil.java
index 9c14296476..ab12cc9f7b 100644
--- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/FreeformQueryUtil.java
+++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/sqlcontainer/FreeformQueryUtil.java
@@ -27,7 +27,7 @@ public class FreeformQueryUtil {
QueryBuilder.getWhereStringForFilters(filters, sh));
}
query.append(") AS a WHERE a.rownum BETWEEN ").append(offset)
- .append(" AND ").append(Integer.toString(offset + limit));
+ .append(" AND ").append(offset + limit);
sh.setQueryString(query.toString());
return sh;
} else if (SQLTestsConstants.db == DB.ORACLE) {
diff --git a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridDeclarativeTestBase.java b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridDeclarativeTestBase.java
index a01e8dadce..5d4458f286 100644
--- a/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridDeclarativeTestBase.java
+++ b/compatibility-server/src/test/java/com/vaadin/v7/tests/server/component/grid/declarative/GridDeclarativeTestBase.java
@@ -17,8 +17,6 @@ package com.vaadin.v7.tests.server.component.grid.declarative;
import java.util.List;
-import org.junit.Assert;
-
import com.vaadin.tests.design.DeclarativeTestBase;
import com.vaadin.v7.ui.Grid;
import com.vaadin.v7.ui.Grid.Column;
@@ -54,8 +52,8 @@ public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> {
}
private void compareHeaders(Grid expected, Grid actual) {
- assertEquals("Different header row count",
- expected.getHeaderRowCount(), actual.getHeaderRowCount());
+ assertEquals("Different header row count", expected.getHeaderRowCount(),
+ actual.getHeaderRowCount());
for (int i = 0; i < expected.getHeaderRowCount(); ++i) {
HeaderRow expectedRow = expected.getHeaderRow(i);
HeaderRow actualRow = actual.getHeaderRow(i);
@@ -66,8 +64,8 @@ public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> {
}
for (Column c : expected.getColumns()) {
- String baseError = "Difference when comparing cell for "
- + c.toString() + " on header row " + i + ": ";
+ String baseError = "Difference when comparing cell for " + c
+ + " on header row " + i + ": ";
Object propertyId = c.getPropertyId();
HeaderCell expectedCell = expectedRow.getCell(propertyId);
HeaderCell actualCell = actualRow.getCell(propertyId);
@@ -92,15 +90,15 @@ public class GridDeclarativeTestBase extends DeclarativeTestBase<Grid> {
}
private void compareFooters(Grid expected, Grid actual) {
- assertEquals("Different footer row count",
- expected.getFooterRowCount(), actual.getFooterRowCount());
+ assertEquals("Different footer row count", expected.getFooterRowCount(),
+ actual.getFooterRowCount());
for (int i = 0; i < expected.getFooterRowCount(); ++i) {
FooterRow expectedRow = expected.getFooterRow(i);
FooterRow actualRow = actual.getFooterRow(i);
for (Column c : expected.getColumns()) {
- String baseError = "Difference when comparing cell for "
- + c.toString() + " on footer row " + i + ": ";
+ String baseError = "Difference when comparing cell for " + c
+ + " on footer row " + i + ": ";
Object propertyId = c.getPropertyId();
FooterCell expectedCell = expectedRow.getCell(propertyId);
FooterCell actualCell = actualRow.getCell(propertyId);
diff --git a/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java
index b60cca189d..f10b246c5c 100644
--- a/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java
+++ b/server/src/main/java/com/vaadin/server/communication/AtmospherePushConnection.java
@@ -166,7 +166,7 @@ public class AtmospherePushConnection implements PushConnection {
try {
Writer writer = new StringWriter();
new UidlWriter().write(getUI(), writer, async);
- sendMessage("for(;;);[{" + writer.toString() + "}]");
+ sendMessage("for(;;);[{" + writer + "}]");
} catch (Exception e) {
throw new RuntimeException("Push failed", e);
}
@@ -230,8 +230,8 @@ public class AtmospherePushConnection implements PushConnection {
/**
* Associates this {@link AtmospherePushConnection} with the given
- * {@link AtmosphereResource} representing an established push connection. If
- * already connected, calls {@link #disconnect()} first. If there is a
+ * {@link AtmosphereResource} representing an established push connection.
+ * If already connected, calls {@link #disconnect()} first. If there is a
* deferred push, carries it out via the new connection.
*
* @since 7.2
diff --git a/server/src/main/java/com/vaadin/ui/AbstractSingleComponentContainer.java b/server/src/main/java/com/vaadin/ui/AbstractSingleComponentContainer.java
index 428e436399..32bc3c8e1d 100644
--- a/server/src/main/java/com/vaadin/ui/AbstractSingleComponentContainer.java
+++ b/server/src/main/java/com/vaadin/ui/AbstractSingleComponentContainer.java
@@ -323,9 +323,8 @@ public abstract class AbstractSingleComponentContainer extends AbstractComponent
protected void readDesignChildren(Elements children,
DesignContext context) {
if (children.size() > 1) {
- throw new DesignException(
- "The container of type " + getClass().toString()
- + " can have only one child component.");
+ throw new DesignException("The container of type " + getClass()
+ + " can have only one child component.");
} else if (children.size() == 1) {
setContent(context.readDesign(children.first()));
}
diff --git a/server/src/main/java/com/vaadin/ui/ComboBox.java b/server/src/main/java/com/vaadin/ui/ComboBox.java
index 00d735f839..6e03ed35e9 100644
--- a/server/src/main/java/com/vaadin/ui/ComboBox.java
+++ b/server/src/main/java/com/vaadin/ui/ComboBox.java
@@ -704,7 +704,7 @@ public class ComboBox<T> extends AbstractSingleSelect<T>
private void updateSelectedItemCaption() {
String selectedCaption = null;
- T value = getDataCommunicator().getKeyMapper().get(getSelectedKey());
+ T value = keyToItem(getSelectedKey());
if (value != null) {
selectedCaption = getItemCaptionGenerator().apply(value);
}
@@ -713,7 +713,7 @@ public class ComboBox<T> extends AbstractSingleSelect<T>
private void updateSelectedItemIcon() {
String selectedItemIcon = null;
- T value = getDataCommunicator().getKeyMapper().get(getSelectedKey());
+ T value = keyToItem(getSelectedKey());
if (value != null) {
Resource icon = getItemIconGenerator().apply(value);
if (icon != null) {
@@ -772,9 +772,8 @@ public class ComboBox<T> extends AbstractSingleSelect<T>
((DeclarativeStyleGenerator) styleGenerator).setStyle(item,
child.attr("style"));
} else {
- throw new IllegalStateException(String.format(
- "Don't know how "
- + "to set style using current style generator '%s'",
+ throw new IllegalStateException(String.format("Don't know how "
+ + "to set style using current style generator '%s'",
styleGenerator.getClass().getName()));
}
}
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java
index a80e8f1729..993a6d3411 100644
--- a/server/src/main/java/com/vaadin/ui/Grid.java
+++ b/server/src/main/java/com/vaadin/ui/Grid.java
@@ -2540,9 +2540,9 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents,
if (!renderer.getPresentationType()
.isAssignableFrom(definition.getType())) {
- throw new IllegalArgumentException(renderer.toString()
- + " cannot be used with a property of type "
- + definition.getType().getName());
+ throw new IllegalArgumentException(
+ renderer + " cannot be used with a property of type "
+ + definition.getType().getName());
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@@ -4259,7 +4259,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents,
protected T deserializeDeclarativeRepresentation(String item) {
if (item == null) {
return super.deserializeDeclarativeRepresentation(
- new String(UUID.randomUUID().toString()));
+ UUID.randomUUID().toString());
}
return super.deserializeDeclarativeRepresentation(new String(item));
}
diff --git a/server/src/main/java/com/vaadin/ui/UI.java b/server/src/main/java/com/vaadin/ui/UI.java
index ae02df9c70..db659a5229 100644
--- a/server/src/main/java/com/vaadin/ui/UI.java
+++ b/server/src/main/java/com/vaadin/ui/UI.java
@@ -544,8 +544,7 @@ public abstract class UI extends AbstractSingleComponentContainer
if (session == null) {
return null;
} else {
- return session.toString() + " for "
- + session.getService().getServiceName();
+ return session + " for " + session.getService().getServiceName();
}
}
diff --git a/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java b/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java
index 61510dfee6..86f82c5abd 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/DesignContext.java
@@ -402,8 +402,8 @@ public class DesignContext implements Serializable {
String contentString = attributes.get("content");
String[] parts = contentString.split(":");
if (parts.length != 2) {
- throw new DesignException("The meta tag '"
- + child.toString() + "' cannot be parsed.");
+ throw new DesignException("The meta tag '" + child
+ + "' cannot be parsed.");
}
String prefixName = parts[0];
String packageName = parts[1];
diff --git a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
index f1a4fcde23..d3d2b13170 100644
--- a/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
+++ b/server/src/main/java/com/vaadin/ui/declarative/converters/DesignResourceConverter.java
@@ -47,8 +47,9 @@ import com.vaadin.ui.declarative.DesignAttributeHandler;
@SuppressWarnings("serial")
public class DesignResourceConverter implements Converter<String, Resource> {
- private static final Map<Integer, VaadinIcons> CODE_POINTS =
- Arrays.stream(VaadinIcons.values()).collect(Collectors.toMap(VaadinIcons::getCodepoint, icon -> icon));
+ private static final Map<Integer, VaadinIcons> CODE_POINTS = Arrays
+ .stream(VaadinIcons.values())
+ .collect(Collectors.toMap(VaadinIcons::getCodepoint, icon -> icon));
@Override
public Result<Resource> convertToModel(String value, ValueContext context) {
@@ -115,7 +116,9 @@ public class DesignResourceConverter implements Converter<String, Resource> {
return CODE_POINTS.get(codepoint);
}
- if (FontAwesome.FONT_FAMILY.equals(familyAndCode[0])) { //Left for compatibility
+ if (FontAwesome.FONT_FAMILY.equals(familyAndCode[0])) { // Left
+ // for
+ // compatibility
return FontAwesome.fromCodepoint(codepoint);
}
// all vaadin icons should have a codepoint
@@ -144,9 +147,8 @@ public class DesignResourceConverter implements Converter<String, Resource> {
@Override
public String format(Resource value) {
- throw new UnsupportedOperationException(
- "Use " + ResourceConverterByProtocol.FONTICON.toString()
- + " instead");
+ throw new UnsupportedOperationException("Use "
+ + ResourceConverterByProtocol.FONTICON + " instead");
}
},
FILE {
@@ -168,7 +170,8 @@ public class DesignResourceConverter implements Converter<String, Resource> {
};
- public static final String VAADIN_ICONS_NAME = VaadinIcons.ABACUS.getFontFamily();
+ public static final String VAADIN_ICONS_NAME = VaadinIcons.ABACUS
+ .getFontFamily();
@Override
public Resource parse(String value) {
diff --git a/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java
index 484f88e882..1971540cb2 100644
--- a/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java
+++ b/server/src/main/java/com/vaadin/ui/renderers/DateRenderer.java
@@ -230,7 +230,7 @@ public class DateRenderer extends AbstractRenderer<Object, Date> {
public String toString() {
final String fieldInfo;
if (dateFormat != null) {
- fieldInfo = "dateFormat: " + dateFormat.toString();
+ fieldInfo = "dateFormat: " + dateFormat;
} else {
fieldInfo = "locale: " + locale + ", formatString: " + formatString;
}
diff --git a/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java
index 17730901ff..8e00c44ebd 100644
--- a/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java
+++ b/server/src/main/java/com/vaadin/ui/renderers/NumberRenderer.java
@@ -179,9 +179,9 @@ public class NumberRenderer extends AbstractRenderer<Object, Number> {
} else if (numberFormat != null) {
stringValue = numberFormat.format(value);
} else {
- throw new IllegalStateException(String.format(
- "Internal bug: " + "%s is in an illegal state: "
- + "[locale: %s, numberFormat: %s, formatString: %s]",
+ throw new IllegalStateException(String.format("Internal bug: "
+ + "%s is in an illegal state: "
+ + "[locale: %s, numberFormat: %s, formatString: %s]",
getClass().getSimpleName(), locale, numberFormat,
formatString));
}
@@ -192,7 +192,7 @@ public class NumberRenderer extends AbstractRenderer<Object, Number> {
public String toString() {
final String fieldInfo;
if (numberFormat != null) {
- fieldInfo = "numberFormat: " + numberFormat.toString();
+ fieldInfo = "numberFormat: " + numberFormat;
} else {
fieldInfo = "locale: " + locale + ", formatString: " + formatString;
}
diff --git a/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java b/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java
index b91a6fe3af..da45054325 100644
--- a/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java
+++ b/server/src/test/java/com/vaadin/data/provider/BackendDataProviderTest.java
@@ -47,7 +47,7 @@ public class BackendDataProviderTest extends
}
List<StrBean> list = stream.skip(query.getOffset())
.limit(query.getLimit()).collect(Collectors.toList());
- list.forEach(s -> System.err.println(s.toString()));
+ list.forEach(s -> System.err.println(s));
return list.stream();
}, query -> (int) data.stream()
.filter(t -> query.getFilter().orElse(s -> true).test(t))
@@ -66,4 +66,4 @@ public class BackendDataProviderTest extends
getDataProvider().setSortOrders(sortOrder);
}
-} \ No newline at end of file
+}
diff --git a/server/src/test/java/com/vaadin/data/provider/hierarchical/Node.java b/server/src/test/java/com/vaadin/data/provider/hierarchical/Node.java
index c15f713f53..95e961df52 100644
--- a/server/src/test/java/com/vaadin/data/provider/hierarchical/Node.java
+++ b/server/src/test/java/com/vaadin/data/provider/hierarchical/Node.java
@@ -2,7 +2,7 @@ package com.vaadin.data.provider.hierarchical;
import java.io.Serializable;
-public class Node implements Serializable{
+public class Node implements Serializable {
private static int counter = 0;
@@ -27,7 +27,6 @@ public class Node implements Serializable{
}
public String toString() {
- return number + (parent != null ? " [parent: " + parent.toString() + "]"
- : "");
+ return number + (parent != null ? " [parent: " + parent + "]" : "");
}
}
diff --git a/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java
index 97689033d5..4c0f5ab524 100644
--- a/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java
+++ b/uitest/src/main/java/com/vaadin/launcher/ApplicationRunnerServlet.java
@@ -304,8 +304,7 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet {
* context, runner, application classname
*/
private static URIS getApplicationRunnerURIs(HttpServletRequest request) {
- final String[] urlParts = request.getRequestURI().toString()
- .split("\\/");
+ final String[] urlParts = request.getRequestURI().split("\\/");
// String runner = null;
URIS uris = new URIS();
String applicationClassname = null;
diff --git a/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java b/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java
index 7599522c38..695bc7f199 100644
--- a/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java
+++ b/uitest/src/main/java/com/vaadin/launcher/DevelopmentServerLauncher.java
@@ -468,7 +468,7 @@ public class DevelopmentServerLauncher {
System.out.println(thread.getName() + " - " + thread.getState());
for (StackTraceElement stackTraceElement : stackTraceElements) {
- System.out.println(" at " + stackTraceElement.toString());
+ System.out.println(" at " + stackTraceElement);
}
System.out.println();
}
diff --git a/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java b/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java
index ff0bbf7acb..b9eaf16271 100644
--- a/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java
+++ b/uitest/src/main/java/com/vaadin/tests/CustomLayoutDemo.java
@@ -126,7 +126,7 @@ public class CustomLayoutDemo extends com.vaadin.server.LegacyApplication
public void loginClicked() {
username.setVisible(false);
loginPwd.setVisible(false);
- if (username.getValue().toString().length() < 1) {
+ if (username.getValue().length() < 1) {
username.setValue("Anonymous");
}
mainLayout.replaceComponent(loginButton,
diff --git a/uitest/src/main/java/com/vaadin/tests/Parameters.java b/uitest/src/main/java/com/vaadin/tests/Parameters.java
index c483b4e6b3..397913dc9a 100644
--- a/uitest/src/main/java/com/vaadin/tests/Parameters.java
+++ b/uitest/src/main/java/com/vaadin/tests/Parameters.java
@@ -70,8 +70,7 @@ public class Parameters extends com.vaadin.server.LegacyApplication
layout.addComponent(
new Link(u2.toString(), new ExternalResource(u2)));
} catch (final Exception e) {
- System.out.println(
- "Couldn't get hostname for this machine: " + e.toString());
+ System.out.println("Couldn't get hostname for this machine: " + e);
e.printStackTrace();
}
diff --git a/uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java b/uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java
index 9403b5a82e..229b3352c9 100644
--- a/uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java
+++ b/uitest/src/main/java/com/vaadin/tests/StressComponentsInTable.java
@@ -52,8 +52,8 @@ public class StressComponentsInTable extends CustomComponent {
@Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
- System.out.println(b.getCaption() + " click: "
- + (new Date()).toString());
+ System.out
+ .println(b.getCaption() + " click: " + new Date());
System.out.println(b.getUI().getSession());
}
@@ -64,19 +64,19 @@ public class StressComponentsInTable extends CustomComponent {
return t;
}
- static String[] testString = { "Jacob", "Michael", "Joshua",
- "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher",
- "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas",
- "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel",
- "Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon",
- "Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack",
- "Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke",
- "Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor",
- "Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan",
- "Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego",
- "Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel",
- "Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter",
- "Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", "Steven",
+ static String[] testString = { "Jacob", "Michael", "Joshua", "Matthew",
+ "Ethan", "Andrew", "Daniel", "Anthony", "Christopher", "Joseph",
+ "William", "Alexander", "Ryan", "David", "Nicholas", "Tyler",
+ "James", "John", "Jonathan", "Nathan", "Samuel", "Christian",
+ "Noah", "Dylan", "Benjamin", "Logan", "Brandon", "Gabriel",
+ "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack", "Caleb",
+ "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke", "Mason",
+ "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor", "Aiden",
+ "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan", "Charles",
+ "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego", "Brian",
+ "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel", "Carlos",
+ "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter", "Hayden",
+ "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", "Steven",
"Timothy", "Dominic", "Sebastian", "Xavier", "Jaden", "Jesse",
"Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin", "Cody",
"Alejandro", "Caden", "Blake", "Carson" };
diff --git a/uitest/src/main/java/com/vaadin/tests/TestBench.java b/uitest/src/main/java/com/vaadin/tests/TestBench.java
index c29e46e9d3..b7b8c93177 100644
--- a/uitest/src/main/java/com/vaadin/tests/TestBench.java
+++ b/uitest/src/main/java/com/vaadin/tests/TestBench.java
@@ -226,8 +226,7 @@ public class TestBench extends com.vaadin.server.LegacyApplication
e1.printStackTrace();
VerticalLayout lo = new VerticalLayout();
lo.addComponent(new Label(
- "Cannot create application / custom component: "
- + e1.toString()));
+ "Cannot create application / custom component: " + e1));
Link l = new Link("Try opening via app runner",
new ExternalResource("../run/" + c.getName()));
diff --git a/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java b/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java
index 9a63d7a823..37a5c85d98 100644
--- a/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java
+++ b/uitest/src/main/java/com/vaadin/tests/TestCaptionWrapper.java
@@ -216,7 +216,7 @@ public class TestCaptionWrapper extends CustomComponent implements Listener {
@Override
public void componentEvent(Event event) {
final String feedback = eventListenerString + " source="
- + event.getSource() + ", toString()=" + event.toString();
+ + event.getSource() + ", toString()=" + event;
System.out.println("eventListenerFeedback: " + feedback);
eventListenerFeedback.setValue(feedback);
}
diff --git a/uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java b/uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java
index 3f5a44f61a..570b8b126c 100644
--- a/uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java
+++ b/uitest/src/main/java/com/vaadin/tests/TreeFilesystem.java
@@ -103,7 +103,7 @@ public class TreeFilesystem extends com.vaadin.server.LegacyApplication
for (int x = 0; x < files.length; x++) {
try {
// add new item (String) to tree
- final String path = files[x].getCanonicalPath().toString();
+ final String path = files[x].getCanonicalPath();
tree.addItem(path);
// set parent if this item has one
if (parent != null) {
diff --git a/uitest/src/main/java/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java b/uitest/src/main/java/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java
index dccfbaa1e1..f818f4b6ad 100644
--- a/uitest/src/main/java/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java
+++ b/uitest/src/main/java/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java
@@ -54,13 +54,13 @@ public class UsingCustomNewItemHandlerInSelect extends CustomComponent {
}
public void populateSelect() {
- final String[] names = { "John", "Mary", "Joe", "Sarah",
- "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" };
+ 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++);
Item item = select.addItem(id);
- item.getItemProperty("CAPTION").setValue(id.toString() + ": "
- + names[random.nextInt() % names.length]);
+ item.getItemProperty("CAPTION").setValue(
+ id + ": " + names[random.nextInt() % names.length]);
}
}
@@ -71,7 +71,7 @@ public class UsingCustomNewItemHandlerInSelect extends CustomComponent {
Integer id = new Integer(sequence++);
Item item = select.addItem(id);
item.getItemProperty("CAPTION")
- .setValue(id.toString() + ": " + newItemCaption);
+ .setValue(id + ": " + newItemCaption);
select.setValue(id);
}
diff --git a/uitest/src/main/java/com/vaadin/tests/VaadinClasses.java b/uitest/src/main/java/com/vaadin/tests/VaadinClasses.java
index f5af00234c..4b24f08eb0 100644
--- a/uitest/src/main/java/com/vaadin/tests/VaadinClasses.java
+++ b/uitest/src/main/java/com/vaadin/tests/VaadinClasses.java
@@ -82,8 +82,7 @@ public class VaadinClasses {
try {
File f = new File(location.toURI());
if (!f.exists()) {
- throw new IOException(
- "Directory " + f.toString() + " does not exist");
+ throw new IOException("Directory " + f + " does not exist");
}
findPackages(f, basePackage, baseClass, classes,
ignoredPackages);
diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
index 7558771969..9718fac860 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
@@ -145,7 +145,7 @@ public abstract class AbstractFieldTest<T extends AbstractField<V>, V>
Locale.ENGLISH);
value = format.format(date);
} else {
- value = "'" + o.toString() + "'";
+ value = "'" + o + "'";
}
}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/LegacyAbstractFieldTest.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/LegacyAbstractFieldTest.java
index 18ecfaf53b..c2617dafba 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/LegacyAbstractFieldTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/LegacyAbstractFieldTest.java
@@ -174,7 +174,7 @@ public abstract class LegacyAbstractFieldTest<T extends AbstractField>
new Locale("en", "US"));
value = format.format(d);
} else {
- value = "'" + o.toString() + "'";
+ value = "'" + o + "'";
}
}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java
index 918459dfde..38859497fc 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java
@@ -14,7 +14,7 @@ public class Vaadin6ImplicitDoubleConverter
if (null == value) {
return null;
}
- return new Double(value.toString());
+ return new Double(value);
}
@Override
diff --git a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java
index c405a2af52..4b27d4fee5 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/abstractlisting/AbstractMultiSelectTestUI.java
@@ -25,8 +25,7 @@ public abstract class AbstractMultiSelectTestUI<MULTISELECT extends AbstractMult
LinkedHashMap<String, ItemCaptionGenerator<Object>> options = new LinkedHashMap<>();
options.put("Null Caption Generator", item -> null);
options.put("Default Caption Generator", item -> item.toString());
- options.put("Custom Caption Generator",
- item -> item.toString() + " Caption");
+ options.put("Custom Caption Generator", item -> item + " Caption");
createSelectAction("Item Caption Generator", "Item Generator", options,
"None", (abstractMultiSelect, captionGenerator, data) -> {
diff --git a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java
index 3aa6ab45e1..78c82f80e2 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/button/ButtonMouseDetails.java
@@ -16,7 +16,7 @@ public class ButtonMouseDetails extends TestBase {
@Override
public void buttonClick(ClickEvent event) {
- StringBuilder str = new StringBuilder(out.getValue().toString());
+ StringBuilder str = new StringBuilder(out.getValue());
str.append(clickCounter + ":\t");
// Modifier keys
diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java
index 71c3a6147f..f69bf26a3d 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java
@@ -65,7 +65,7 @@ public class CheckBoxGroupTestUI
options.put("Null Description Generator", item -> null);
options.put("Default Description Generator", item -> item.toString());
options.put("Custom Description Generator",
- item -> item.toString() + " Description");
+ item -> item + " Description");
createSelectAction("Item Description Generator",
"Item Description Generator", options, "None",
diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxBackEndRequests.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxBackEndRequests.java
index be2ce6c67e..847ec1a280 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxBackEndRequests.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboBoxBackEndRequests.java
@@ -23,12 +23,12 @@ public class ComboBoxBackEndRequests extends AbstractTestUI {
int pageLength = DEFAULT_PAGE_LENGTH;
int items = DEFAULT_NUMBER_OF_ITEMS;
if (request.getParameter(PAGE_LENGTH_REQUEST_PARAMETER) != null) {
- pageLength = Integer.parseInt(request
- .getParameter(PAGE_LENGTH_REQUEST_PARAMETER).toString());
+ pageLength = Integer.parseInt(
+ request.getParameter(PAGE_LENGTH_REQUEST_PARAMETER));
}
if (request.getParameter(ITEMS_REQUEST_PARAMETER) != null) {
- items = Integer.parseInt(
- request.getParameter(ITEMS_REQUEST_PARAMETER).toString());
+ items = Integer
+ .parseInt(request.getParameter(ITEMS_REQUEST_PARAMETER));
}
ComboBox<String> cb = new ComboBox<>();
diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java
index 8679ed7785..415bfe8a04 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java
@@ -24,14 +24,12 @@ public class ComboFocusBlurEvents extends TestBase {
final ObjectProperty<String> log = new ObjectProperty<>("");
cb.addFocusListener(event -> {
- log.setValue(log.getValue().toString() + "<br>" + counter
- + ": Focus event!");
+ log.setValue(log.getValue() + "<br>" + counter + ": Focus event!");
counter++;
});
cb.addBlurListener(event -> {
- log.setValue(log.getValue().toString() + "<br>" + counter
- + ": Blur event!");
+ log.setValue(log.getValue() + "<br>" + counter + ": Blur event!");
counter++;
});
diff --git a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java
index 18ac8ca8be..c919ca7822 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/combobox/ComboPushTiming.java
@@ -42,8 +42,8 @@ public class ComboPushTiming extends TestBase {
cb.addFocusListener(new FieldEvents.FocusListener() {
@Override
public void focus(FocusEvent event) {
- log.setValue(log.getValue().toString() + "<br>" + counter
- + ": Focus event!");
+ log.setValue(
+ log.getValue() + "<br>" + counter + ": Focus event!");
counter++;
changeValue(cb);
}
@@ -52,8 +52,8 @@ public class ComboPushTiming extends TestBase {
cb.addBlurListener(new FieldEvents.BlurListener() {
@Override
public void blur(BlurEvent event) {
- log.setValue(log.getValue().toString() + "<br>" + counter
- + ": Blur event!");
+ log.setValue(
+ log.getValue() + "<br>" + counter + ": Blur event!");
counter++;
}
});
diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFields.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFields.java
index daae32327a..5e8db6f14c 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFields.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFields.java
@@ -13,8 +13,8 @@ import com.vaadin.ui.DateField;
@SuppressWarnings("serial")
public class DateFields extends ComponentTestCase<DateField> {
- private static final Locale[] LOCALES = { Locale.US,
- Locale.TAIWAN, new Locale("fi", "FI") };
+ private static final Locale[] LOCALES = { Locale.US, Locale.TAIWAN,
+ new Locale("fi", "FI") };
@Override
protected Class<DateField> getTestClass() {
@@ -27,14 +27,14 @@ public class DateFields extends ComponentTestCase<DateField> {
for (Locale locale : LOCALES) {
DateField pd = createPopupDateField("Undefined width", "-1",
locale);
- pd.setId("Locale-" + locale.toString() + "-undefined-wide");
+ pd.setId("Locale-" + locale + "-undefined-wide");
addTestComponent(pd);
pd = createPopupDateField("500px width", "500px", locale);
- pd.setId("Locale-" + locale.toString() + "-500px-wide");
+ pd.setId("Locale-" + locale + "-500px-wide");
addTestComponent(pd);
pd = createPopupDateField("Initially empty", "", locale);
pd.setValue(null);
- pd.setId("Locale-" + locale.toString() + "-initially-empty");
+ pd.setId("Locale-" + locale + "-initially-empty");
addTestComponent(pd);
}
@@ -42,7 +42,7 @@ public class DateFields extends ComponentTestCase<DateField> {
private DateField createPopupDateField(String caption, String width,
Locale locale) {
- DateField pd = new DateField(caption + "(" + locale.toString() + ")");
+ DateField pd = new DateField(caption + "(" + locale + ")");
pd.setWidth(width);
pd.setValue(LocalDate.of(1970, 05, 23));
pd.setLocale(locale);
diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java
index 02da061d08..172c796ecf 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/InlineDateFields.java
@@ -13,8 +13,8 @@ import com.vaadin.ui.InlineDateField;
@SuppressWarnings("serial")
public class InlineDateFields extends ComponentTestCase<InlineDateField> {
- private static final Locale[] LOCALES = { Locale.US,
- Locale.TAIWAN, new Locale("fi", "FI") };
+ private static final Locale[] LOCALES = { Locale.US, Locale.TAIWAN,
+ new Locale("fi", "FI") };
@Override
protected Class<InlineDateField> getTestClass() {
@@ -32,22 +32,21 @@ public class InlineDateFields extends ComponentTestCase<InlineDateField> {
InlineDateField pd = createInlineDateField("Undefined width", "-1",
locale);
- pd.setId("Locale-" + locale.toString() + "-undefined-wide");
+ pd.setId("Locale-" + locale + "-undefined-wide");
addTestComponent(pd);
pd = createInlineDateField("300px width", "300px", locale);
- pd.setId("Locale-" + locale.toString() + "-300px-wide");
+ pd.setId("Locale-" + locale + "-300px-wide");
addTestComponent(pd);
pd = createInlineDateField("Initially empty", "", locale);
pd.setValue(null);
- pd.setId("Locale-" + locale.toString() + "-initially-empty");
+ pd.setId("Locale-" + locale + "-initially-empty");
addTestComponent(pd);
}
private InlineDateField createInlineDateField(String caption, String width,
Locale locale) {
- InlineDateField pd = new InlineDateField(
- caption + "(" + locale.toString() + ")");
+ InlineDateField pd = new InlineDateField(caption + "(" + locale + ")");
pd.setWidth(width);
pd.setValue(LocalDate.of(1970, 05, 23));
pd.setLocale(locale);
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java
index c9144e52f0..85ab5ab577 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java
@@ -91,7 +91,7 @@ public class GridBasics extends AbstractTestUIWithLog {
}
log("Columns reordered, userOriginated: "
+ event.isUserOriginated());
- log("Column order: " + columnCaptions.toString());
+ log("Column order: " + columnCaptions);
});
log("Registered a column reorder listener.");
}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroups.java b/uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroups.java
index 48f168803b..86ff1f3ffb 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroups.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/optiongroup/OptionGroups.java
@@ -53,7 +53,7 @@ public class OptionGroups extends AbstractSelectTestCase<OptionGroup> {
private void createDisabledItemsMultiToggle(String category) {
for (Object id : getComponent().getItemIds()) {
- createBooleanAction(id.toString() + " - enabled", category, true,
+ createBooleanAction(id + " - enabled", category, true,
enabledItemCommand, id);
}
}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java
index d9161a6a46..dbbe8d6ddc 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java
@@ -84,8 +84,7 @@ public class RadioButtonGroupTestUI
LinkedHashMap<String, ItemCaptionGenerator<Object>> options = new LinkedHashMap<>();
options.put("Null Caption Generator", item -> null);
options.put("Default Caption Generator", item -> item.toString());
- options.put("Custom Caption Generator",
- item -> item.toString() + " Caption");
+ options.put("Custom Caption Generator", item -> item + " Caption");
createSelectAction("Item Caption Generator", "Item Caption Generator",
options, "None", (radioButtonGroup, captionGenerator, data) -> {
@@ -99,7 +98,7 @@ public class RadioButtonGroupTestUI
options.put("Null Description Generator", item -> null);
options.put("Default Description Generator", item -> item.toString());
options.put("Custom Description Generator",
- item -> item.toString() + " Description");
+ item -> item + " Description");
createSelectAction("Item Description Generator",
"Item Description Generator", options, "None",
diff --git a/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
index 428b125a8b..290961e9ec 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
@@ -31,7 +31,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase {
msg += " Target:" + target.getClass().getSimpleName() + " '"
+ f.getCaption() + "'";
- String string = f.getValue().toString();
+ String string = f.getValue();
msg += " Value: " + string;
Notification notification = new Notification(msg);
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/ColumnReorderEvent.java b/uitest/src/main/java/com/vaadin/tests/components/table/ColumnReorderEvent.java
index d6d4fc85b0..68ed142a83 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/table/ColumnReorderEvent.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/ColumnReorderEvent.java
@@ -34,7 +34,7 @@ public class ColumnReorderEvent extends TestBase {
private String aToString(Object[] visibleColumns) {
StringBuilder sb = new StringBuilder();
for (Object object : visibleColumns) {
- sb.append(object.toString());
+ sb.append(object);
sb.append(" | ");
}
return sb.toString();
diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/KeyControl.java b/uitest/src/main/java/com/vaadin/tests/components/table/KeyControl.java
index dcc83878bf..55e97c5a31 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/table/KeyControl.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/table/KeyControl.java
@@ -45,8 +45,7 @@ public class KeyControl extends TestBase {
public void valueChange(ValueChangeEvent event) {
@SuppressWarnings("unchecked")
Set<String> value = (Set<String>) table1.getValue();
- selected1
- .setValue(value.toString() + " TOTAL: " + value.size());
+ selected1.setValue(value + " TOTAL: " + value.size());
}
});
diff --git a/uitest/src/main/java/com/vaadin/tests/components/textarea/ScrollCursor.java b/uitest/src/main/java/com/vaadin/tests/components/textarea/ScrollCursor.java
index 3fd15ecdcc..dd6a088b1a 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/textarea/ScrollCursor.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/textarea/ScrollCursor.java
@@ -64,7 +64,7 @@ public class ScrollCursor extends TestBase {
@Override
public void buttonClick(ClickEvent event) {
- position = textArea.getValue().toString().length();
+ position = textArea.getValue().length();
}
});
diff --git a/uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java b/uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java
index 6329d6fdd0..d66dd4641c 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java
@@ -66,13 +66,11 @@ public class TextFieldFocusAndBlurListeners extends TestBase
@Override
public void blur(BlurEvent event) {
TextField tf = (TextField) event.getComponent();
- log.log(tf.getCaption() + ": Blur. Value is: "
- + tf.getValue().toString());
+ log.log(tf.getCaption() + ": Blur. Value is: " + tf.getValue());
}
public void valueChange(TextField source) {
- log.log(source.getCaption() + ": ValueChange: "
- + source.getValue().toString());
+ log.log(source.getCaption() + ": ValueChange: " + source.getValue());
}
}
diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/PushStateAndReplaceState.java b/uitest/src/main/java/com/vaadin/tests/components/ui/PushStateAndReplaceState.java
index 962bcb95ca..d72e5f24af 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/ui/PushStateAndReplaceState.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/ui/PushStateAndReplaceState.java
@@ -40,7 +40,7 @@ public class PushStateAndReplaceState extends AbstractReindeerTestUI {
addComponent(replace);
addComponent(createButton("test", "Move to ./test",
- Page.getCurrent().getLocation().toString() + "/test"));
+ Page.getCurrent().getLocation() + "/test"));
addComponent(createButton("X", "Move to X", "X"));
addComponent(createButton("root_X", "Move to /X", "/X"));
}
@@ -67,7 +67,7 @@ public class PushStateAndReplaceState extends AbstractReindeerTestUI {
private void updateLabel() {
URI location = getPage().getLocation();
- locationLabel.setValue("Current Location: " + location.toString());
+ locationLabel.setValue("Current Location: " + location);
}
@Override
diff --git a/uitest/src/main/java/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java b/uitest/src/main/java/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java
index 74f0bb2f21..a31eb519b6 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java
@@ -32,7 +32,7 @@ public class RpcInvocationHandlerToString extends AbstractTestUIWithLog {
@Override
public void buttonClick(ClickEvent event) {
- log("An invoation proxy: " + dummyProxy.toString());
+ log("An invoation proxy: " + dummyProxy);
}
});
addButton("Exec hashCode() for an invocation proxy",
diff --git a/uitest/src/main/java/com/vaadin/tests/components/window/ShortcutInWindow.java b/uitest/src/main/java/com/vaadin/tests/components/window/ShortcutInWindow.java
index 983a30a8d2..dfb1ce155f 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/window/ShortcutInWindow.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/window/ShortcutInWindow.java
@@ -45,7 +45,7 @@ public class ShortcutInWindow extends AbstractTestUIWithLog {
ValueChangeMode m = ValueChangeMode.values()[i];
toggle.setCaption(m.toString());
name.setValueChangeMode(m);
- log("New ValueChangeMode: " + m.toString());
+ log("New ValueChangeMode: " + m);
});
final Button submit = new Button("Submit",
(e) -> log("Submitted value: " + name.getValue()));
diff --git a/uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java b/uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
index d1e2544257..9141665a94 100644
--- a/uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
@@ -89,7 +89,7 @@ public class BeanItemContainerFilteringTest extends TestBase {
container.removeAllContainerFilters();
if (event.getValue()) {
container.addContainerFilter("value",
- filterString.getValue().toString(), false, false);
+ filterString.getValue(), false, false);
}
});
vl.addComponent(cb);
@@ -143,8 +143,7 @@ public class BeanItemContainerFilteringTest extends TestBase {
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
- int index = Integer
- .parseInt(position.getValue().toString());
+ int index = Integer.parseInt(position.getValue());
TestBean bean = new TestBean(
"addItemAt() " + nextToAdd,
"value " + nextToAdd);
diff --git a/uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java b/uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
index ceaca59143..d020d53ad8 100644
--- a/uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
@@ -55,8 +55,8 @@ public class IndexedContainerFilteringTest extends TestBase {
cb.addValueChangeListener(event -> {
container.removeAllContainerFilters();
if (event.getValue()) {
- container.addContainerFilter("column1",
- filterString.getValue().toString(), false, false);
+ container.addContainerFilter("column1", filterString.getValue(),
+ false, false);
}
});
vl.addComponent(cb);
@@ -113,8 +113,7 @@ public class IndexedContainerFilteringTest extends TestBase {
new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
- int index = Integer
- .parseInt(position.getValue().toString());
+ int index = Integer.parseInt(position.getValue());
String id = "addItemAt() " + nextToAdd;
Item item = container.addItemAt(index, id);
if (item != null) {
diff --git a/uitest/src/main/java/com/vaadin/tests/dnd/DragImage.java b/uitest/src/main/java/com/vaadin/tests/dnd/DragImage.java
index 624461a536..fc215c3951 100644
--- a/uitest/src/main/java/com/vaadin/tests/dnd/DragImage.java
+++ b/uitest/src/main/java/com/vaadin/tests/dnd/DragImage.java
@@ -38,9 +38,7 @@ public class DragImage extends AbstractTestUIWithLog {
layout1.addComponents(label, new Label("spacer"));
- styles.add(new StringBuilder(".").append(position)
- .append(" { position: ").append(position).append(";}")
- .toString());
+ styles.add("." + position + " { position: " + position + ";}");
});
HorizontalLayout layout2 = new HorizontalLayout();
@@ -52,9 +50,7 @@ public class DragImage extends AbstractTestUIWithLog {
.setDragImage(new ThemeResource(TestSampler.ICON_URL));
layout2.addComponents(label, new Label("spacer"));
- styles.add(new StringBuilder(".").append(position)
- .append(" { position: ").append(position).append(";}")
- .toString());
+ styles.add("." + position + " { position: " + position + ";}");
});
// #9261 grid row like element that safari can't show the drag image for
diff --git a/uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java b/uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java
index 7a51c201d6..b2d871cf9a 100644
--- a/uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java
+++ b/uitest/src/main/java/com/vaadin/tests/layouts/OrderedLayoutBasics.java
@@ -547,7 +547,7 @@ public class OrderedLayoutBasics extends TestBase {
// AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER, valign[i % 3]);
// }
//
- // tf.setValue(tf.getValue().toString() + " (100% wide)");
+ // tf.setValue(tf.getValue() + " (100% wide)");
// tf.setWidth("100%");
// tf = new TextField("100%x70px Field");
@@ -640,7 +640,7 @@ public class OrderedLayoutBasics extends TestBase {
// AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER, valign[i % 3]);
// }
//
- // tf.setValue(tf.getValue().toString() + " (100% wide)");
+ // tf.setValue(tf.getValue() + " (100% wide)");
// tf.setWidth("100%");
// tf = new TextField("100%x70px Field");
diff --git a/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java b/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
index e9f8182e7f..f3c17b8a29 100644
--- a/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
+++ b/uitest/src/main/java/com/vaadin/tests/minitutorials/v71beta/CSSInjectWithColorpicker.java
@@ -170,7 +170,7 @@ public class CSSInjectWithColorpicker extends UI {
select.setEmptySelectionAllowed(false);
select.addValueChangeListener(event -> {
// Get the new font family
- String fontFamily = select.getValue().toString();
+ String fontFamily = select.getValue();
// Get the stylesheet of the page
Styles styles = Page.getCurrent().getStyles();
diff --git a/uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java
index a4b1a025b3..14e5a0683d 100644
--- a/uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/serialization/SerializerTest.java
@@ -452,7 +452,7 @@ public class SerializerTest extends AbstractReindeerTestUI {
@Override
public void sendWrappedGenerics(
Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> generics) {
- log.log("sendWrappedGenerics: " + generics.toString());
+ log.log("sendWrappedGenerics: " + generics);
}
@Override
diff --git a/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java b/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java
index 436a427e00..4d0891a2d5 100644
--- a/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java
+++ b/uitest/src/main/java/com/vaadin/tests/themes/CSSInjectTest.java
@@ -6,8 +6,8 @@ import java.util.UUID;
import com.vaadin.server.Page;
import com.vaadin.server.Page.Styles;
-import com.vaadin.shared.ui.ContentMode;
import com.vaadin.server.StreamResource;
+import com.vaadin.shared.ui.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -68,7 +68,7 @@ public class CSSInjectTest extends TestBase {
return new ByteArrayInputStream(
css.getBytes());
}
- }, UUID.randomUUID().toString() + ".css"));
+ }, UUID.randomUUID() + ".css"));
cssToInject.setValue("");
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldElementTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldElementTest.java
index de0cbaecd0..c56af7dafc 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldElementTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateFieldElementTest.java
@@ -53,8 +53,7 @@ public class DateFieldElementTest extends SingleBrowserTest {
}
private void assertServerValue(String id, LocalDate testDateTime) {
- assertEquals(id + " value set to " + testDateTime.toString(),
- getLogRow(0));
+ assertEquals(id + " value set to " + testDateTime, getLogRow(0));
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldElementTest.java b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldElementTest.java
index dd0cc8d4f8..5719a9d97f 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldElementTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/datefield/DateTimeFieldElementTest.java
@@ -56,8 +56,7 @@ public class DateTimeFieldElementTest extends SingleBrowserTest {
}
private void assertServerValue(String id, LocalDateTime testDateTime) {
- assertEquals(id + " value set to " + testDateTime.toString(),
- getLogRow(0));
+ assertEquals(id + " value set to " + testDateTime, getLogRow(0));
}
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/TB3TestLocator.java b/uitest/src/test/java/com/vaadin/tests/tb3/TB3TestLocator.java
index efcba7a2a7..a3267445b7 100644
--- a/uitest/src/test/java/com/vaadin/tests/tb3/TB3TestLocator.java
+++ b/uitest/src/test/java/com/vaadin/tests/tb3/TB3TestLocator.java
@@ -73,8 +73,7 @@ public class TB3TestLocator {
try {
File f = new File(location.toURI());
if (!f.exists()) {
- throw new IOException(
- "Directory " + f.toString() + " does not exist");
+ throw new IOException("Directory " + f + " does not exist");
}
findPackages(f, basePackage, baseClass, classes,
ignoredPackages);