Bug 64921 members view: selection of a member does not give proper selection change events [browsing]
RC1 - browsing perspective, smoke test scenario - to make the problem visible, enable "Mark occurrences" - open IMoney.java - in the members view, double click on a not selected element -> ok: the member is selected in the editor, focus is transferred to the editor, the element gets highlighted (-> selection changed event was sent out) - now select a different element in the members view (no double click!) -> ? ok ? The element gets selected in the editor, but it is not highlighted (may be on purpose, since the editor is not active). -> not ok: if I double click now, the focus is transferred to the editor, but the highlighting is not updated. This is because the selection has not changed and no event is therefore sent out. The question is really whether selection without giving focus should trigger a selection changed event in the editor.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/SelectionListenerWithASTManager.java
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaUIMessages;
/**
 * Infrastructure to share an AST for editor post selection listeners.
 */
public class SelectionListenerWithASTManager {
	
	private static SelectionListenerWithASTManager fgDefault;
	
	/**
	 * @return Returns the default manager instance.
	 */
	public static SelectionListenerWithASTManager getDefault() {
		if (fgDefault == null) {
			fgDefault= new SelectionListenerWithASTManager();
		}
		return fgDefault;
	}
	
	
	private static class PartListenerGroup {