You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Otto Fowler (Jira)" <ji...@apache.org> on 2020/01/22 14:46:00 UTC
[jira] [Updated] (NIFI-7055) createListValidator returns valid for
empty list with "," input
[ https://issues.apache.org/jira/browse/NIFI-7055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Otto Fowler updated NIFI-7055:
------------------------------
Description:
from Slack:
<wo...@tesorion.nl>
"I'm looking at the createListValidator, and to my surprise passing in a list of (essentially) two empty elements "," validates, while a totally empty string "" does not. Apparently due to some underlying behavior of String.split."
The string "," does return a String[0] from split. This should fail validation as if here were no elements as null, "", " " do possibly.
But that kind of goes against or doesn't consider the ignore empty entries.
I think the difference is whether or not you consider "," to be a list of two empty elements or an empty list.
The current implementation with String.spilt() will produce an empty list. Is that correct?
was:
from Slack:
<wo...@tesorion.nl>
"I'm looking at the createListValidator, and to my surprise passing in a list of (essentially) two empty elements "," validates, while a totally empty string "" does not. Apparently due to some underlying behavior of String.split."
The string "," does return a String[0] from split. This should fail validation as if here were no elements as null, "", " " do.
> createListValidator returns valid for empty list with "," input
> ---------------------------------------------------------------
>
> Key: NIFI-7055
> URL: https://issues.apache.org/jira/browse/NIFI-7055
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Otto Fowler
> Assignee: Otto Fowler
> Priority: Major
>
> from Slack:
> <wo...@tesorion.nl>
> "I'm looking at the createListValidator, and to my surprise passing in a list of (essentially) two empty elements "," validates, while a totally empty string "" does not. Apparently due to some underlying behavior of String.split."
> The string "," does return a String[0] from split. This should fail validation as if here were no elements as null, "", " " do possibly.
> But that kind of goes against or doesn't consider the ignore empty entries.
> I think the difference is whether or not you consider "," to be a list of two empty elements or an empty list.
> The current implementation with String.spilt() will produce an empty list. Is that correct?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)