[ 
https://issues.apache.org/jira/browse/MNG-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17616365#comment-17616365
 ] 

ASF GitHub Bot commented on MNG-7106:
-------------------------------------

kwin commented on PR #825:
URL: https://github.com/apache/maven/pull/825#issuecomment-1276005133

   @cstamas Even Maven4 API still uses that implementation under the hood: 
https://github.com/apache/maven/blob/3f90e7028e0338c110aea267b44362653d55273a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultVersionParser.java#L57
 so I think this is worth fixing. Deprecation can come as a subsequent step 
(and providing an implementation based on Maven Resolver's 
`GenericVersionScheme`)




> VersionRange produces a version range that is incompatible with itself
> ----------------------------------------------------------------------
>
>                 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
>
> 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)

Reply via email to