You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Koji Kawamura (JIRA)" <ji...@apache.org> on 2019/03/14 00:57:00 UTC
[jira] [Updated] (NIFI-6117) DataTypeUtils.isBigIntTypeCompatible
always returns false
[ https://issues.apache.org/jira/browse/NIFI-6117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Koji Kawamura updated NIFI-6117:
--------------------------------
Description:
Because it checks null value wrongly:
{code:java}
public static boolean isBigIntTypeCompatible(final Object value) {
return value == null && (value instanceof BigInteger || value instanceof Long);
}
{code}
should be:
{code:java}
public static boolean isBigIntTypeCompatible(final Object value) {
// We need something similar to isIntegral, but the value can be larger than the max long.
return isNumberTypeCompatible(value, s -> somethingSimilarToIsIntegral(s))
}
{code}
was:
Because it checks null value wrongly:
{code:java}
public static boolean isBigIntTypeCompatible(final Object value) {
return value == null && (value instanceof BigInteger || value instanceof Long);
}
{code}
should be:
{code:java}
public static boolean isBigIntTypeCompatible(final Object value) {
return value != null && (value instanceof BigInteger || value instanceof Long);
}
{code}
> DataTypeUtils.isBigIntTypeCompatible always returns false
> ---------------------------------------------------------
>
> Key: NIFI-6117
> URL: https://issues.apache.org/jira/browse/NIFI-6117
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Koji Kawamura
> Assignee: Koji Kawamura
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Because it checks null value wrongly:
> {code:java}
> public static boolean isBigIntTypeCompatible(final Object value) {
> return value == null && (value instanceof BigInteger || value instanceof Long);
> }
> {code}
> should be:
> {code:java}
> public static boolean isBigIntTypeCompatible(final Object value) {
> // We need something similar to isIntegral, but the value can be larger than the max long.
> return isNumberTypeCompatible(value, s -> somethingSimilarToIsIntegral(s))
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)