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/09/14 18:48:44 UTC

[commons-validator] branch master updated: Use Java 5 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-validator.git


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

commit 5f5823d35ab944c49579ed9ab4873e4bcca74770
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Sep 14 14:48:40 2022 -0400

    Use Java 5 for each loop
---
 .../org/apache/commons/validator/routines/DomainValidatorTest.java  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java b/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
index 0827d218..65ac766b 100644
--- a/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
+++ b/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
@@ -32,9 +32,9 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.regex.Matcher;
@@ -418,9 +418,7 @@ public class DomainValidatorTest extends TestCase {
         if (header != null) {
             System.out.println("        // Taken from " + header);
         }
-        final Iterator<Map.Entry<String, String>> it = map.entrySet().iterator();
-        while(it.hasNext()){
-            final Map.Entry<String, String> me = it.next();
+        for (Entry<String, String> me : map.entrySet()) {
             System.out.println("        \"" + me.getKey() + "\", // " + me.getValue());
         }
         System.out.println("\nDone");