commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles <gil...@harfang.homelinux.org>
Subject [Math] MATH-1256
Date Mon, 17 Aug 2015 10:06:15 GMT
Hi.

Cf. issue reported in
   https://issues.apache.org/jira/browse/MATH-1256

Quoting the OP:
---
In class Interval, which is in the package 
org.apache.commons.math4.geometry.euclidean.oned
it is possible to pass the value for variable upper less than the value 
of variable lower,
which is logically incorrect and also causes the method getSize() to 
return negative value
---

Is it ever necessary to allow negative intervals (e.g. wrt to 
"tolerance")?

If not, I propose to add a check in the constructor:
---CUT---
    if (upper < lower) {
        throw new 
NumberIsTooSmallException(LocalizedFormats.ENDPOINTS_NOT_AN_INTERVAL,
                                            upper, lower, true);
    }
---CUT---

OK?

Regards,
Gilles


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message