Bug 93877 - [content assist] fails with "Error Executing Command"
Summary: [content assist] fails with "Error Executing Command"
Status: RESOLVED DUPLICATE of bug 90414
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-06 03:48 EDT by Max Rotvel CLA
Modified: 2005-05-06 07:50 EDT (History)
1 user (show)

See Also:


Attachments
The failing class (10.75 KB, text/plain)
2005-05-06 03:58 EDT, Max Rotvel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max Rotvel CLA 2005-05-06 03:48:25 EDT
I have a class where I define a number of Pattern constants similar to 
this:
 
// GET <type> <path>| <offset> <length> |<playerid>|
private static final Pattern GET = Pattern
.compile("(GET) (\\p{Upper}*) (.*)\\| (\\d+) (\\d+) .*", 
Pattern.DOTALL);
 
This causes content assist (Ctrl-Space) to fail with an "Error Executing 
Command" dialog. The reason given in the dialog is "The command for the 
key you pressed failed" :-)
 
If I comment out all the definitions content assist works properly again.
Comment 1 Max Rotvel CLA 2005-05-06 03:58:10 EDT
Created attachment 20764 [details]
The failing class

I've simply ripped out the offending class from my project and added it as a
test case. You'll obviously get heaps of compilation errors, but should be able
to reproduce the error like this: Try using content assist at "this." in line
89 
(this.controller = controller;). It should fail. Now go to line 205 and comment
out the Pattern variable definition in line 205 + 206. And go back and try
content assist again. Now it works.
Comment 2 Max Rotvel CLA 2005-05-06 04:01:39 EDT
The error log had this to say:

The command for the key you pressed failed

java.lang.NegativeArraySizeException
	at org.eclipse.jdt.internal.compiler.parser.Scanner.
getCurrentTokenSourceString(Scanner.java:501)
	at org.eclipse.jdt.internal.compiler.parser.Parser.consumeToken(Parser.
java:6793)
	at org.eclipse.jdt.internal.codeassist.impl.AssistParser.
consumeToken(AssistParser.java:666)
	at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.
consumeToken(CompletionParser.java:2235)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8377)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8560)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:8525)
	at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:
7343)
	at org.eclipse.jdt.internal.codeassist.complete.CompletionParser.
dietParse(CompletionParser.java:2905)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.
complete(CompletionEngine.java:1057)
	at org.eclipse.jdt.internal.core.Openable.codeComplete(Openable.java:119)
	at org.eclipse.jdt.internal.core.CompilationUnit.
codeComplete(CompilationUnit.java:300)
	at org.eclipse.jdt.internal.core.CompilationUnit.
codeComplete(CompilationUnit.java:293)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.
internalComputeCompletionProposals(JavaCompletionProcessor.java:335)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.
computeCompletionProposals(JavaCompletionProcessor.java:313)
	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:183)
	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:996)
	at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:182)
	at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.
execute(LegacyHandlerWrapper.java:108)
	at org.eclipse.core.commands.Command.execute(Command.java:331)
	at org.eclipse.core.commands.ParameterizedCommand.
execute(ParameterizedCommand.java:396)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.
executeCommand(WorkbenchKeyboard.java:452)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.
java:741)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.
processKeyEvent(WorkbenchKeyboard.java:784)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.
filterKeySequenceBindings(WorkbenchKeyboard.java:543)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.
access$3(WorkbenchKeyboard.java:486)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.
handleEvent(WorkbenchKeyboard.java:110)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:777)
	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:1182)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3126)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3029)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3466)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1625)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2525)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:
306)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.
run(PlatformActivator.java:228)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.
java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.
java:156)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:315)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:268)
	at org.eclipse.core.launcher.Main.run(Main.java:942)
	at org.eclipse.core.launcher.Main.main(Main.java:926)

eclipse.buildId=I20050219-1500
java.version=1.5.0_01
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=da_DK
Command-line arguments:  -os win32 -ws win32 -arch x86 -data c:\dev\workspace
Comment 3 Tom Hofmann CLA 2005-05-06 04:23:29 EDT
Moving to core as the problem appears to be in the scanner.
Comment 4 David Audel CLA 2005-05-06 07:50:25 EDT

*** This bug has been marked as a duplicate of 90414 ***