Commons Lang
  1. Commons Lang
  2. LANG-94

[lang] NumberUtils.isNumber allows illegal trailing characters

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      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.

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Phil Steitz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development