summaryrefslogtreecommitdiffstats
path: root/compatibility-server/src/test
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-09-29 14:14:05 +0200
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-09-29 15:14:05 +0300
commitadcf2e2e80c6a05ea5e43be15dc7a2576fd2bbb4 (patch)
tree0a58b0b09cb371f757d74f83ad872f2113f96272 /compatibility-server/src/test
parent46950473fdb3cfb9d44660b3a642a9229cecded2 (diff)
downloadvaadin-framework-adcf2e2e80c6a05ea5e43be15dc7a2576fd2bbb4.tar.gz
vaadin-framework-adcf2e2e80c6a05ea5e43be15dc7a2576fd2bbb4.zip
Use enhanced for loop instead of Iterator. (#10100)
Diffstat (limited to 'compatibility-server/src/test')
-rw-r--r--compatibility-server/src/test/java/com/vaadin/v7/data/util/BeanItemContainerTest.java6
-rw-r--r--compatibility-server/src/test/java/com/vaadin/v7/data/util/ContainerSortingTest.java5
2 files changed, 3 insertions, 8 deletions
diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/BeanItemContainerTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/BeanItemContainerTest.java
index 31d96fb47e..dee7c3fee3 100644
--- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/BeanItemContainerTest.java
+++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/BeanItemContainerTest.java
@@ -9,7 +9,6 @@ import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -60,9 +59,8 @@ public class BeanItemContainerTest extends AbstractBeanContainerTestBase {
beanItemContainer.removeAllItems();
- Iterator<ClassName> it = nameToBean.values().iterator();
- while (it.hasNext()) {
- beanItemContainer.addBean(it.next());
+ for (ClassName name : nameToBean.values()) {
+ beanItemContainer.addBean(name);
}
}
diff --git a/compatibility-server/src/test/java/com/vaadin/v7/data/util/ContainerSortingTest.java b/compatibility-server/src/test/java/com/vaadin/v7/data/util/ContainerSortingTest.java
index 860f3b7b15..539835f1c5 100644
--- a/compatibility-server/src/test/java/com/vaadin/v7/data/util/ContainerSortingTest.java
+++ b/compatibility-server/src/test/java/com/vaadin/v7/data/util/ContainerSortingTest.java
@@ -1,7 +1,6 @@
package com.vaadin.v7.data.util;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.junit.Test;
@@ -154,10 +153,8 @@ public class ContainerSortingTest {
private void verifyOrder(Container.Sortable ic, Object[] idOrder) {
int size = ic.size();
Object[] actual = new Object[size];
- Iterator<?> i = ic.getItemIds().iterator();
int index = 0;
- while (i.hasNext()) {
- Object o = i.next();
+ for (Object o : ic.getItemIds()) {
if (o.getClass() == Integer.class
&& idOrder[index].getClass() == String.class) {
o = idToName.get(o);