[jira] [Created] (FLINK-4594) Validate lower bound in MathUtils.checkedDownCast

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-4594) Validate lower bound in MathUtils.checkedDownCast

Shang Yuanchun (Jira)
Greg Hogan created FLINK-4594:
---------------------------------

             Summary: Validate lower bound in MathUtils.checkedDownCast
                 Key: FLINK-4594
                 URL: https://issues.apache.org/jira/browse/FLINK-4594
             Project: Flink
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.2.0
            Reporter: Greg Hogan
            Assignee: Greg Hogan
            Priority: Trivial


{{MathUtils.checkedDownCast}} only compares against the upper bound {{Integer.MAX_VALUE}}, which has worked with current usage.

Rather than adding a second comparison we can replace

{noformat}
if (value > Integer.MAX_VALUE) {
{noformat}

with a cast and check

{noformat}
if ((int)value != value) { ...
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)