Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1647

HaltonSequenceGenerator.skipTo() not throwing proper NotPositiveException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.6.1
    • 4.0
    • None
    • None
    • Easy

    Description

      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:

      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        
              }    
          }
      } 

      The int parameter is negative and a NotPositiveException should be thrown, however the method executes normally, and test case fails.

      Attachments

        Activity

          People

            Unassigned Unassigned
            eTroc Elia Bertolina
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h