[ 
https://issues.apache.org/jira/browse/IVY-1233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13236103#comment-13236103
 ] 

Sven Zethelius commented on IVY-1233:
-------------------------------------

The infinite loop from my repro above stems from 
LatestCompatibleConflictManager.blackListIncompatibleCaller.  It is looking at 
the callers of the current node.  When node is the root node, the caller list 
is empty.  This results in blacklisted.isEmpty()==true, but since 
dynamicCaller==true, it returns empty list instead of null.  Then in the 
LatestCompatibleConflictManager.handleIncompatibleCaller, it does an addAll of 
an empty list (aka NO-OP).  

Digging back through the change log, IVY-663 relates. Before that and the 
previous patch change, blackListIncompatibleCaller would return null whenever 
blacklisted.isEmpty()==true.  

Here's a test case for the problem:
    public void testDynamicRootConflict() throws Exception {
        try {
            fixture
                .addMD("#A;conflict-> {#B;[1.2,2.0[ #C;pCC.main.+ #D;[1.5,1.7[ 
}")
                .addMD("#B;1.0.0->#D;[1.6.1,2.0[")
                .addMD("#B;1.1.0->#D;[1.6.1,2.0[")
                .addMD("#B;pCC.main.0.0->#D;[1.6.1,2.0[")
                .addMD("#C;1.0.0-> {#B;[1.0,2.0[ #D;[1.6.0,1.7[ }")
                .addMD("#C;1.1.0-> {#B;[1.1,2.0[ #D;[1.6.0,1.7[ }")
                .addMD("#C;pCC.main.1.9-> {#B;pCC.main.+ #D;[1.6.0,1.7[ }")
                .addMD("#D;1.6.1").init();
            fixture.resolve("#A;conflict");

            fail("Resolve should have failed with a conflict");
        } catch (StrictConflictException e) {
            // this is expected
        }
    }

                
> Infinite loop in latest-compatible conflict manager
> ---------------------------------------------------
>
>                 Key: IVY-1233
>                 URL: https://issues.apache.org/jira/browse/IVY-1233
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.2.0-RC1
>            Reporter: Archie Cobbs
>            Assignee: Maarten Coene
>             Fix For: trunk
>
>         Attachments: ivy-1233-test.patch, ivy-1233.patch, ivybug.zip
>
>
> Attempting to resolve org="com.gargoylesoftware" name="htmlunit" rev="2.7" 
> from the Ivy RoundUp repository with the latest-compatible conflict manager 
> configured leads to an infinite loop:
> {noformat}
> $ ant
> Buildfile: build.xml
> clean:
> bug:
> [ivy:resolve] :: Ivy 2.2.0-rc1 - 20100629224905 :: http://ant.apache.org/ivy/ 
> ::
> [ivy:resolve] :: loading settings :: file = /Users/archie/IVYBUG/settings.xml
> [ivy:resolve] BLACKLISTING [org.apache.xerces#xerces;2.7+ blacklisted to 
> evict org.apache.xerces#xerces;2.7+ in favor of 
> org.apache.xerces#xerces;2.9.1 in com.gargoylesoftware#htmlunit;2.7 for 
> default]
> [ivy:resolve] BLACKLISTING [org.apache.xerces#xerces;2.7+ blacklisted to 
> evict org.apache.xerces#xerces;2.7+ in favor of 
> org.apache.xerces#xerces;2.9.1 in com.gargoylesoftware#htmlunit;2.7 for 
> default]
> [ivy:resolve] BLACKLISTING [org.apache.xerces#xerces;2.7+ blacklisted to 
> evict org.apache.xerces#xerces;2.7+ in favor of 
> org.apache.xerces#xerces;2.9.1 in com.gargoylesoftware#htmlunit;2.7 for 
> default]
> [ivy:resolve] BLACKLISTING [org.apache.xerces#xerces;2.7+ blacklisted to 
> evict org.apache.xerces#xerces;2.7+ in favor of 
> org.apache.xerces#xerces;2.9.1 in com.gargoylesoftware#htmlunit;2.7 for 
> default]
> [ivy:resolve] BLACKLISTING [org.apache.xerces#xerces;2.7+ blacklisted to 
> evict org.apache.xerces#xerces;2.7+ in favor of 
> org.apache.xerces#xerces;2.9.1 in com.gargoylesoftware#htmlunit;2.7 for 
> default]
> [ivy:resolve] BLACKLISTING [org.apache.xerces#xerces;2.7+ blacklisted to 
> evict org.apache.xerces#xerces;2.7+ in favor of 
> org.apache.xerces#xerces;2.9.1 in com.gargoylesoftware#htmlunit;2.7 for 
> default]
> [ivy:resolve] BLACKLISTING [org.apache.xerces#xerces;2.7+ blacklisted to 
> evict org.apache.xerces#xerces;2.7+ in favor of 
> org.apache.xerces#xerces;2.9.1 in com.gargoylesoftware#htmlunit;2.7 for 
> default]
> ...
> {noformat}
> See attached test case. To run it, unpack ZIP file, cd into IVYBUG, copy 
> {{ant-2.2.0-rc1.jar}} in the current directory and then run "ant".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to