Bug 135837 [Viewers] Problems with TreeSelection#equals(..) and StructuredSelection#equals(..)
N20060410-0010 TreeSelection#equals(..) is not symmetric with StructuredSelection#equals(..): - TreeSelection#equals(..) is always false if the argument is not instanceof TreeSelection - StructuredSelection.equals(..) can be true if the argument is a TreeSelection 3 Problems: (1) equals(..) should be symmetric, as defined in Object#equals(..) (2) hashCode() of both classes must return the same if objects are equal (currently, StructuredSelection#hashCode() is not even implemented!) (3) equality is currently only defined for the implementations. Should be defined on interfaces, since clients generally only know about the interface, not the implementation.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TreeSelection.java
/* Implementation note.  This class extends StructuredSelection because many pre-existing
	 * JFace viewer clients assumed that the only implementation of IStructuredSelection 
	 * was StructuredSelection.  By extending StructuredSelection rather than implementing
	 * ITreeSelection directly, we avoid this problem.
	 * For more details, see Bug 121939 [Viewers] TreeSelection should subclass StructuredSelection. 
	 */
	
	private TreePath[] paths = null;
	private CustomHashtable element2TreePaths = null;
	/**
	 * The canonical empty selection. This selection should be used instead of
	 * <code>null</code>.
	 */
	public static final TreeSelection EMPTY = new TreeSelection();
	
	private static final TreePath[] EMPTY_TREE_PATHS= new TreePath[0];
	
	private static class InitializeData {