Bug 32714 Packages View: flickering and loosing expanded state when logical package is selected with hierarchical layout
In the java browsing perspective: - enable hierarchical layout for the packages view - select a logical package in the packages view - select types/methods in the types/methods views -> the packages view flickers and looses the expanded state (the tree is only expanded upto the logical package, other expanded subtrees are collapsed)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/PackagesView.java
addKeyListener();
		
		
		hookViewerListeners();
		
		viewer.setContentProvider(createContentProvider());
		
		initDragAndDrop();
		
	}
	
	protected JavaElementSorter createJavaElementSorter() {
		return new JavaElementSorter(){
			public int category(Object element) {
				if (element instanceof LogicalPackage) {
					LogicalPackage cp= (LogicalPackage) element;
					return super.category(cp.getFragments()[0]);
				} else return super.category(element);
			}
			public int compare(Viewer viewer, Object e1, Object e2){
				if (e1 instanceof LogicalPackage) {
					LogicalPackage cp= (LogicalPackage) e1;
					e1= cp.getFragments()[0];
				}
				if (e2 instanceof LogicalPackage) {
					LogicalPackage cp= (LogicalPackage) e2;
					e2= cp.getFragments()[0];
				}
				return super.compare(viewer, e1, e2);
			}