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

[lang] NumberUtils.isNumber allows illegal trailing characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0
    • None
    • None
    • Operating System: other
      Platform: Other

    • 20538

    Description

      This bug report is based on a post to commons-dev from Eric Pugh.

      I am attaching a patch that includes the test case that Eric posted and two
      others that confirm that the current code will accept strings with trailing
      characters that are not type qualifiers.

      The patch also adds a check to NumberUtils.isNumber() that causes these strings
      to be rejected. Assuming that my understanding of the code is correct, this
      patch should fix the problem without changing behavior on other strings. All
      other tests succeed with the patch applied.

      Attachments

        Activity

          People

            Unassigned Unassigned
            phil@steitz.com Phil Steitz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: