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 14:00:02 UTC

[GitHub] [maven] gnodet commented on a diff in pull request #823: [MNG-7561] never resolve version ranges with same lower and upper bound

gnodet commented on code in PR #823:
URL: https://github.com/apache/maven/pull/823#discussion_r994684855


##########
maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java:
##########
@@ -111,28 +111,36 @@ public VersionRangeResult resolveVersionRange( RepositorySystemSession session,
         }
         else
         {
-            Map<String, ArtifactRepository> versionIndex = getVersions( session, result, request );
-
-            List<Version> versions = new ArrayList<>();
-            for ( Map.Entry<String, ArtifactRepository> v : versionIndex.entrySet() )
+            if ( Objects.equals( versionConstraint.getRange().getLowerBound(), 
+                                 versionConstraint.getRange().getUpperBound() ) )
+            {
+                result.addVersion( versionConstraint.getRange().getLowerBound().getVersion() );

Review Comment:
   What happens if the artifact does not exist with the given version ?



-- 
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