diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-19 09:41:48 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-19 10:41:47 +0300 |
commit | 4a8195b59ef07c62a22e2f51cf49f1f2f9657638 (patch) | |
tree | 666b0eeacc411882af466eb15a5f5f59c47fe31b /server | |
parent | 7425cef7bfbffc6cf7ba1f2142157c94273268a9 (diff) | |
download | vaadin-framework-4a8195b59ef07c62a22e2f51cf49f1f2f9657638.tar.gz vaadin-framework-4a8195b59ef07c62a22e2f51cf49f1f2f9657638.zip |
Replace iterators with enhanced for loops (#10018)
This change also includes some other minor cleanup.
Diffstat (limited to 'server')
3 files changed, 4 insertions, 8 deletions
diff --git a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java index 19ece940e2..9e1134efed 100644 --- a/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java +++ b/server/src/main/java/com/vaadin/server/ComponentSizeValidator.java @@ -92,9 +92,7 @@ public class ComponentSizeValidator implements Serializable { } } else if (isForm(component)) { HasComponents form = (HasComponents) component; - for (Iterator<Component> iterator = form.iterator(); iterator - .hasNext();) { - Component child = iterator.next(); + for (Component child : form) { errors = validateComponentRelativeSizes(child, errors, parent); } } @@ -129,7 +127,7 @@ public class ComponentSizeValidator implements Serializable { StringBuffer err = new StringBuffer(); err.append("Vaadin DEBUG\n"); - StringBuilder indent = new StringBuilder(""); + StringBuilder indent = new StringBuilder(); ComponentInfo ci; if (attributes != null) { while (attributes.size() > LAYERS_SHOWN) { diff --git a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java index f7669ef135..a2df4203c8 100644 --- a/server/src/main/java/com/vaadin/server/JsonPaintTarget.java +++ b/server/src/main/java/com/vaadin/server/JsonPaintTarget.java @@ -224,7 +224,7 @@ public class JsonPaintTarget implements PaintTarget { */ static StringBuilder escapeXML(StringBuilder xml) { if (xml == null || xml.length() <= 0) { - return new StringBuilder(""); + return new StringBuilder(); } final StringBuilder result = new StringBuilder(xml.length() * 2); diff --git a/server/src/main/java/com/vaadin/ui/Upload.java b/server/src/main/java/com/vaadin/ui/Upload.java index 27029f20de..4c6e49cd24 100644 --- a/server/src/main/java/com/vaadin/ui/Upload.java +++ b/server/src/main/java/com/vaadin/ui/Upload.java @@ -841,9 +841,7 @@ public class Upload extends AbstractComponent // this is implemented differently than other listeners to maintain // backwards compatibility if (progressListeners != null) { - for (Iterator<ProgressListener> it = progressListeners - .iterator(); it.hasNext();) { - ProgressListener l = it.next(); + for (ProgressListener l : progressListeners) { l.updateProgress(totalBytes, contentLength); } } |