[jira] [Commented] (MNG-7106) VersionRange produces a version range that is incompatible with itself
[ https://issues.apache.org/jira/browse/MNG-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)
[jira] [Commented] (MNG-7106) VersionRange produces a version range that is incompatible with itself
[ https://issues.apache.org/jira/browse/MNG-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616346#comment-17616346 ] ASF GitHub Bot commented on MNG-7106: - kwin opened a new pull request, #825: URL: https://github.com/apache/maven/pull/825 Following this checklist to help us incorporate your contribution quickly and easily: - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes. - [x] Each commit in the pull request should have a meaningful subject line and body. - [x] Format the pull request title like `[MNG-XXX] SUMMARY`, where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA issue. Best practice is to use the JIRA issue title in the pull request title and in the first line of the commit message. - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. - [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [x] You have run the [Core IT][core-its] successfully. If your pull request is about ~20 lines of code you don't need to sign an [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure please ask on the developers list. To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) you have to acknowledge this by using the following check-box. - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) - [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). [core-its]: https://maven.apache.org/core-its/core-it-suite/ > 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)
[jira] [Commented] (MNG-7106) VersionRange produces a version range that is incompatible with itself
[ https://issues.apache.org/jira/browse/MNG-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17616340#comment-17616340 ] Konrad Windszus commented on MNG-7106: -- This works fine already in Maven Resolver (verified in https://github.com/apache/maven-resolver/pull/202/files) so I think just dropping the exception for string {{["1.0,1.0]"}} is the correct solution here. > 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)
[jira] [Commented] (MNG-7106) VersionRange produces a version range that is incompatible with itself
[ https://issues.apache.org/jira/browse/MNG-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17290931#comment-17290931 ] Brandon Heck commented on MNG-7106: --- Would the preference be to fix this in parseRestriction by skipping the creation of a Restriction for a hard version requirement? Would it be preferable to fix this in the {{toString}} by checking the bounds for equality when constructing the string? Is there another way this might be fixed that would be better than either of those suggestions? I'm assuming that the first suggestion may have unintended consequences when building the effective model. > 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 >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.3.4#803005)
[jira] [Commented] (MNG-7106) VersionRange produces a version range that is incompatible with itself
[ https://issues.apache.org/jira/browse/MNG-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17288963#comment-17288963 ] Michael Osipov commented on MNG-7106: - This sounds valid and inconsistent. > 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 >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.3.4#803005)