[jira] [Commented] (NUMBERS-74) Make "Fraction" a ValJO

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

[jira] [Commented] (NUMBERS-74) Make "Fraction" a ValJO

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/NUMBERS-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16678548#comment-16678548 ]

Eric Barnhill commented on NUMBERS-74:

getReducedFraction is at this point entirely redundant. If I construct a Fraction object using numerator and denominator, what is returned is the reduced fraction, because the constructor reduces it. There is no field in Fraction retaining the originally entered numerator and denominator. I see no particular reason to introduce one without a use case. If the Fractions are equivalent then they are literally the same so what difference does it make.

All the other comments here I agree with. 

There is more to discuss and I will start a dev list thread.

> Make "Fraction" a ValJO
> -----------------------
>                 Key: NUMBERS-74
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-74
>             Project: Commons Numbers
>          Issue Type: Sub-task
>          Components: fraction
>            Reporter: Gilles
>            Priority: Major
>              Labels: API
>             Fix For: 1.0
> [This ML post|https://markmail.org/message/fhrnyg3nfer7y2cy] makes suggestions and points to potential issues with that class.
> A.o. things,
> * there seems to be some code overlap between the constructors and the {{getReducedFraction}} method (and the latter should probably be private anyways),
> * method {{percentageValue}} is not very useful,
> * a lot of constants should be removed,
> * {{serialVersionUID}} should be updated, and moved to the top of the declaration list.

This message was sent by Atlassian JIRA