Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-09-27 10:20:05 +0000
committerAlexander Kurtakov2017-09-27 10:20:05 +0000
commit3f325cfa6dd292714f8d0e227c2f9c087f472d99 (patch)
treed8d8cbddc9404b78e7572763af0c5b6a0b67df0c /tests/org.eclipse.swt.tests
parentbad6608d1453de25acd49b4a15152ffd37592101 (diff)
downloadeclipse.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')
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java5
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java7
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;
}

Back to the top