You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2017/06/02 14:10:04 UTC
[jira] [Commented] (NIFI-3989) DataTypeUtils handles
isLongTypeCompatible, isDoubleTypeCompatible, etc. poorly
[ https://issues.apache.org/jira/browse/NIFI-3989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16034747#comment-16034747 ]
ASF subversion and git services commented on NIFI-3989:
-------------------------------------------------------
Commit 239bbfbb9d08a8b39f330d2ac0a6c4fd6f59dd67 in nifi's branch refs/heads/master from [~markap14]
[ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=239bbfb ]
NIFI-3989: This closes #1869. Avoid calling Long.parseLong, etc. in order to determine if a String is a valid number because we don't want the Exceptions that occur if it is not
Signed-off-by: joewitt <jo...@apache.org>
> DataTypeUtils handles isLongTypeCompatible, isDoubleTypeCompatible, etc. poorly
> -------------------------------------------------------------------------------
>
> Key: NIFI-3989
> URL: https://issues.apache.org/jira/browse/NIFI-3989
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Mark Payne
> Assignee: Mark Payne
> Fix For: 1.3.0
>
>
> DataTypeUtils is used to coerce an object of one type into an object of another type for record-oriented data. However, the isLongTypeCompatible method is calling Long.parseLong and catch NumberFormatException to check if a String is a valid Long, instead of iterating over each character in the string and checking Character.isDigit. We can also use the regex defined by JavaDocs for Double.parseDouble to handle the case of checking if a String is Double-type capable.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)