commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject svn commit: r1510677 - in /commons/proper/email/trunk/src/main/java/org/apache/commons/mail: Email.java HtmlEmail.java
Date Mon, 05 Aug 2013 19:31:10 GMT
Author: britter
Date: Mon Aug  5 19:31:10 2013
New Revision: 1510677

URL: http://svn.apache.org/r1510677
Log:
Replace while loops with enhanced for loops

Modified:
    commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java
    commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java

Modified: commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java?rev=1510677&r1=1510676&r2=1510677&view=diff
==============================================================================
--- commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java (original)
+++ commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java Mon Aug  5
19:31:10 2013
@@ -1160,11 +1160,7 @@ public abstract class Email
     {
         this.headers.clear();
 
-        Iterator<Map.Entry<String, String>> iterKeyBad = map.entrySet().iterator();
-
-        while (iterKeyBad.hasNext())
-        {
-            Map.Entry<String, String> entry = iterKeyBad.next();
+        for (Map.Entry<String, String> entry : map.entrySet()) {
             addHeader(entry.getKey(), entry.getValue());
         }
     }

Modified: commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java?rev=1510677&r1=1510676&r2=1510677&view=diff
==============================================================================
--- commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java (original)
+++ commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java Mon Aug
 5 19:31:10 2013
@@ -589,11 +589,8 @@ public class HtmlEmail extends MultiPart
                 msgHtml.setContent(this.html, EmailConstants.TEXT_HTML);
             }
 
-            Iterator<InlineImage> iter = this.inlineEmbeds.values().iterator();
-            while (iter.hasNext())
-            {
-                InlineImage ii = iter.next();
-                bodyEmbedsContainer.addBodyPart(ii.getMbp());
+            for (InlineImage image : this.inlineEmbeds.values()) {
+                bodyEmbedsContainer.addBodyPart(image.getMbp());
             }
         }
 



Mime
View raw message