diff options
author | Alexander Kurtakov | 2017-09-27 10:20:05 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2017-09-27 10:20:05 +0000 |
commit | 3f325cfa6dd292714f8d0e227c2f9c087f472d99 (patch) | |
tree | d8d8cbddc9404b78e7572763af0c5b6a0b67df0c /tests/org.eclipse.swt.tests | |
parent | bad6608d1453de25acd49b4a15152ffd37592101 (diff) | |
download | eclipse.platform.swt-3f325cfa6dd292714f8d0e227c2f9c087f472d99.tar.gz eclipse.platform.swt-3f325cfa6dd292714f8d0e227c2f9c087f472d99.tar.xz eclipse.platform.swt-3f325cfa6dd292714f8d0e227c2f9c087f472d99.zip |
Bug 525264 - Use foreach in snippets and examples
Change-Id: I083db281df708346964203015bd9663bb8e943e1
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'tests/org.eclipse.swt.tests')
2 files changed, 4 insertions, 8 deletions
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; } |