aboutsummaryrefslogtreecommitdiffstats
path: root/compatibility-server/src/main/java/com
diff options
context:
space:
mode:
authorAhmed Ashour <asashour@yahoo.com>2017-10-03 09:49:07 +0200
committerHenri Sara <henri.sara@gmail.com>2017-10-03 10:49:07 +0300
commit28b52d687dade66154a4fcd545415bf0d01b0a53 (patch)
treeecd79ff3ccee5c8a50257833aa8264c08a291b23 /compatibility-server/src/main/java/com
parent7e4b4ff5a9e9eca6810d473a4d7681a61c9a89ce (diff)
downloadvaadin-framework-28b52d687dade66154a4fcd545415bf0d01b0a53.tar.gz
vaadin-framework-28b52d687dade66154a4fcd545415bf0d01b0a53.zip
Remove unneeded .toArray() (#10131)
Use for each loop.
Diffstat (limited to 'compatibility-server/src/main/java/com')
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/data/util/HierarchicalContainer.java3
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/data/util/IndexedContainer.java1
-rw-r--r--compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java12
3 files changed, 6 insertions, 10 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/HierarchicalContainer.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/HierarchicalContainer.java
index da6ff62b92..ad995fa20a 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/HierarchicalContainer.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/HierarchicalContainer.java
@@ -593,8 +593,7 @@ public class HierarchicalContainer extends IndexedContainer
public boolean removeItemRecursively(Object itemId) {
disableContentsChangeEvents();
try {
- boolean removeItemRecursively = removeItemRecursively(this, itemId);
- return removeItemRecursively;
+ return removeItemRecursively(this, itemId);
} finally {
enableAndFireContentsChangeEvents();
}
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/IndexedContainer.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/IndexedContainer.java
index 98f2deecac..fd1c768e9f 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/IndexedContainer.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/IndexedContainer.java
@@ -550,7 +550,6 @@ public class IndexedContainer
}
}
}
-
}
@Override
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java
index ea8fa1c528..747a0eea51 100644
--- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java
+++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Form.java
@@ -657,11 +657,10 @@ public class Form extends AbstractField<Object>
* (and only if) the return value is <code>true</code>.
*/
public boolean removeAllProperties() {
- final Object[] properties = propertyIds.toArray();
boolean success = true;
- for (int i = 0; i < properties.length; i++) {
- if (!removeItemProperty(properties[i])) {
+ for (Object property : propertyIds.toArray()) {
+ if (!removeItemProperty(property)) {
success = false;
}
}
@@ -809,13 +808,12 @@ public class Form extends AbstractField<Object>
// Move fields from previous layout
if (getLayout() != null) {
- final Object[] properties = propertyIds.toArray();
- for (int i = 0; i < properties.length; i++) {
- Field<?> f = getField(properties[i]);
+ for (Object property : propertyIds) {
+ Field<?> f = getField(property);
detachField(f);
if (layout instanceof CustomLayout) {
((CustomLayout) layout).addComponent(f,
- properties[i].toString());
+ property.toString());
} else {
layout.addComponent(f);
}