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/12 10:08:56 UTC

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

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


##########
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:
   why is this shortcut allowed for recommended versions (soft-references)?



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