aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-10-02 11:43:19 +0200
committerHenri Sara <henri.sara@gmail.com>2017-10-02 12:43:19 +0300
commit7e4b4ff5a9e9eca6810d473a4d7681a61c9a89ce (patch)
tree9351fb5d91124db9935f684da60bdb74ef01881d /client
parent43f4a17f0d17e584e83ea3faaa40ac1def1dd4b1 (diff)
downloadvaadin-framework-7e4b4ff5a9e9eca6810d473a4d7681a61c9a89ce.tar.gz
vaadin-framework-7e4b4ff5a9e9eca6810d473a4d7681a61c9a89ce.zip
Use enhanced for loop for arrays. (#10121)
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java3
-rw-r--r--client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java4
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VAbsoluteLayout.java5
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VContextMenu.java3
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VWindow.java3
-rw-r--r--client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java4
6 files changed, 9 insertions, 13 deletions
diff --git a/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java b/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java
index fe69446a7c..aff8e5d268 100644
--- a/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java
+++ b/client/src/main/java/com/vaadin/client/debug/internal/VDebugWindow.java
@@ -843,8 +843,7 @@ public final class VDebugWindow extends VOverlay {
}
};
modes[getDevMode()].setActive(true);
- for (int i = 0; i < modes.length; i++) {
- Button b = modes[i];
+ for (Button b : modes) {
b.addClickHandler(modeHandler);
mode.add(b);
}
diff --git a/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java b/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java
index d0bf748a93..dbde2df222 100644
--- a/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java
+++ b/client/src/main/java/com/vaadin/client/ui/ShortcutActionHandler.java
@@ -187,8 +187,8 @@ class ShortcutKeyCombination {
modifiersMask = 0;
if (modifiers != null) {
- for (int i = 0; i < modifiers.length; i++) {
- switch (modifiers[i]) {
+ for (int modifier : modifiers) {
+ switch (modifier) {
case ALT:
modifiersMask = modifiersMask
| KeyboardListener.MODIFIER_ALT;
diff --git a/client/src/main/java/com/vaadin/client/ui/VAbsoluteLayout.java b/client/src/main/java/com/vaadin/client/ui/VAbsoluteLayout.java
index d3864d7c03..ec6a5e2496 100644
--- a/client/src/main/java/com/vaadin/client/ui/VAbsoluteLayout.java
+++ b/client/src/main/java/com/vaadin/client/ui/VAbsoluteLayout.java
@@ -430,9 +430,8 @@ public class VAbsoluteLayout extends ComplexPanel {
css = position;
top = right = bottom = left = zIndex = null;
if (!css.isEmpty()) {
- String[] properties = css.split(";");
- for (int i = 0; i < properties.length; i++) {
- String[] keyValue = properties[i].split(":");
+ for (String property : css.split(";")) {
+ String[] keyValue = property.split(":");
if (keyValue[0].equals("left")) {
left = keyValue[1];
} else if (keyValue[0].equals("top")) {
diff --git a/client/src/main/java/com/vaadin/client/ui/VContextMenu.java b/client/src/main/java/com/vaadin/client/ui/VContextMenu.java
index 2e6f1db697..fec956270e 100644
--- a/client/src/main/java/com/vaadin/client/ui/VContextMenu.java
+++ b/client/src/main/java/com/vaadin/client/ui/VContextMenu.java
@@ -127,8 +127,7 @@ public class VContextMenu extends VOverlay implements SubPartAware {
this.left = left;
this.top = top;
menu.clearItems();
- for (int i = 0; i < actions.length; i++) {
- final Action a = actions[i];
+ for (final Action a : actions) {
menu.addItem(new MenuItem(a.getHTML(), true, a));
}
diff --git a/client/src/main/java/com/vaadin/client/ui/VWindow.java b/client/src/main/java/com/vaadin/client/ui/VWindow.java
index 333050c9d9..c39da6d168 100644
--- a/client/src/main/java/com/vaadin/client/ui/VWindow.java
+++ b/client/src/main/java/com/vaadin/client/ui/VWindow.java
@@ -571,8 +571,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner,
}
}
});
- for (int i = 0; i < array.length; i++) {
- VWindow w = array[i];
+ for (VWindow w : array) {
if (w.bringToFrontSequence != -1 || w.vaadinModality) {
w.bringToFront(false);
w.bringToFrontSequence = -1;
diff --git a/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java b/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java
index 41b8c6b8e0..40817c5d32 100644
--- a/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java
+++ b/client/src/main/java/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java
@@ -54,8 +54,8 @@ public class VLazyInitItemIdentifiers extends VAcceptCriterion {
hashSet = new HashSet<>();
String[] stringArrayAttribute = response
.getStringArrayAttribute("allowedIds");
- for (int i = 0; i < stringArrayAttribute.length; i++) {
- hashSet.add(stringArrayAttribute[i]);
+ for (String attribute : stringArrayAttribute) {
+ hashSet.add(attribute);
}
loaded = true;
if (accepted) {