ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Plaumann (JIRA)" <>
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
             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:
 * 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="">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 );

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

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message