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

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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.10.0
    • 2.11.0, 3.0.0
    • API
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ggregory Gary D. Gregory
            mcoolive1 Cyril Martin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment