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

VersionRange.toString() produces a string that cannot be parsed with VersionRange.createFromVersionSpec() for same lower and upper bounds

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.6.3
    • 3.8.7, 3.9.0, 4.0.0-alpha-2, 4.0.0
    • None
    • 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

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              akshay95 Akshay Shankara
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: