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

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4.0 Release
    • 1.4.1 Release
    • Routines
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment