[ 
https://issues.apache.org/jira/browse/MRESOLVER-93?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tomo Suzuki updated MRESOLVER-93:
---------------------------------
    Description: 
PathRecordingDependencyVisitor cannot handle dependency graphs that have 3 or 
more cycles such as below:
  
{code:java}
gid:a:1 (1)
+- gid:b:0
|  \- ^1
+- gid:b:1
|  \- ^1
\- gid:b:2
   \- ^1
{code}
It fails with StackOverflowError or OutOfMemoryError. [Test 
case|https://github.com/suztomo/maven-resolver/commit/31b24dfe240997861e27661a7540546fbe6e0dab].

 

Diagnosis with 

 

The following illustration tracks the node traversal for the test case above. 
The illustration tracks the dependency node graph and the "visited" set 
maintained by the visitor.

 

The initial state starts with node "a" and visited set \{a}.

!IMG_0234.jpg|width=334,height=252!

First child of a is b0. Because visited does not contain, visitEnter(b0) 
returns true. B0 is added to visited.

!IMG_0235.jpg|width=359,height=191!

 

 

 

 

  was:
PathRecordingDependencyVisitor cannot handle dependency graphs that have 3 or 
more cycles such as below:
  
{code:java}
gid:a:1 (1)
+- gid:b:0
|  \- ^1
+- gid:b:1
|  \- ^1
\- gid:b:2
   \- ^1
{code}
It fails with StackOverflowError or OutOfMemoryError. [Test 
case|https://github.com/suztomo/maven-resolver/commit/31b24dfe240997861e27661a7540546fbe6e0dab].

 

Diagnosis with 

 

The following illustration tracks the node traversal for the test case above. 
The illustration tracks the dependency node graph and the "visited" set 
maintained by the visitor.

 

The initial state starts with node "a" and visited set \{a}.

!IMG_0234.jpg|width=334,height=252!

!IMG_0235.jpg!

 

 


> PathRecordingDependencyVisitor to handle 3 cycles
> -------------------------------------------------
>
>                 Key: MRESOLVER-93
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-93
>             Project: Maven Resolver
>          Issue Type: Improvement
>          Components: resolver
>    Affects Versions: 1.4.1
>            Reporter: Tomo Suzuki
>            Priority: Major
>         Attachments: IMG_0234.jpg, IMG_0235.jpg, IMG_0236.jpg, IMG_0237.jpg, 
> IMG_0238.jpg, IMG_0240.jpg, IMG_0241.jpg, IMG_0242.jpg, IMG_0243.jpg, 
> IMG_0244.jpg, IMG_0245.jpg, IMG_0255.jpg, IMG_0256.jpg, IMG_0257.jpg, 
> IMG_0258.jpg, IMG_0259.jpg, IMG_0260.jpg, IMG_0261.jpg, IMG_0262.jpg, 
> IMG_0263.jpg, IMG_0264.jpg, IMG_0265.jpg, IMG_0266.jpg
>
>
> PathRecordingDependencyVisitor cannot handle dependency graphs that have 3 or 
> more cycles such as below:
>   
> {code:java}
> gid:a:1 (1)
> +- gid:b:0
> |  \- ^1
> +- gid:b:1
> |  \- ^1
> \- gid:b:2
>    \- ^1
> {code}
> It fails with StackOverflowError or OutOfMemoryError. [Test 
> case|https://github.com/suztomo/maven-resolver/commit/31b24dfe240997861e27661a7540546fbe6e0dab].
>  
> Diagnosis with 
>  
> The following illustration tracks the node traversal for the test case above. 
> The illustration tracks the dependency node graph and the "visited" set 
> maintained by the visitor.
>  
> The initial state starts with node "a" and visited set \{a}.
> !IMG_0234.jpg|width=334,height=252!
> First child of a is b0. Because visited does not contain, visitEnter(b0) 
> returns true. B0 is added to visited.
> !IMG_0235.jpg|width=359,height=191!
>  
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to