aboutsummaryrefslogtreecommitdiffstats
path: root/fop-util
diff options
context:
space:
mode:
authorSimon Steiner <ssteiner@apache.org>2016-09-16 11:40:57 +0000
committerSimon Steiner <ssteiner@apache.org>2016-09-16 11:40:57 +0000
commite5e89aa9e3799a2596f9f8e61c7f1edc5f95ab44 (patch)
tree77fb335036ece87ee0091ef08cb4d0b9c29cc37e /fop-util
parent46b7e0614c3251dbb50ea97211d8d79af3dedade (diff)
downloadxmlgraphics-fop-e5e89aa9e3799a2596f9f8e61c7f1edc5f95ab44.tar.gz
xmlgraphics-fop-e5e89aa9e3799a2596f9f8e61c7f1edc5f95ab44.zip
FOP-2648: Code cleanup, use foreach
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1761021 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-util')
-rw-r--r--fop-util/src/main/java/org/apache/fop/util/text/AdvancedMessageFormat.java20
1 files changed, 5 insertions, 15 deletions
diff --git a/fop-util/src/main/java/org/apache/fop/util/text/AdvancedMessageFormat.java b/fop-util/src/main/java/org/apache/fop/util/text/AdvancedMessageFormat.java
index f8508e082..acb851553 100644
--- a/fop-util/src/main/java/org/apache/fop/util/text/AdvancedMessageFormat.java
+++ b/fop-util/src/main/java/org/apache/fop/util/text/AdvancedMessageFormat.java
@@ -355,9 +355,7 @@ public class AdvancedMessageFormat {
target.append(obj);
} else {
boolean handled = false;
- Iterator<ObjectFormatter> iter = OBJECT_FORMATTERS.iterator();
- while (iter.hasNext()) {
- ObjectFormatter formatter = iter.next();
+ for (ObjectFormatter formatter : OBJECT_FORMATTERS) {
if (formatter.supportsObject(obj)) {
formatter.format(target, obj);
handled = true;
@@ -437,9 +435,7 @@ public class AdvancedMessageFormat {
public void write(StringBuffer sb, Map<String, Object> params) {
if (hasSections) {
- Iterator<Part> iter = this.parts.iterator();
- while (iter.hasNext()) {
- Part part = iter.next();
+ for (Part part : this.parts) {
if (part.isGenerated(params)) {
part.write(sb, params);
break;
@@ -447,9 +443,7 @@ public class AdvancedMessageFormat {
}
} else {
if (isGenerated(params)) {
- Iterator<Part> iter = this.parts.iterator();
- while (iter.hasNext()) {
- Part part = iter.next();
+ for (Part part : this.parts) {
part.write(sb, params);
}
}
@@ -458,9 +452,7 @@ public class AdvancedMessageFormat {
public boolean isGenerated(Map<String, Object> params) {
if (hasSections) {
- Iterator<Part> iter = this.parts.iterator();
- while (iter.hasNext()) {
- Part part = iter.next();
+ for (Part part : this.parts) {
if (part.isGenerated(params)) {
return true;
}
@@ -468,9 +460,7 @@ public class AdvancedMessageFormat {
return false;
} else {
if (conditional) {
- Iterator<Part> iter = this.parts.iterator();
- while (iter.hasNext()) {
- Part part = iter.next();
+ for (Part part : this.parts) {
if (!part.isGenerated(params)) {
return false;
}