You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/10/13 11:18:31 UTC

[GitHub] [maven] michael-o commented on a diff in pull request #825: [MNG-7106] Accept same lower and upper bound in version spec string

michael-o commented on code in PR #825:
URL: https://github.com/apache/maven/pull/825#discussion_r994512882


##########
maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java:
##########
@@ -227,9 +223,13 @@ private static Restriction parseRestriction( String spec )
                 upperVersion = new DefaultArtifactVersion( upperBound );
             }
 
-            if ( upperVersion != null && lowerVersion != null && upperVersion.compareTo( lowerVersion ) < 0 )
+            if ( upperVersion != null && lowerVersion != null )
             {
-                throw new InvalidVersionSpecificationException( "Range defies version ordering: " + spec );
+                int result = upperVersion.compareTo( lowerVersion );
+                if ( result < 0 || ( result == 0 && ( !lowerBoundInclusive || !upperBoundInclusive ) ) )
+                {
+                    throw new InvalidVersionSpecificationException( "Range defies version ordering: " + spec );
+                }

Review Comment:
   Sorry, I meant this change. Since the condition has changed maybe a test should cover this as well, if none does?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org