diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-10-12 10:46:06 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-10-12 11:46:06 +0300 |
commit | c147b5d85bca3ddf30d9adbcd268066165889f37 (patch) | |
tree | 18d73bda278618004ec4a28ee62af7eb7edbeb98 /uitest/src/main | |
parent | 13d406a7086cc1546eac3fa86f6263bfb436de85 (diff) | |
download | vaadin-framework-c147b5d85bca3ddf30d9adbcd268066165889f37.tar.gz vaadin-framework-c147b5d85bca3ddf30d9adbcd268066165889f37.zip |
Use Collection.isEmpty() (#10172)
Diffstat (limited to 'uitest/src/main')
4 files changed, 4 insertions, 4 deletions
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 55e97c5a31..5f6c9d5cb5 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 @@ -92,7 +92,7 @@ public class KeyControl extends TestBase { public void valueChange(ValueChangeEvent event) { @SuppressWarnings("unchecked") Set<String> value = (Set<String>) table3.getValue(); - selected3.setValue(value.size() == 0 ? "No selected items" + selected3.setValue(value.isEmpty() ? "No selected items" : value + ": Total " + value.size() + " items"); } }); diff --git a/uitest/src/main/java/com/vaadin/tests/components/table/LargeSelectionCausesNPE.java b/uitest/src/main/java/com/vaadin/tests/components/table/LargeSelectionCausesNPE.java index a920be534f..fd39ec377b 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/table/LargeSelectionCausesNPE.java +++ b/uitest/src/main/java/com/vaadin/tests/components/table/LargeSelectionCausesNPE.java @@ -109,7 +109,7 @@ public class LargeSelectionCausesNPE extends TestBase { // in multiselect mode, a Set of itemIds is returned, // in singleselect mode the itemId is returned directly Set<?> value = (Set<?>) event.getProperty().getValue(); - if (null == value || value.size() == 0) { + if (null == value || value.isEmpty()) { selected.setValue("No selection"); } else { selected.setValue("Selected: " + table.getValue()); diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/tree/CtrlShiftMultiselect.java b/uitest/src/main/java/com/vaadin/v7/tests/components/tree/CtrlShiftMultiselect.java index ca80a31e51..884f0a2d2b 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/tree/CtrlShiftMultiselect.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/tree/CtrlShiftMultiselect.java @@ -36,7 +36,7 @@ public class CtrlShiftMultiselect extends TestBase { @SuppressWarnings("unchecked") // safe cast after instanceof check Set<Object> itemIds = (Set<Object>) tree.getValue(); - if (itemIds.size() == 0) { + if (itemIds.isEmpty()) { valueLbl.setValue("No selection"); } else { valueLbl.setValue(itemIds.toString()); diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/tree/ExpandCollapseTree.java b/uitest/src/main/java/com/vaadin/v7/tests/components/tree/ExpandCollapseTree.java index 85765384c0..af88e41c1f 100644 --- a/uitest/src/main/java/com/vaadin/v7/tests/components/tree/ExpandCollapseTree.java +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/tree/ExpandCollapseTree.java @@ -36,7 +36,7 @@ public class ExpandCollapseTree extends TestBase { @SuppressWarnings("unchecked") // safe cast after instanceof check Set<Object> itemIds = (Set<Object>) tree.getValue(); - if (itemIds.size() == 0) { + if (itemIds.isEmpty()) { valueLbl.setValue("No selection"); } else { valueLbl.setValue(itemIds.toString()); |