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
case IJavaElement.IMPORT_DECLARATION:
				je= getSuitableJavaElement(je);
				if (je != null) {
					ICompilationUnit cu= (ICompilationUnit)je.getParent().getParent();
					try {
						if (cu.getImports()[0].equals(je)) {
							Object selectedElement= getSingleElementFromSelection(getViewer().getSelection());
							if (selectedElement instanceof IImportContainer)
								return (IImportContainer)selectedElement;
						}
					} catch (JavaModelException ex) {
						
					}
					return je;
				}
				break;
		}
		return null;
	}
	/**
	 * Finds the closest Java element which can be used as input for
	 * this part and has the given Java element as child
	 *
	 * @param 	je 	the Java element for which to search the closest input
	 * @return	the closest Java element used as input for this part
	 */
	protected IJavaElement findInputForJavaElement(IJavaElement je) {
		if (je == null || !je.exists())
			return null;
		switch (je.getElementType()) {