commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1417125 - /commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java
Date Tue, 04 Dec 2012 19:17:52 GMT
Author: sebb
Date: Tue Dec  4 19:17:51 2012
New Revision: 1417125

URL: http://svn.apache.org/viewvc?rev=1417125&view=rev
Log:
Fix more generics types, based on Javadoc where necessary

Modified:
    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/HtmlEmail.java
URL: http://svn.apache.org/viewvc/commons/proper/email/trunk/src/main/java/org/apache/commons/mail/HtmlEmail.java?rev=1417125&r1=1417124&r2=1417125&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 Tue Dec
 4 19:17:51 2012
@@ -109,13 +109,13 @@ public class HtmlEmail extends MultiPart
      * objects are now stored in {@link #inlineEmbeds}.
      */
     @Deprecated
-    protected List inlineImages;
+    protected List<InlineImage> inlineImages;
 
     /**
      * Embedded images Map<String, InlineImage> where the key is the
      * user-defined image name.
      */
-    protected Map inlineEmbeds = new HashMap();
+    protected Map<String, InlineImage> inlineEmbeds = new HashMap<String, InlineImage>();
 
     /**
      * Set the text content.
@@ -265,7 +265,7 @@ public class HtmlEmail extends MultiPart
         // if so, return the cached CID value.
         if (inlineEmbeds.containsKey(name))
         {
-            InlineImage ii = (InlineImage) inlineEmbeds.get(name);
+            InlineImage ii = inlineEmbeds.get(name);
             URLDataSource urlDataSource = (URLDataSource) ii.getDataSource();
             // make sure the supplied URL points to the same thing
             // as the one already associated with this name.
@@ -376,7 +376,7 @@ public class HtmlEmail extends MultiPart
         // if so, return the cached CID value.
         if (inlineEmbeds.containsKey(file.getName()))
         {
-            InlineImage ii = (InlineImage) inlineEmbeds.get(file.getName());
+            InlineImage ii = inlineEmbeds.get(file.getName());
             FileDataSource fileDataSource = (FileDataSource) ii.getDataSource();
             // make sure the supplied file has the same canonical path
             // as the one already associated with this name.
@@ -438,7 +438,7 @@ public class HtmlEmail extends MultiPart
         // if so, return the cached CID value.
         if (inlineEmbeds.containsKey(name))
         {
-            InlineImage ii = (InlineImage) inlineEmbeds.get(name);
+            InlineImage ii = inlineEmbeds.get(name);
             // make sure the supplied URL points to the same thing
             // as the one already associated with this name.
             if (dataSource.equals(ii.getDataSource()))
@@ -583,10 +583,10 @@ public class HtmlEmail extends MultiPart
                 msgHtml.setContent(this.html, Email.TEXT_HTML);
             }
 
-            Iterator iter = this.inlineEmbeds.values().iterator();
+            Iterator<InlineImage> iter = this.inlineEmbeds.values().iterator();
             while (iter.hasNext())
             {
-                InlineImage ii = (InlineImage) iter.next();
+                InlineImage ii = iter.next();
                 bodyEmbedsContainer.addBodyPart(ii.getMbp());
             }
         }



Mime
View raw message