Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 138136

Summary: [JFace] StructuredViewer.setComparator() has no effect
Product: [Eclipse Project] Platform Reporter: Benjamin Pasero <bpasero>
Component: UIAssignee: Karice McIntyre <Karice_McIntyre>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Benjamin Pasero CLA 2006-04-23 09:48:48 EDT
Version: 3.2.0
Build id: I20060413-1718

Due to a wrong comparision (at least it looks so), setting a Comparator, which is recommended in 3.2 over setting a Sorter, is not working at all:

public void setComparator(ViewerComparator comparator){
    if (this.sorter != sorter){ // <-- Will always be FALSE
        this.sorter = comparator;
        refresh();
    }
}

I think the Method should look like:

public void setComparator(ViewerComparator comparator){
    if (this.sorter != comparator){
        this.sorter = comparator;
        refresh();
    }
}

Ben
Comment 1 Karice McIntyre CLA 2006-04-24 11:35:44 EDT

*** This bug has been marked as a duplicate of 137849 ***