You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2017/03/21 01:23:25 UTC

svn commit: r1787895 - /commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.java

Author: sebb
Date: Tue Mar 21 01:23:25 2017
New Revision: 1787895

URL: http://svn.apache.org/viewvc?rev=1787895&view=rev
Log:
Simplify: parameter value is now always a String

Modified:
    commons/proper/email/trunk/src/main/java/org/apache/commons/mail/Email.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=1787895&r1=1787894&r2=1787895&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 Tue Mar 21 01:23:25 2017
@@ -1908,10 +1908,8 @@ public abstract class Email
      * @return the folded header value
      * @throws IllegalArgumentException if either the name or value is null or empty
      */
-    private String createFoldedHeaderValue(final String name, final Object value)
+    private String createFoldedHeaderValue(final String name, final String value)
     {
-        String result;
-
         if (EmailUtils.isEmpty(name))
         {
             throw new IllegalArgumentException("name can not be null or empty");
@@ -1923,14 +1921,12 @@ public abstract class Email
 
         try
         {
-            result = MimeUtility.fold(name.length() + 2, MimeUtility.encodeText(value.toString(), this.charset, null));
+            return MimeUtility.fold(name.length() + 2, MimeUtility.encodeText(value.toString(), this.charset, null));
         }
         catch (final UnsupportedEncodingException e)
         {
-            result = value.toString();
+            return value;
         }
-
-        return result;
     }
 
     /**