You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Cyril Martin (JIRA)" <ji...@apache.org> on 2018/02/25 15:00:04 UTC
[jira] [Created] (LOG4J2-2270) Strings::join, when called with
[null] returns "null" instead of EMPTY
Cyril Martin created LOG4J2-2270:
------------------------------------
Summary: 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
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)