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 /examples
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 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet352.java6
1 files changed, 2 insertions, 4 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);
}

Back to the top