Bug 121192 Cannot select initializer in Member view
I20051215 1. Open Java Browsing perspective 2. Add the following type: public class X { { } X() {} } 3. In the Member view, attempt to select the initializer Observe: The selection is cleared from the Member view and the initializer is not selected in the Java editor If you remove the constructor, then it works. It also works in the Outline view.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java
} else {
					IClassFile cf= (IClassFile)((IJavaElement)input).getAncestor(IJavaElement.CLASS_FILE);
					IClassFile importContainerCf= (IClassFile)((IJavaElement)element).getAncestor(IJavaElement.CLASS_FILE);
					return cf != null && cf.equals(importContainerCf);
				}
			}
		}
		return false;
	}
	/**
	 * Finds the element which has to be selected in this part.
	 *
	 * @param je	the Java element which has the focus
	 */
	protected IJavaElement findElementToSelect(IJavaElement je) {
		if (je == null)
			return null;
		switch (je.getElementType()) {
			case IJavaElement.TYPE:
				if (((IType)je).getDeclaringType() == null)
					return null;
				
			case IJavaElement.METHOD:
				
			case IJavaElement.FIELD:
				
			case IJavaElement.PACKAGE_DECLARATION:
				
			case IJavaElement.IMPORT_CONTAINER:
				return getSuitableJavaElement(je);