diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-10-02 11:43:19 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-10-02 12:43:19 +0300 |
commit | 7e4b4ff5a9e9eca6810d473a4d7681a61c9a89ce (patch) | |
tree | 9351fb5d91124db9935f684da60bdb74ef01881d /compatibility-client | |
parent | 43f4a17f0d17e584e83ea3faaa40ac1def1dd4b1 (diff) | |
download | vaadin-framework-7e4b4ff5a9e9eca6810d473a4d7681a61c9a89ce.tar.gz vaadin-framework-7e4b4ff5a9e9eca6810d473a4d7681a61c9a89ce.zip |
Use enhanced for loop for arrays. (#10121)
Diffstat (limited to 'compatibility-client')
-rw-r--r-- | compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java | 18 | ||||
-rw-r--r-- | compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayToolbar.java | 4 |
2 files changed, 9 insertions, 13 deletions
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 fc91260783..751f7cb3fe 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 @@ -1702,9 +1702,7 @@ public class VScrollTable extends FlowPanel tHead.removeCell(ROW_HEADER_COLUMN_KEY); } - int i; - for (i = 0; i < strings.length; i++) { - final String cid = strings[i]; + for (final String cid : strings) { visibleColOrder[colIndex] = cid; tHead.enableColumn(cid, colIndex); colIndex++; @@ -1737,9 +1735,7 @@ public class VScrollTable extends FlowPanel tFoot.removeCell(ROW_HEADER_COLUMN_KEY); } - int i; - for (i = 0; i < strings.length; i++) { - final String cid = strings[i]; + for (final String cid : strings) { tFoot.enableColumn(cid, colIndex); colIndex++; } @@ -2118,11 +2114,11 @@ public class VScrollTable extends FlowPanel newIndex--; // columnOrder don't have rowHeader } // add back hidden rows, - for (int i = 0; i < columnOrder.length; i++) { - if (columnOrder[i].equals(oldKeyOnNewIndex)) { + for (String order : columnOrder) { + if (order.equals(oldKeyOnNewIndex)) { break; // break loop at target } - if (isCollapsedColumn(columnOrder[i])) { + if (isCollapsedColumn(order)) { newIndex++; } } @@ -4036,8 +4032,8 @@ public class VScrollTable extends FlowPanel } List<Action> actions = new ArrayList<Action>(cols.length); - for (int i = 0; i < cols.length; i++) { - final String cid = (String) cols[i]; + for (Object col : cols) { + final String cid = (String) col; boolean noncollapsible = noncollapsibleColumns.contains(cid); if (noncollapsible diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayToolbar.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayToolbar.java index 4c745f39c1..b7d31cd7f3 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayToolbar.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayToolbar.java @@ -35,8 +35,8 @@ public class SimpleDayToolbar extends HorizontalPanel { public void setDayNames(String[] dayNames) { clear(); - for (int i = 0; i < dayNames.length; i++) { - Label l = new Label(dayNames[i]); + for (String dayName : dayNames) { + Label l = new Label(dayName); l.setStylePrimaryName("v-calendar-header-day"); add(l); } |