Bug 153503 [Viewers] ComboViewer#setSelection does't select element w/o equals override
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.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractListViewer.java
/*******************************************************************************
 * Copyright (c) 2004, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Chris Longfield <clongfield@internap.com> - Fix for Bug 70856
 *******************************************************************************/
package org.eclipse.jface.viewers;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.util.Assert;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Widget;
/**
 * Abstract base class for viewers that contain lists of items (such as a combo or list).
 * Most of the viewer implementation is in this base class, except for the minimal code that
 * actually communicates with the underlying widget.
 * 
 * @see org.eclipse.jface.viewers.ListViewer
 * @see org.eclipse.jface.viewers.ComboViewer
 * 
 * @since 3.0
 */
public abstract class AbstractListViewer extends StructuredViewer {
    /**
     * A list of viewer elements (element type: <code>Object</code>).