]> source.dussan.org Git - vaadin-framework.git/commitdiff
Cleaned up loops to use shorthand for-loops instead of iterator based for better...
authorJohn Alhroos <john.ahlroos@itmill.com>
Wed, 27 Apr 2011 08:03:30 +0000 (08:03 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Wed, 27 Apr 2011 08:03:30 +0000 (08:03 +0000)
svn changeset:18484/svn branch:6.6

src/com/vaadin/ui/Table.java

index 171096b5b2a4d40bb847a97273bc3815f5e5e783..cb956e25a9fcdc8e9c33164501f9f4617dc87041 100644 (file)
@@ -2141,16 +2141,14 @@ public class Table extends AbstractSelect implements Action.Container,
                 if (action != null && containsId(itemId)
                         && actionHandlers != null) {
                     // Item action
-                    for (final Iterator<Handler> i = actionHandlers.iterator(); i
-                            .hasNext();) {
-                        (i.next()).handleAction(action, this, itemId);
+                    for (Handler ah : actionHandlers) {
+                        ah.handleAction(action, this, itemId);
                     }
                 } else if (action != null && actionHandlers != null
                         && itemId == null) {
                     // Body action
-                    for (final Iterator<Handler> i = actionHandlers.iterator(); i
-                            .hasNext();) {
-                        (i.next()).handleAction(action, this, null);
+                    for (Handler ah : actionHandlers) {
+                        ah.handleAction(action, this, null);
                     }
                 }
             }
@@ -2392,12 +2390,10 @@ public class Table extends AbstractSelect implements Action.Container,
         final Set<Action> actionSet = new LinkedHashSet<Action>();
         if (actionHandlers != null) {
             final ArrayList<String> keys = new ArrayList<String>();
-            for (final Iterator<Handler> ahi = actionHandlers.iterator(); ahi
-                    .hasNext();) {
-
+            for (Handler ah : actionHandlers) {
                 // Getting actions for the null item, which in this case means
                 // the body item
-                final Action[] aa = (ahi.next()).getActions(null, this);
+                final Action[] aa = ah.getActions(null, this);
                 if (aa != null) {
                     for (int ai = 0; ai < aa.length; ai++) {
                         final String key = actionMapper.key(aa[ai]);
@@ -2652,9 +2648,8 @@ public class Table extends AbstractSelect implements Action.Container,
         // Actions
         if (actionHandlers != null) {
             final ArrayList<String> keys = new ArrayList<String>();
-            for (final Iterator<Handler> ahi = actionHandlers.iterator(); ahi
-                    .hasNext();) {
-                final Action[] aa = (ahi.next()).getActions(itemId, this);
+            for (Handler ah : actionHandlers) {
+                final Action[] aa = ah.getActions(itemId, this);
                 if (aa != null) {
                     for (int ai = 0; ai < aa.length; ai++) {
                         final String key = actionMapper.key(aa[ai]);