Bug 79414

Summary: states with same time stamps may appear in the wrong order
Product: [Eclipse Project] Platform Reporter: Rafael Chaves <eclipse>
Component: CompareAssignee: Andre Weinand <andre_weinand>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rafael Chaves CLA 2004-11-24 12:30:32 EST
i20041123

Using the local history UI, sometimes states that have the same apparent
timestamp may be in the wrong order. I could verify this with both new and
existing implementation for the history store. Need to investigate if it is us
or Compare.
Comment 1 Rafael Chaves CLA 2004-11-24 15:37:06 EST
Verified we are behaving correctly. We return the states in the right order as
spec'd.

The problem comes from the fact that compare will try to sort the states
(history items, actually) again (EditionSelectionDialog.internalSort), and the
sorting algorithm used (quick sort) is not stable, potentially changing the
order of states with the same modification time.
Comment 2 Rafael Chaves CLA 2004-11-25 16:30:25 EST
Suggestion: you can use java.util.Arrays.sort(Object[], java.util.Comparator),
which is guaranteed to be stable.
Comment 3 Andre Weinand CLA 2004-11-25 18:08:05 EST
fix released for N20041126