Bug 6051 IllegalArgumentException in Initializer constructor
Build 20011115 Trying to browse the (newly added) static initializer of JavaModelManager: Log: Mon Nov 19 12:20:19 CET 2001 1 org.eclipse.core.resources 4 Unhandled exception caught in event loop. Unhandled exception caught in event loop. Reason: Log: Mon Nov 19 12:20:19 CET 2001 4 org.eclipse.ui 0 java.lang.IllegalArgumentException java.lang.IllegalArgumentException at org.eclipse.jdt.internal.core.Initializer.<init>(Initializer.java:24) at org.eclipse.jdt.internal.core.SourceType.getInitializer(SourceType.ja va:132) at org.eclipse.jdt.internal.ui.util.JavaModelUtil.findMemberInCompilatio nUnit(JavaModelUtil.java:161) at org.eclipse.jdt.internal.ui.util.JavaModelUtil.findInCompilationUnit( JavaModelUtil.java:208) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.getWorkingCopy(E ditorUtility.java:272) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor.getCorre spondingElement(CompilationUnitEditor.java:525) at org.eclipse.jdt.internal.ui.javaeditor.JavaEditor.setSelection(JavaEd itor.java:257) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.revealInEditor(E ditorUtility.java:110) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.linkToEdi tor(PackageExplorerPart.java:762) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.handleSel ectionChanged(PackageExplorerPart.java:691) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart.access$0( PackageExplorerPart.java:687) at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$3.selecti onChanged(PackageExplorerPart.java:317) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:147 ) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(Structured Viewer.java:907) at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredVie wer.java:463) at org.eclipse.jface.viewers.AbstractTreeViewer$1.widgetSelected(Abstrac tTreeViewer.java:624) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java: 85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:54) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:635) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1365) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1167) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:729) at org.eclipse.ui.internal.Workbench.run(Workbench.java:712) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoa der.java:820) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.UIMain.main(UIMain.java:52) java.lang.IllegalArgumentException
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/util/JavaModelUtil.java
return findElementOfKind(element.getParent(), kind);	
	}
	
	/**
	 * Returns the first java element that conforms to the given type walking the
	 * java element's parent relationship. If the given element alrady conforms to
	 * the given kind, the element is returned.
	 * Returns <code>null</code> if no such element exits.
	 */
	public static IJavaElement findElementOfKind(IJavaElement element, int kind) {
		while (element != null && element.getElementType() != kind)
			element= element.getParent();
		return element;				
	}
	/**
	 * Finds a method in a type.
	 * This searches for a method with the same name and signature. Parameter types are only
	 * compared by the simple name, no resolving for the fully qualified type name is done.
	 * Constructors are only compared by parameters, not the name.
	 * @param name The name of the method to find
	 * @param paramTypes The type signatures of the parameters e.g. <code>{"QString;","I"}</code>
	 * @param isConstructor If the method is a constructor
	 * @return The first found method or <code>null</code>, if nothing found
	 */
	public static IMethod findMethod(String name, String[] paramTypes, boolean isConstructor, IType type) throws JavaModelException {
		return findMethod(name, paramTypes, isConstructor, type.getMethods());
	}
	/**
	 * Finds a method by name.
	 * This searches for a method with a name and signature. Parameter types are only