You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Xavier Detant (JIRA)" <ji...@apache.org> on 2012/06/10 15:52:42 UTC

[jira] [Created] (EMAIL-118) smtpPort setter and getter doesn't works with the same type in EmailClass

Xavier Detant created EMAIL-118:
-----------------------------------

             Summary: smtpPort setter and getter doesn't works with the same type in EmailClass
                 Key: EMAIL-118
                 URL: https://issues.apache.org/jira/browse/EMAIL-118
             Project: Commons Email
          Issue Type: Improvement
    Affects Versions: 1.3
            Reporter: Xavier Detant
            Priority: Trivial


The smtpPort in the Email class can be set as an int but is get as a String. This is quite bad design, the getter and the setter should works with the same type. As smtp ports is a number, the getter which is currently _public String getSmtpPort()_ should be _public int getSmtpPort()_:

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (EMAIL-118) smtpPort setter and getter doesn't works with the same type in EmailClass

Posted by "Xavier Detant (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EMAIL-118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xavier Detant updated EMAIL-118:
--------------------------------

    Attachment: SmtpAsInt.patch

The patch to change smtp port from String to int.
                
> smtpPort setter and getter doesn't works with the same type in EmailClass
> -------------------------------------------------------------------------
>
>                 Key: EMAIL-118
>                 URL: https://issues.apache.org/jira/browse/EMAIL-118
>             Project: Commons Email
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Xavier Detant
>            Priority: Trivial
>              Labels: patch
>         Attachments: SmtpAsInt.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> The smtpPort in the Email class can be set as an int but is get as a String. This is quite bad design, the getter and the setter should works with the same type. As smtp ports is a number, the getter which is currently _public String getSmtpPort()_ should be _public int getSmtpPort()_:

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (EMAIL-118) smtpPort setter and getter doesn't works with the same type in EmailClass

Posted by "Thomas Neidhart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EMAIL-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492765#comment-13492765 ] 

Thomas Neidhart commented on EMAIL-118:
---------------------------------------

Pushing to 2.0 as it would break compatibility.

Looking at the code, it is not quite clear why the port is actually stored as a String. It is put into the Session object, which requires a String value, but it could also be converted for this purpose.

The same btw applies also to the sslSmtpPort property.
                
> smtpPort setter and getter doesn't works with the same type in EmailClass
> -------------------------------------------------------------------------
>
>                 Key: EMAIL-118
>                 URL: https://issues.apache.org/jira/browse/EMAIL-118
>             Project: Commons Email
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Xavier Detant
>            Priority: Trivial
>              Labels: patch
>             Fix For: 2.0
>
>         Attachments: SmtpAsInt.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> The smtpPort in the Email class can be set as an int but is get as a String. This is quite bad design, the getter and the setter should works with the same type. As smtp ports is a number, the getter which is currently _public String getSmtpPort()_ should be _public int getSmtpPort()_:

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (EMAIL-118) smtpPort setter and getter doesn't works with the same type in EmailClass

Posted by "Thomas Neidhart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EMAIL-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13492765#comment-13492765 ] 

Thomas Neidhart edited comment on EMAIL-118 at 11/7/12 10:29 PM:
-----------------------------------------------------------------

Pushing to 2.0 as it would break compatibility.

Looking at the code, it is not quite clear why the port is actually stored as a String. It is put into the Session object, which requires a String value, but it could also be converted for this purpose.

Maybe it is done for convenience reasons, so the value returned from the Session object can be directly used, and also to handle null cases. This could also be achieved with an Integer object.

The same btw applies also to the sslSmtpPort property.
                
      was (Author: tn):
    Pushing to 2.0 as it would break compatibility.

Looking at the code, it is not quite clear why the port is actually stored as a String. It is put into the Session object, which requires a String value, but it could also be converted for this purpose.

The same btw applies also to the sslSmtpPort property.
                  
> smtpPort setter and getter doesn't works with the same type in EmailClass
> -------------------------------------------------------------------------
>
>                 Key: EMAIL-118
>                 URL: https://issues.apache.org/jira/browse/EMAIL-118
>             Project: Commons Email
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Xavier Detant
>            Priority: Trivial
>              Labels: patch
>             Fix For: 2.0
>
>         Attachments: SmtpAsInt.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> The smtpPort in the Email class can be set as an int but is get as a String. This is quite bad design, the getter and the setter should works with the same type. As smtp ports is a number, the getter which is currently _public String getSmtpPort()_ should be _public int getSmtpPort()_:

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (EMAIL-118) smtpPort setter and getter doesn't works with the same type in EmailClass

Posted by "Xavier Detant (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/EMAIL-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13292524#comment-13292524 ] 

Xavier Detant edited comment on EMAIL-118 at 6/10/12 1:54 PM:
--------------------------------------------------------------

The patch to change smtp port from String to int. Maybe a method _public String getSmptPortAsString()_ should be usefull.
                
      was (Author: xadet):
    The patch to change smtp port from String to int.
                  
> smtpPort setter and getter doesn't works with the same type in EmailClass
> -------------------------------------------------------------------------
>
>                 Key: EMAIL-118
>                 URL: https://issues.apache.org/jira/browse/EMAIL-118
>             Project: Commons Email
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Xavier Detant
>            Priority: Trivial
>              Labels: patch
>         Attachments: SmtpAsInt.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> The smtpPort in the Email class can be set as an int but is get as a String. This is quite bad design, the getter and the setter should works with the same type. As smtp ports is a number, the getter which is currently _public String getSmtpPort()_ should be _public int getSmtpPort()_:

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (EMAIL-118) smtpPort setter and getter doesn't works with the same type in EmailClass

Posted by "Thomas Neidhart (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/EMAIL-118?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart updated EMAIL-118:
----------------------------------

    Fix Version/s: 2.0
    
> smtpPort setter and getter doesn't works with the same type in EmailClass
> -------------------------------------------------------------------------
>
>                 Key: EMAIL-118
>                 URL: https://issues.apache.org/jira/browse/EMAIL-118
>             Project: Commons Email
>          Issue Type: Improvement
>    Affects Versions: 1.3
>            Reporter: Xavier Detant
>            Priority: Trivial
>              Labels: patch
>             Fix For: 2.0
>
>         Attachments: SmtpAsInt.patch
>
>   Original Estimate: 10m
>  Remaining Estimate: 10m
>
> The smtpPort in the Email class can be set as an int but is get as a String. This is quite bad design, the getter and the setter should works with the same type. As smtp ports is a number, the getter which is currently _public String getSmtpPort()_ should be _public int getSmtpPort()_:

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira