Bug 99629 - Error while entering expression in change variable value dialog
Summary: Error while entering expression in change variable value dialog
Status: VERIFIED FIXED
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 RC3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 09:17 EDT by Darin Wright CLA
Modified: 2005-06-16 11:24 EDT (History)
0 users

See Also:


Attachments
Proposed patch (2.53 KB, text/plain)
2005-06-14 15:21 EDT, David Audel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2005-06-13 09:17:19 EDT
3.1RC2

I was entering an expression to change the value of an array of doubles, and 
received an exception after typing a "." in a double, like "new double[] {1.2 
3."


Error 2005-06-13 08:12:07.328 Failed to execute runnable 
(org.eclipse.jdt.internal.codeassist.complete.InvalidCursorLocation)
org.eclipse.swt.SWTException: Failed to execute runnable 
(org.eclipse.jdt.internal.codeassist.complete.InvalidCursorLocation)
	at org.eclipse.swt.SWT.error(SWT.java:2940)
	at org.eclipse.swt.SWT.error(SWT.java:2863)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:121)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3035)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2694)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
	at org.eclipse.jface.window.Window.open(Window.java:787)
	at 
org.eclipse.jdt.internal.debug.ui.actions.JavaObjectValueEditor.editVariable
(JavaObjectValueEditor.java:76)
	at 
org.eclipse.jdt.internal.debug.ui.actions.JavaVariableValueEditor.editVariable
(JavaVariableValueEditor.java:47)
	at 
org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction.delegateEdit
(ChangeVariableValueAction.java:92)
	at 
org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction.doActionPerform
ed(ChangeVariableValueAction.java:73)
	at org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction.run
(ChangeVariableValueAction.java:166)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
	at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:538)
	at org.eclipse.jface.action.ActionContributionItem.access$2
(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent
(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3058)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2691)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1716)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1680)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:365)
	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:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:85)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:58)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:60)
	at java.lang.reflect.Method.invoke(Method.java:391)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: org.eclipse.jdt.internal.codeassist.complete.InvalidCursorLocation
	at 
org.eclipse.jdt.internal.codeassist.complete.CompletionScanner.scanNumber
(CompletionScanner.java:804)
	at org.eclipse.jdt.internal.compiler.parser.Scanner.jumpOverMethodBody
(Scanner.java:1933)
	at 
org.eclipse.jdt.internal.codeassist.complete.CompletionScanner.getNextToken
(CompletionScanner.java:90)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse
(Parser.java:8473)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse
(Parser.java:8653)
	at org.eclipse.jdt.internal.compiler.parser.Parser.parse
(Parser.java:8618)
	at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse
(Parser.java:7417)
	at 
org.eclipse.jdt.internal.codeassist.complete.CompletionParser.dietParse
(CompletionParser.java:3123)
	at 
org.eclipse.jdt.internal.codeassist.CompletionEngine.parseSnippeInitializer
(CompletionEngine.java:1350)
	at org.eclipse.jdt.internal.codeassist.CompletionEngine.complete
(CompletionEngine.java:1262)
	at org.eclipse.jdt.internal.core.SourceType.codeComplete
(SourceType.java:105)
	at org.eclipse.jdt.internal.core.SourceType.codeComplete
(SourceType.java:75)
	at 
org.eclipse.jdt.internal.debug.ui.display.DisplayCompletionProcessor.computeCom
pletionProposals(DisplayCompletionProcessor.java:177)
	at 
org.eclipse.jdt.internal.debug.ui.display.DisplayCompletionProcessor.computeCom
pletionProposals(DisplayCompletionProcessor.java:148)
	at 
org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposal
s(ContentAssistant.java:1503)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals
(CompletionProposalPopup.java:256)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7
(CompletionProposalPopup.java:253)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run
(CompletionProposalPopup.java:216)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:69)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals
(CompletionProposalPopup.java:211)
	at org.eclipse.jface.text.contentassist.ContentAssistant$2.run
(ContentAssistant.java:327)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:118)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3035)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2694)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
	at org.eclipse.jface.window.Window.open(Window.java:787)
	at 
org.eclipse.jdt.internal.debug.ui.actions.JavaObjectValueEditor.editVariable
(JavaObjectValueEditor.java:76)
	at 
org.eclipse.jdt.internal.debug.ui.actions.JavaVariableValueEditor.editVariable
(JavaVariableValueEditor.java:47)
	at 
org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction.delegateEdit
(ChangeVariableValueAction.java:92)
	at 
org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction.doActionPerform
ed(ChangeVariableValueAction.java:73)
	at org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction.run
