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
/**
	 * Tests if a method equals to the given 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 of the method
	 * @param The type signatures of the parameters e.g. <code>{"QString;","I"}</code>
	 * @param Specifies if the method is a constructor
	 * @return Returns <code>true</code> if the method has the given name and parameter types and constructor state.
	 */
	public static boolean isSameMethodSignature(String name, String[] paramTypes, boolean isConstructor, IMethod curr) throws JavaModelException {
		if (isConstructor || name.equals(curr.getElementName())) {
			if (isConstructor == curr.isConstructor()) {
				String[] currParamTypes= curr.getParameterTypes();
				if (paramTypes.length == currParamTypes.length) {
					for (int i= 0; i < paramTypes.length; i++) {
						String t1= Signature.getSimpleName(Signature.toString(paramTypes[i]));
						String t2= Signature.getSimpleName(Signature.toString(currParamTypes[i]));
						if (!t1.equals(t2)) {
							return false;
						}
					}
					return true;
				}
			}
		}
		return false;
	}