Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1745

RandomStringUtils.random() with a negative character index should throw IllegalArgumentException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.14.0
    • 3.16.0
    • lang.*
    • None
    • jdk18

    Description

      when RandomStringUtils.random encounters negative index it just keep running all the time(like meeting a dead loop?), hope to raise an exception

      the test code is :
      @Testpublic void testNegativeRange() {
      int start = Integer.MIN_VALUE; int end = -10; // Generate a random character with negative range parameters String result = RandomStringUtils.random(1, start, end, false, false, null);
      {color}}
       

      Attachments

        Issue Links

          Activity

            People

              ggregory Gary D. Gregory
              sustech-whl Wang Hailong
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: