Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-266

DomainValidator uses an O(n) method where an O(1) would be more appropriate

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4.0 Release
    • Fix Version/s: 1.4.1 Release
    • Component/s: Routines
    • Labels:
      None

      Description

      The class org.apache.commons.validator.routines.DomainValidator contains several hard coded arrays of TLD names. Quite apart from whether these should be in a properties file rather than the source file itself, they are then used to populate List instances via Arrays.asList() and the List.contains() method used when validating a TLD. This is almost inevitably an O operation on each list, and could be improved by populating a single HashSet which would provide O(1) performance.

        Attachments

          Activity

            People

            • Assignee:
              britter Benedikt Ritter
              Reporter:
              lizardking Chris Wareham
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: