commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asela Illayapparachchi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LANG-703) StringUtils.join throws NPE when toString returns null for one of objects in collection
Date Mon, 06 Jun 2011 18:24:59 GMT

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

Asela Illayapparachchi updated LANG-703:
----------------------------------------

    Attachment: StringUtil_Join_NPE.patch

fix the NPE and anded Unit Tests for that

> StringUtils.join throws NPE when toString returns null for one of objects in collection
> ---------------------------------------------------------------------------------------
>
>                 Key: LANG-703
>                 URL: https://issues.apache.org/jira/browse/LANG-703
>             Project: Commons Lang
>          Issue Type: Bug
>            Reporter: Ilya
>         Attachments: StringUtil_Join_NPE.patch
>
>
> Try
> {code} 
> StringUtils.join(new Object[]{
>         new Object() {
>           @Override
>           public String toString() {
>             return null;
>           }
>         }
>     }, ',');
> {code}
> ToString should probably never return null, but it does in javax.mail.internet.InternetAddress

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message