(ChangeVariableValueAction.java:166)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
	at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:538)
	at org.eclipse.jface.action.ActionContributionItem.access$2
(ActionContributionItem.java:488)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent
(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3058)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2691)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1716)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1680)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:365)
	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:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:163)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:85)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:58)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:60)
	at java.lang.reflect.Method.invoke(Method.java:391)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
Comment 1 Darin Wright CLA 2005-06-14 11:50:24 EDT
Looks like the internal runtime exception InvalidCursorLocation should be 
handled by JCORE. Moving to JCORE for comment. The call stack looks like this:

Thread [main] (Suspended (exception 
org.eclipse.jdt.internal.codeassist.complete.InvalidCursorLocation))
	owns: org.eclipse.swt.widgets.RunnableLock  (id=35095372)
	org.eclipse.jdt.internal.codeassist.complete.CompletionScanner.scanNumb
er(boolean) line: 804
	org.eclipse.jdt.internal.codeassist.complete.CompletionScanner
(org.eclipse.jdt.internal.compiler.parser.Scanner).jumpOverMethodBody() line: 
1933
	org.eclipse.jdt.internal.codeassist.complete.CompletionScanner.getNextT
oken() line: 90
	org.eclipse.jdt.internal.codeassist.complete.CompletionParser
(org.eclipse.jdt.internal.compiler.parser.Parser).parse() line: 8473
	org.eclipse.jdt.internal.codeassist.complete.CompletionParser
(org.eclipse.jdt.internal.compiler.parser.Parser).parse
(org.eclipse.jdt.internal.compiler.env.ICompilationUnit, 
org.eclipse.jdt.internal.compiler.CompilationResult, int, int) line: 8653
	org.eclipse.jdt.internal.codeassist.complete.CompletionParser
(org.eclipse.jdt.internal.compiler.parser.Parser).parse
(org.eclipse.jdt.internal.compiler.env.ICompilationUnit, 
org.eclipse.jdt.internal.compiler.CompilationResult) line: 8618
	org.eclipse.jdt.internal.codeassist.complete.CompletionParser
(org.eclipse.jdt.internal.compiler.parser.Parser).dietParse
(org.eclipse.jdt.internal.compiler.env.ICompilationUnit, 
org.eclipse.jdt.internal.compiler.CompilationResult) line: 7417
	org.eclipse.jdt.internal.codeassist.complete.CompletionParser.dietParse
(org.eclipse.jdt.internal.compiler.env.ICompilationUnit, 
org.eclipse.jdt.internal.compiler.CompilationResult, int) line: 3123
	org.eclipse.jdt.internal.codeassist.CompletionEngine.parseSnippeInitial
izer(char[], int, char[][], char[][], int[], boolean) line: 1350
	org.eclipse.jdt.internal.codeassist.CompletionEngine.complete
(org.eclipse.jdt.core.IType, char[], int, char[][], char[][], int[], boolean) 
line: 1262
	org.eclipse.jdt.internal.core.SourceType.codeComplete(char[], int, 
int, char[][], char[][], int[], boolean, 
org.eclipse.jdt.core.CompletionRequestor, 
org.eclipse.jdt.core.WorkingCopyOwner) line: 105
	org.eclipse.jdt.internal.core.SourceType.codeComplete(char[], int, 
int, char[][], char[][], int[], boolean, 
org.eclipse.jdt.core.CompletionRequestor) line: 75
	org.eclipse.jdt.internal.debug.ui.display.DisplayCompletionProcessor.co
mputeCompletionProposals(org.eclipse.jdt.debug.core.IJavaStackFrame, 
org.eclipse.jface.text.ITextViewer, int) line: 177
	org.eclipse.jdt.internal.debug.ui.display.DisplayCompletionProcessor.co
mputeCompletionProposals(org.eclipse.jface.text.ITextViewer, int) line: 148
	org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletion
Proposals(org.eclipse.jface.text.ITextViewer, int) line: 1503
	org.eclipse.jface.text.contentassist.CompletionProposalPopup.computePro
posals(int) line: 256
	org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7
(org.eclipse.jface.text.contentassist.CompletionProposalPopup, int) line: 253
	org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run() 
line: 216
	org.eclipse.swt.custom.BusyIndicator.showWhile
