suztomo commented on a change in pull request #39: [MRESOLVER-93] - 
PathRecordingDependencyVisitor to handle 3 cycles
URL: https://github.com/apache/maven-resolver/pull/39#discussion_r316134016
 
 

 ##########
 File path: 
maven-resolver-util/src/main/java/org/eclipse/aether/util/graph/visitor/PathRecordingDependencyVisitor.java
 ##########
 @@ -101,6 +96,7 @@ public boolean visitEnter( DependencyNode node )
     {
         boolean accept = filter == null || filter.accept( node, parents );
 
+        boolean hasDuplicateNodeInParent = parents.contains( node );
 
 Review comment:
   > The reason is that the same dependency should not be introspected together 
with its dependencies if this process was done in some previous visit.
   
   I agree that visited set was _supposed_ to do the job. However, when it 
deals with 3 or more cycles, it suffers from StackOverflowError because of 
`visited.remove( node )`.
   
   > The limitation of this impl is the identity-base
   
   Even if the visited set becomes `equal`-based set and `DefaultDependencyNode 
` has proper `equals` and `hashCode`, I think the StackOverflowError remains.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to