From 9d56889e8b43066bea3221b0b3ee524f89807d39 Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Wed, 27 Apr 2011 08:03:30 +0000 Subject: [PATCH] Cleaned up loops to use shorthand for-loops instead of iterator based for better readability #5992 svn changeset:18484/svn branch:6.6 --- src/com/vaadin/ui/Table.java | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 171096b5b2..cb956e25a9 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -2141,16 +2141,14 @@ public class Table extends AbstractSelect implements Action.Container, if (action != null && containsId(itemId) && actionHandlers != null) { // Item action - for (final Iterator 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 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 actionSet = new LinkedHashSet(); if (actionHandlers != null) { final ArrayList keys = new ArrayList(); - for (final Iterator 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 keys = new ArrayList(); - for (final Iterator 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]); -- 2.39.5