[ 
https://issues.apache.org/jira/browse/EMAIL-184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

John Smith updated EMAIL-184:
-----------------------------
    Description: 
The method setFrom(String email, String name) of Email throws a 
NullPointerException if null is passed for email. Could you please either fix 
the Nullpointer or update the JavaDoc. 
  
 JavaDoc of Email.setFrom(String, String):


Email org.apache.commons.mail.Email.setFrom(String email, String name) throws 
EmailException


Set the FROM field of the email to use the specified address and the specified 
personal name. 
The name will be encoded by the charset of setCharset(). If it is not set, it 
will be encoded 
using the Java platform's default charset (UTF-16) if it contains non-ASCII 
characters; otherwise, 
it is used as is.

Parameters:email A String.name A String.
Returns:An Email.
Throws:EmailException - Indicates an invalid email address.
Since:1.0

 

  was:
The method setFrom(String email, String name) of Email throws a 
NullPointerException if null is passed for email. Could you please either fix 
the Nullpointer or update the JavaDoc. 
 
JavaDoc of Email.setFrom(String, String):
[Email|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache.commons.mail(Email.class%E2%98%83Email~setFrom~Ljava.lang.String;~Ljava.lang.String;%E2%98%82org.apache.commons.mail.Email]
 
[org|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg].[apache|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache].[commons|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache.commons].[mail|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache.commons.mail].[Email|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache.commons.mail(Email.class%E2%98%83Email].setFrom([String|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache.commons.mail(Email.class%E2%98%83Email~setFrom~Ljava.lang.String;~Ljava.lang.String;%E2%98%82java.lang.String]
 email, 
[String|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache.commons.mail(Email.class%E2%98%83Email~setFrom~Ljava.lang.String;~Ljava.lang.String;%E2%98%82java.lang.String]
 name) throws 
[EmailException|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache.commons.mail(Email.class%E2%98%83Email~setFrom~Ljava.lang.String;~Ljava.lang.String;%E2%98%82org.apache.commons.mail.EmailException]
 

Set the FROM field of the email to use the specified address and the specified 
personal name. The name will be encoded by the charset of 
{{[setCharset()|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache.commons.mail(Email.class%E2%98%83Email~setFrom~Ljava.lang.String;~Ljava.lang.String;%E2%98%82%E2%98%82setCharset%E2%98%82java.lang.String]}}.
 If it is not set, it will be encoded using the Java platform's default charset 
(UTF-16) if it contains non-ASCII characters; otherwise, it is used as is.

Parameters:*email* A String.*name* A String.

Returns: An Email.

Throws:[EmailException|eclipse-javadoc:%E2%98%82=sovos/C:%5C/DEV%5C/MAVEN%5C/_REPOSITORY%5C/org%5C/apache%5C/commons%5C/commons-email%5C/1.5%5C/commons-email-1.5.jar%3Corg.apache.commons.mail(Email.class%E2%98%83Email~setFrom~Ljava.lang.String;~Ljava.lang.String;%E2%98%82EmailException]
 - Indicates an invalid email address.

Since: 1.0

 


> Undescribed NullPointerException in Email.setFrom method
> --------------------------------------------------------
>
>                 Key: EMAIL-184
>                 URL: https://issues.apache.org/jira/browse/EMAIL-184
>             Project: Commons Email
>          Issue Type: Bug
>    Affects Versions: 1.5
>            Reporter: John Smith
>            Priority: Major
>
> The method setFrom(String email, String name) of Email throws a 
> NullPointerException if null is passed for email. Could you please either fix 
> the Nullpointer or update the JavaDoc. 
>   
>  JavaDoc of Email.setFrom(String, String):
> Email org.apache.commons.mail.Email.setFrom(String email, String name) throws 
> EmailException
> Set the FROM field of the email to use the specified address and the 
> specified personal name. 
> The name will be encoded by the charset of setCharset(). If it is not set, it 
> will be encoded 
> using the Java platform's default charset (UTF-16) if it contains non-ASCII 
> characters; otherwise, 
> it is used as is.
> Parameters:email A String.name A String.
> Returns:An Email.
> Throws:EmailException - Indicates an invalid email address.
> Since:1.0
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to