(org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 69
	org.eclipse.jface.text.contentassist.CompletionProposalPopup.showPropos
als(boolean) line: 211
	org.eclipse.jface.text.contentassist.ContentAssistant$2.run() line: 327
	org.eclipse.swt.widgets.RunnableLock.run() line: 35
	org.eclipse.ui.internal.UISynchronizer
(org.eclipse.swt.widgets.Synchronizer).runAsyncMessages(boolean) line: 118
	org.eclipse.swt.widgets.Display.runAsyncMessages(boolean) line: 3035
	org.eclipse.swt.widgets.Display.readAndDispatch() line: 2694
	org.eclipse.jdt.internal.debug.ui.actions.ExpressionInputDialog
(org.eclipse.jface.window.Window).runEventLoop(org.eclipse.swt.widgets.Shell) 
line: 809
	org.eclipse.jdt.internal.debug.ui.actions.ExpressionInputDialog
(org.eclipse.jface.window.Window).open() line: 787
	org.eclipse.jdt.internal.debug.ui.actions.JavaObjectValueEditor.editVar
iable(org.eclipse.debug.core.model.IVariable, org.eclipse.swt.widgets.Shell) 
line: 76
	org.eclipse.jdt.internal.debug.ui.actions.JavaVariableValueEditor.editV
ariable(org.eclipse.debug.core.model.IVariable, org.eclipse.swt.widgets.Shell) 
line: 47
	org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction.delegat
eEdit(org.eclipse.swt.widgets.Shell) line: 92
	org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction.doActio
nPerformed(org.eclipse.debug.core.model.IVariable) line: 73
	org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction.run() 
line: 166
	org.eclipse.debug.internal.ui.actions.ChangeVariableValueAction
(org.eclipse.jface.action.Action).runWithEvent(org.eclipse.swt.widgets.Event) 
line: 996
	org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(org.eclipse.swt.widgets.Event, boolean) line: 538
	org.eclipse.jface.action.ActionContributionItem.access$2
(org.eclipse.jface.action.ActionContributionItem, 
org.eclipse.swt.widgets.Event, boolean) line: 488
	org.eclipse.jface.action.ActionContributionItem$5.handleEvent
(org.eclipse.swt.widgets.Event) line: 400
	org.eclipse.swt.widgets.EventTable.sendEvent
(org.eclipse.swt.widgets.Event) line: 66
	org.eclipse.swt.widgets.MenuItem
(org.eclipse.swt.widgets.Widget).sendEvent(org.eclipse.swt.widgets.Event) 
line: 844
	org.eclipse.swt.widgets.Display.runDeferredEvents() line: 3058
	org.eclipse.swt.widgets.Display.readAndDispatch() line: 2691
	org.eclipse.ui.internal.Workbench.runEventLoop
(org.eclipse.jface.window.Window$IExceptionHandler, 
org.eclipse.swt.widgets.Display) line: 1716
	org.eclipse.ui.internal.Workbench.runUI() line: 1680
	org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) 
line: 365
	org.eclipse.ui.PlatformUI.createAndRunWorkbench
(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) 
line: 143
	org.eclipse.ui.internal.ide.IDEApplication.run(java.lang.Object) line: 
103
	org.eclipse.core.internal.runtime.PlatformActivator$1.run
(java.lang.Object) line: 226
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.Object) 
line: 376
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.String
[], java.lang.Runnable) line: 163
	sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, 
java.lang.Object, java.lang.Object[]) line: not available [native method]
	sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, 
java.lang.Object[]) line: 85
	sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.reflect.Method, 
java.lang.Object, java.lang.Object[]) line: 58
	sun.reflect.DelegatingMethodAccessorImpl.invoke
(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: 60
	java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) 
line: 391
	org.eclipse.core.launcher.Main.invokeFramework(java.lang.String[], 
java.net.URL[]) line: 334
	org.eclipse.core.launcher.Main.basicRun(java.lang.String[]) line: 278
	org.eclipse.core.launcher.Main.run(java.lang.String[]) line: 973
	org.eclipse.core.launcher.Main.main(java.lang.String[]) line: 948
Comment 2 Philipe Mulet CLA 2005-06-14 14:01:46 EDT
+1 for RC3. 

Darin: pls cast your vote. We already handle proper exceptions on different API
call, fix would be to make this API similar.
Comment 3 Darin Wright CLA 2005-06-14 14:30:51 EDT
+1 from Darin W
Comment 4 David Audel CLA 2005-06-14 15:21:43 EDT
Created attachment 23096 [details]
Proposed patch

Add the same protection as inside CompletionEngine#complete(ICompilationUnit,
int, int)
Comment 5 David Audel CLA 2005-06-14 15:26:04 EDT
Fix released and test added
  SnippetCompletionTests#testCodeSnippetAssistInsideNumber()
Comment 6 Maxime Daniel CLA 2005-06-16 09:51:18 EDT
Verified using build N20050616-0010 + JDT Core HEAD.