You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Emond Papegaaij (JIRA)" <ji...@apache.org> on 2013/01/08 20:04:13 UTC

[jira] [Resolved] (WICKET-4956) compareTo methods of Actions in BufferedWebResponse violate Comparable contract

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

Emond Papegaaij resolved WICKET-4956.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.5.0

I've managed to trigger the 'Comparison Method violates its general contract' on Java 7 by adding 100,000 random items, but only once. The new Tim-sort is only used on over 32 items and the error is only triggered under very specific circumstances, so it will probably never fail on the actions in BufferedWebResponse, however to be on the safe side, I did fix the compareTo methods to sort the actions in 3 categories.
                
> compareTo methods of Actions in BufferedWebResponse violate Comparable contract
> -------------------------------------------------------------------------------
>
>                 Key: WICKET-4956
>                 URL: https://issues.apache.org/jira/browse/WICKET-4956
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 6.4.0
>            Reporter: Emond Papegaaij
>            Assignee: Emond Papegaaij
>            Priority: Minor
>             Fix For: 6.5.0
>
>
> I've never seen this result in an exception so far, but the implementations of the methods is wrong and will fail on java 7 if multiple action instances of the same class are sorted using Collections.sort. The sorting should return 0 if instances are of the same type.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira