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:10:00 UTC
[jira] [Resolved] (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:all-tabpanel ]
Gary Gregory resolved LOG4J2-2270.
----------------------------------
Resolution: Fixed
Fix Version/s: 3.0.0
2.11.0
[~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)