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-text.git


The following commit(s) were added to refs/heads/master by this push:
     new 974cf77c Use for-each loop
974cf77c is described below

commit 974cf77c04bc544e9b0b1e9f448a7fecdc6ef9e9
Author: Gary Gregory <gardgreg...@gmail.com>
AuthorDate: Sat Jul 9 09:11:30 2022 -0400

    Use for-each loop
---
 src/main/java/org/apache/commons/text/ExtendedMessageFormat.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java 
b/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
index bbf15c8d..6b42afe7 100644
--- a/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
+++ b/src/main/java/org/apache/commons/text/ExtendedMessageFormat.java
@@ -23,7 +23,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Locale;
 import java.util.Locale.Category;
 import java.util.Map;
@@ -271,11 +270,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);
         }

Reply via email to