diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-10-10 12:06:27 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-10-10 13:06:27 +0300 |
commit | ab18b6c58ef819dbc0049c4713cf06209d5abc47 (patch) | |
tree | 84aec85fe2dbeae4b9b340481c5a18228c4ec296 /uitest | |
parent | 802bb98b851ab9b15617b283ccdba3dbc517ada6 (diff) | |
download | vaadin-framework-ab18b6c58ef819dbc0049c4713cf06209d5abc47.tar.gz vaadin-framework-ab18b6c58ef819dbc0049c4713cf06209d5abc47.zip |
Remove unneeded .toString() (#10141)
Diffstat (limited to 'uitest')
42 files changed, 86 insertions, 107 deletions
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); |