Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7106

VersionRange produces a version range that is incompatible with itself

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When a hard version requirement (Ex - [1.0]) is passed to VersionRange#createFromVersionSpec(String), it is parsed to [1.0, 1.0]. But, this version range is invalid according to this exception. If the parsed version range ([1.0, 1.0]) is converted to a String, it cannot be parsed once again by VersionRange#createFromVersionSpec(String).

      Steps to reproduce -

      VersionRange versionRange = VersionRange.createFromVersionSpec("[1.0]"); // [1.0, 1.0]
      String stringVersionRange = VersionRange.toString(versionRange); // "[1.0, 1.0]"
      VersionRange exceptionVersionRange = VersionRange.createFromVersionSpec(stringVersionRange); // <- InvalidVersionSpecificationException( "Range cannot have identical boundaries: [1.0, 1.0]" )
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              akshay95 Akshay Shankara
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: