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

BooleanUtils.toBoolean() - invalid drop-thru in case statement causes StringIndexOutOfBoundsException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4
    • None
    • None

    Description

      The method BooleanUtils.toBoolean() has a case statement; case 3 drops through to case 4; this can cause StringIndexOutOfBoundsException, for example with the test:

      assertEquals(false, BooleanUtils.toBoolean("tru"));

      The end of case 3 should return false.

      Patch to follow for source and unit test.

      Attachments

        1. BooleanUtilsTest.patch
          0.8 kB
          Sebb
        2. BooleanUtils.patch
          0.7 kB
          Sebb

        Activity

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: