Uploaded image for project: 'Hibernate Validator'
  1. HV-886

Javadoc of URL constraint is really misleading

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.Final
    • Fix Version/s: 5.2.0.Alpha1
    • Component/s: documentation
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      The implementation of the URL validator is really odd because it basically relies on the constructor of java.net.URL. This has been discussed here before ( HV-406 Closed , HV-513 Closed ) and I understand and accept there's no perfect solution.

      However, I'd expect that this be clearly stated in the Javadoc of the @URL constraint. IMO despite HV-437 Closed this is still not the case. I see 2 obvious issues:

      1. Type Javadoc claims that "Per default the constraint verifies that the annotated value conforms to RFC2396". Doesn't HV-513 Closed prove that statement wrong? If RFC2396 were really supported wouldn't the validator have to accept URLs such as ldap://... or sip://...?
      2. The annotation attribute Javadoc contradicts the type Javadoc. Because of 1. a statement like "Per default any protocol is allowed" (port attribute) is not correct.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified