From 4a8195b59ef07c62a22e2f51cf49f1f2f9657638 Mon Sep 17 00:00:00 2001 From: Ahmed Ashour Date: Tue, 19 Sep 2017 09:41:48 +0200 Subject: Replace iterators with enhanced for loops (#10018) This change also includes some other minor cleanup. --- .../java/com/vaadin/v7/client/ui/VScrollTable.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'compatibility-client') diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java index 96942dd803..38bb1943cf 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java @@ -4031,9 +4031,8 @@ public class VScrollTable extends FlowPanel for (i = 0; i < visibleColOrder.length; i++) { cols[i] = visibleColOrder[i]; } - for (final Iterator it = collapsedColumns.iterator(); it - .hasNext();) { - cols[i++] = it.next(); + for (final String column : collapsedColumns) { + cols[i++] = column; } } List actions = new ArrayList(cols.length); @@ -4401,11 +4400,11 @@ public class VScrollTable extends FlowPanel .getOffsetWidth() + getHeaderPadding(); if (columnIndex < 0) { columnIndex = 0; - for (Iterator it = tHead.iterator(); it - .hasNext(); columnIndex++) { - if (it.next() == this) { + for (Widget widget : tHead) { + if (widget == this) { break; } + columnIndex++; } } final int cw = scrollBody.getColWidth(columnIndex); @@ -6441,14 +6440,10 @@ public class VScrollTable extends FlowPanel // Hide rows which are not selected Element dragImage = ev.getDragImage(); int i = 0; - for (Iterator iterator = scrollBody - .iterator(); iterator.hasNext();) { - VScrollTableRow next = (VScrollTableRow) iterator - .next(); - + for (Widget next : scrollBody) { Element child = (Element) dragImage.getChild(i++); - if (!rowKeyIsSelected(next.rowKey)) { + if (!rowKeyIsSelected(((VScrollTableRow) next).rowKey)) { child.getStyle().setVisibility(Visibility.HIDDEN); } } -- cgit v1.2.3