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/01/27 20:49:43 UTC

[GitHub] [maven-resolver] michael-o commented on a change in pull request #144: Use BFS approach

michael-o commented on a change in pull request #144:
URL: https://github.com/apache/maven-resolver/pull/144#discussion_r793986314



##########
File path: maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java
##########
@@ -407,27 +401,30 @@ private void processDependency( Args args, Results results, List<RemoteRepositor
             Artifact originalArtifact = dependency.getArtifact().setVersion( version.toString() );
             Dependency d = dependency.setArtifact( originalArtifact );
 
-            ArtifactDescriptorRequest descriptorRequest = createArtifactDescriptorRequest( args, repositories, d );
+            ArtifactDescriptorRequest descriptorRequest =
+                    createArtifactDescriptorRequest( args, context.repositories, d );
 
             final ArtifactDescriptorResult descriptorResult =
-                getArtifactDescriptorResult( args, results, noDescriptor, d, descriptorRequest );
+                    noDescriptor
+                            ? new ArtifactDescriptorResult( descriptorRequest )
+                            : resolveCachedArtifactDescriptor( args.pool, descriptorRequest, args.session,
+                                    context.withDependency( d ), results );
+
             if ( descriptorResult != null )
             {
                 d = d.setArtifact( descriptorResult.getArtifact() );
 
-                DependencyNode node = args.nodes.top();
-
-                int cycleEntry = args.nodes.find( d.getArtifact() );
-                if ( cycleEntry >= 0 )
+                int cycleEntry = find( context.parents, d.getArtifact() );
+                if ( cycleEntry != -1 )

Review comment:
       Why not retain `>= 0`?




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