commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (LANG-703) StringUtils.join throws NPE when toString returns null for one of objects in collection
Date Sun, 03 Jul 2011 07:06:21 GMT

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

Henri Yandell closed LANG-703.
------------------------------

    Resolution: Fixed

Thanks Ilya, I've applied the 2nd patch:

svn ci -m "Applying Ilya's patch from LANG-703 fixing an NPE when toString returns null"
Sending        src/main/java/org/apache/commons/lang3/StringUtils.java
Sending        src/test/java/org/apache/commons/lang3/StringUtilsTest.java
Transmitting file data ..
Committed revision 1142381.


> 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
>             Fix For: 3.x
>
>         Attachments: StringUtil_Join_NPE.patch, StringUtil_Join_NPE_AVG_16.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