Bug 20595 Preference listeners should use equals, not ==
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/packageview/PackageExplorerPart.java
if (oldSelection.size() == 1) {
				Object o= oldSelection.getFirstElement();
				if (o instanceof IJavaElement) {
					ICompilationUnit cu= (ICompilationUnit)((IJavaElement)o).getAncestor(IJavaElement.COMPILATION_UNIT);
					if (cu != null) {
						if (cu.isWorkingCopy())
							cu= (ICompilationUnit)cu.getOriginalElement();
						if ( element.equals(cu))
							return;
					}
					IClassFile cf= (IClassFile)((IJavaElement)o).getAncestor(IJavaElement.CLASS_FILE);
					if (cf != null && element.equals(cf))
						return;
				}
			}
			ISelection newSelection= new StructuredSelection(element);
			if (!fViewer.getSelection().equals(newSelection)) {
				try {
					fViewer.removeSelectionChangedListener(fSelectionListener);
					fViewer.setSelection(newSelection);
				} finally {
					fViewer.addSelectionChangedListener(fSelectionListener);
				}
			}
		}
	}
	
	/**
	 * A compilation unit or class was expanded, expand
	 * the main type.