You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2018/02/25 18:11:00 UTC

[jira] [Comment Edited] (LOG4J2-2270) Strings::join, when called with [null] returns "null" instead of EMPTY

    [ https://issues.apache.org/jira/browse/LOG4J2-2270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16376181#comment-16376181 ] 

Gary Gregory edited comment on LOG4J2-2270 at 2/25/18 6:10 PM:
---------------------------------------------------------------

[~mcoolive1]: 

Thank you for your report and your patch!

I implemented a different fix than the one proposed in the PR. You still get credit in changes.xml :)

Please verify and close this ticket.

Gary


was (Author: garydgregory):
[~mcoolive1]: 

Thank you for your report and your patch!

I implemented a different fix than the one proposed in the PR. You still get credit in changes.xml :)

Gary

> Strings::join, when called with [null] returns "null" instead of EMPTY
> ----------------------------------------------------------------------
>
>                 Key: LOG4J2-2270
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2270
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 2.10.0
>            Reporter: Cyril Martin
>            Assignee: Gary Gregory
>            Priority: Minor
>             Fix For: 2.11.0, 3.0.0
>
>
> The [javadoc|https://logging.apache.org/log4j/2.x/log4j-api/apidocs/org/apache/logging/log4j/util/Strings.html#join(java.util.Iterator,%20char)] 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.
> {code} Strings.join(Arrays.asList((String)null), '.') {code}
> returns "null" where I expected EMPTY ("")



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)