diff options
3 files changed, 6 insertions, 12 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet352.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet352.java index 2512ea6029..00edf39ba7 100644 --- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet352.java +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet352.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2016 IBM Corporation and others. + * Copyright (c) 2011, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -79,9 +79,7 @@ public class Snippet352 { }; PaintListener pl = e -> { - Iterator<Map.Entry<Long, CircleInfo>> iter = touchLocations.entrySet().iterator(); - while (iter.hasNext()) { - CircleInfo ci = iter.next().getValue(); + for (CircleInfo ci : touchLocations.values()) { e.gc.setBackground(ci.color); e.gc.fillOval(ci.center.x - CIRCLE_RADIUS, ci.center.y - CIRCLE_RADIUS, CIRCLE_RADIUS * 2, CIRCLE_RADIUS * 2); } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java index e6db877958..4889111be3 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java @@ -17,7 +17,6 @@ import static org.junit.Assert.assertTrue; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -57,9 +56,7 @@ public void setUp() { @After public void tearDown() { - Iterator<RGB> elements = colors.keySet().iterator(); - while (elements.hasNext()) { - Color color = colors.get(elements.next()); + for (Color color : colors.values()) { color.dispose(); } } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java index b169c2b7bf..8c5b8bfdd0 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. + * Copyright (c) 2000, 2017 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -405,9 +405,8 @@ public void test_fastStringDrawing() { public static Test suite() { TestSuite suite = new TestSuite(); java.util.List<String> methodNames = methodNames(); - java.util.Iterator<String> e = methodNames.iterator(); - while (e.hasNext()) { - suite.addTest(new Test_situational(e.next())); + for (String e : methodNames) { + suite.addTest(new Test_situational(e)); } return suite; } |