Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2270

Strings::join, when called with [null] returns "null" instead of EMPTY

VotersStop watchingWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.10.0
    • Fix Version/s: 2.11.0, 3.0.0
    • Component/s: API
    • Labels:
      None

      Description

      The javadoc states "Null objects [...] within the iteration are represented by empty strings".

      But when there is exactly one element, Strings::join do not test if it is null.

       Strings.join(Arrays.asList((String)null), '.') 

      returns "null" where I expected EMPTY ("")

        Attachments

          Activity

            People

            • Assignee:
              ggregory Gary D. Gregory
              Reporter:
              mcoolive1 Cyril Martin

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment