Bug 84657 [content assist] CodeAssist failure surfaced to user
When codeassisting at: <|> location below, an error dialog opened reading: "The command for the key you pressed failed". ================================ public class X { public static void main(String[] args) { Comparable<?> c1 = foo("", new Integer(5)); Object o = foo("", 5); } public static <T> T foo(T t1, T t2) { System.out.print("foo:"+t1.getClass().ge<|>+t2.getClass()); return null; } } In .log, following entry got dumped: !ENTRY org.eclipse.ui 4 0 2005-02-08 10:23:59.806 !MESSAGE The command for the key you pressed failed !STACK 0 java.lang.IllegalArgumentException at org.eclipse.jdt.internal.core.util.Util.scanTypeSignature(Util.java:2111) at org.eclipse.jdt.internal.core.util.Util.scanArrayTypeSignature(Util.java:2167) at org.eclipse.jdt.internal.core.util.Util.scanTypeSignature(Util.java:2094) at org.eclipse.jdt.internal.corext.template.java.SignatureUtil.unboundedSignature(SignatureUtil.java:279) at org.eclipse.jdt.internal.ui.text.java.ResultCollector.internalAcceptMethod(ResultCollector.java:269) at org.eclipse.jdt.internal.ui.text.java.ResultCollector.accept(ResultCollector.java:696) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findLocalMethods(CompletionEngine.java:2820) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findMethods(CompletionEngine.java:3329) at org.eclipse.jdt.internal.codeassist.CompletionEngine.findFieldsAndMethods(CompletionEngine.java:1907) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:760) at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete(CompletionEngine.java:1205) at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:119) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:287) at org.eclipse.jdt.internal.core.CompilationUnit.codeComplete(CompilationUnit.java:280) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.internalComputeCompletionProposals(JavaCompletionProcessor.java:361) at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.computeCompletionProposals(JavaCompletionProcessor.java:334) at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1470) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:250) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7(CompletionProposalPopup.java:247) at org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run(CompletionProposalPopup.java:206) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:201) at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1319) at org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditor$AdaptedSourceViewer.doOperation(CompilationUnitEditor.java:180) at org.eclipse.ui.texteditor.ContentAssistAction$1.run(ContentAssistAction.java:82) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:80) at org.eclipse.jface.action.Action.runWithEvent(Action.java:989) at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:188) at org.eclipse.ui.internal.commands.Command.execute(Command.java:130) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:445) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:724) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:767) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:536) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java:479) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java:221) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:781) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:841) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:866) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:851) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:879) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:875) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1181) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3121) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3024) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3449) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1587) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2513) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1585) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1551) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:290) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:227) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:276) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:131) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:261) at org.eclipse.core.launcher.Main.run(Main.java:817) at org.eclipse.core.launcher.Main.main(Main.java:801) The command for the key you pressed failed
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ParameterGuesser.java
if (variable.typeName.equals(typeName) && variable.typePackage.equals(typePackage))
			return true;
		
			
		return isAssignable(variable, typePackage, typeName);
	}
	/**
	 * Returns true if variable is assignable to a type, false otherwise.
	 */
	private boolean isAssignable(Variable variable, String typePackage, String typeName) throws JavaModelException {
		
		
		StringBuffer paramTypeName= new StringBuffer();
		if (typePackage.length() != 0) {
			paramTypeName.append(typePackage);
			paramTypeName.append('.');
		}
		paramTypeName.append(typeName);
		StringBuffer varTypeName= new StringBuffer();
		if (variable.typePackage.length() != 0) {
			varTypeName.append(variable.typePackage);
			varTypeName.append('.');
		}
		varTypeName.append(variable.typeName);
		
		IJavaProject project= fCompilationUnit.getJavaProject();