[ 
https://issues.apache.org/jira/browse/TINKERPOP3-750?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Frantz updated TINKERPOP3-750:
-----------------------------------
    Fix Version/s: 3.1.0-incubating
                   3.0.1-incubating

> Compare should not have special case for Number
> -----------------------------------------------
>
>                 Key: TINKERPOP3-750
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-750
>             Project: TinkerPop 3
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.0.0-incubating
>            Reporter: Matt Frantz
>            Assignee: Matt Frantz
>             Fix For: 3.0.1-incubating, 3.1.0-incubating
>
>
> The current implementation of {{Compare}} has a special case for {{Number}} 
> which uses {{doubleValue}} for all comparisons.  However, this fails for some 
> implementations of {{Number}}, e.g. {{BigInteger}}.  Also, most 
> implementations of {{Number}} implement {{Comparable}} for appropriately 
> typed arguments.  It should be more robust and less surprising to simply use 
> {{Object.equals}} and {{Comparable.compareTo}}.  This would also be more 
> performant as it removes the {{instanceof}} checks.
> If we want the option of treating all numbers as doubles, perhaps something 
> called {{CompareDouble}} would be more appropriate.



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

Reply via email to