[
https://issues.apache.org/jira/browse/MNG-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Konrad Windszus resolved MNG-7106.
----------------------------------
Fix Version/s: 3.9.0
4.0.0
(was: 4.0.x-candidate)
(was: 3.9.0-candidate)
Resolution: Fixed
Fixed for 4.0.0 in
https://github.com/apache/maven/commit/78edd431226204316e2d472d152b869a4a17ce61.
Fixed for 3.9.0 in
https://github.com/apache/maven/commit/75e19406952a4e1a58b382ec5c68dd16c101670b
> VersionRange.toString() produces a string that cannot be parsed with
> VersionRange.createFromVersionSpec() for same lower and upper bounds
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: MNG-7106
> URL: https://issues.apache.org/jira/browse/MNG-7106
> Project: Maven
> Issue Type: Bug
> Affects Versions: 3.6.3
> Reporter: Akshay Shankara
> Assignee: Konrad Windszus
> Priority: Minor
> Fix For: 3.9.0, 4.0.0
>
>
> When a hard version requirement (Ex - [1.0]) is passed to
> [VersionRange#createFromVersionSpec(String)|https://github.com/apache/maven/blob/maven-3.6.3/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java#L106],
> it is parsed to [1.0, 1.0]. But, this version range is invalid [according to
> this
> exception|https://github.com/apache/maven/blob/maven-3.6.3/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java#L214-L217].
> 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 -
> {code:java}
> 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]" )
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)