You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2022/07/09 12:53:20 UTC
[commons-lang] branch master updated: Use for-each loop
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 3ac6beab4 Use for-each loop
3ac6beab4 is described below
commit 3ac6beab459a7ba1757c35847a2f38d074d2d6a5
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jul 9 08:53:12 2022 -0400
Use for-each loop
---
.../java/org/apache/commons/lang3/text/ExtendedMessageFormat.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java b/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
index 22a73537d..6d916539c 100644
--- a/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
+++ b/src/main/java/org/apache/commons/lang3/text/ExtendedMessageFormat.java
@@ -21,7 +21,6 @@ import java.text.MessageFormat;
import java.text.ParsePosition;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
@@ -208,11 +207,11 @@ public class ExtendedMessageFormat extends MessageFormat {
// only loop over what we know we have, as MessageFormat on Java 1.3
// seems to provide an extra format element:
int i = 0;
- for (final Iterator<Format> it = foundFormats.iterator(); it.hasNext(); i++) {
- final Format f = it.next();
+ for (final Format f : foundFormats) {
if (f != null) {
origFormats[i] = f;
}
+ i++;
}
super.setFormats(origFormats);
}