Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-703

StringUtils.join throws NPE when toString returns null for one of objects in collection

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: None
    • Labels:
      None

      Description

      Try

       
      StringUtils.join(new Object[]{
              new Object() {
                @Override
                public String toString() {
                  return null;
                }
              }
          }, ',');
      

      ToString should probably never return null, but it does in javax.mail.internet.InternetAddress

        Attachments

        1. StringUtil_Join_NPE_AVG_16.patch
          4 kB
          Asela Illayapparachchi
        2. StringUtil_Join_NPE.patch
          3 kB
          Asela Illayapparachchi

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              link Ilya
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: