Project: Eclipse_Platform_UI
Bug 153503 [Viewers] ComboViewer#setSelection does't select element w/o equals override
Reported: 2006-08-10 18:36:00 | Status: resolved fixed

I use a ComboViewer to show elements of a class that does not override Object#equals and #hashCode. Therefore I specified an IElementComparer via ComboViewer#setComparer to do the job. My expectation was that the comparer would be used in setSelection to find the element to be selected. Apparently this is not the case. To me this looks like a bug, or is this behaviour desired? The attached test case reproduces this behaviour.

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractListViewer.java tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ComboViewerComparerTest.java