You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles Sadowski (Jira)" <ji...@apache.org> on 2022/05/23 08:45:00 UTC
[jira] [Commented] (MATH-1647) HaltonSequenceGenerator.skipTo() not throwing proper NotPositiveException
[ https://issues.apache.org/jira/browse/MATH-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17540833#comment-17540833 ]
Gilles Sadowski commented on MATH-1647:
---------------------------------------
Thanks for the report.
Could you please provide a patch or PR with the fix (and associated JUnit test)?
I would also be great if you can investigate the impact of the issue (beyond not throwing the expected exception). For example, does the bug entail a performance loss, or is the result wrong (like returning the same value until the counter is again positive, as the doc seem to assume).
> HaltonSequenceGenerator.skipTo() not throwing proper NotPositiveException
> -------------------------------------------------------------------------
>
> Key: MATH-1647
> URL: https://issues.apache.org/jira/browse/MATH-1647
> Project: Commons Math
> Issue Type: Bug
> Affects Versions: 3.6.1
> Reporter: Elia Bertolina
> Priority: Major
>
> HaltonSequenceGenerator.skipTo(int index) does not throw a NotPositiveException when the parameter is negative.In the documentation it is stated that an NotPositiveException will be thrown if the parameter value is less than zero.
> However, in this test case:
> {code:java}
> public class HaltonSequenceGenerator_Test{
> public void test() throws Throwable{
> HaltonSequenceGenerator haltonSequenceGenerator = new
> HaltonSequenceGenerator(1);
> try {
> double[] doubleArray =
> haltonSequenceGenerator.skipTo((-4584));
> org.junit.Assert.fail();
> } catch
> (org.apache.commons.math3.exception.NotPositiveException e){
> //NotPositiveException caught and test successful
> }
> }
> } {code}
> The int parameter is negative and a NotPositiveException should be thrown, however the method executes normally, and test case fails.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)