ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Plaumann (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IVY-1354) Dynamic version resolution incorrect under JDK7
Date Wed, 30 May 2012 16:31:23 GMT
Matt Plaumann created IVY-1354:
----------------------------------

             Summary: Dynamic version resolution incorrect under JDK7
                 Key: IVY-1354
                 URL: https://issues.apache.org/jira/browse/IVY-1354
             Project: Ivy
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.2.0
            Reporter: Matt Plaumann


JDK7 has re-implemented {{Collections.sort()}}.  This change is causing dynamic revisions
to sort incorrectly.

Here is a simple unit test for {{LatestRevisionStrategyTest}} that shows the behaviour:
{noformat}
/**
 * The sort algorithm in JDK7 changed in a way that requires comparators to be a little
 * stricter.  Running JDK7 with {@code java.util.Arrays.useLegacyMergeSort=true} reverts
 * to the previous behaviour.
 * 
 * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6804124">RFE: 6804124</a>
 */
public void testJdk7Sort() {
    ArtifactInfo[] revs = toMockAI(new String[]{"latest.integration", "latest.milestone" });
    	
    LatestRevisionStrategy latestRevisionStrategy = new LatestRevisionStrategy();
    List sorted = latestRevisionStrategy.sort( revs );
    	
    assertEquals(Arrays.asList(revs[1], revs[0]), sorted );
}
{noformat}

The {{-Djava.util.Arrays.useLegacyMergeSort=true}} VM switch reverts to the previous sort
algorithm.



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

        

Mime
View raw message