Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352784 - Null pointer exception when press F2 on an expression in expression view without columns
Summary: Null pointer exception when press F2 on an expression in expression view with...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.7   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Pawel Piech CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 352783 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-07-21 12:33 EDT by Winnie Lai CLA
Modified: 2011-08-08 15:44 EDT (History)
3 users (show)

See Also:
Michael_Rennie: review+


Attachments
Fix. (2.18 KB, patch)
2011-07-21 13:40 EDT, Pawel Piech CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Winnie Lai CLA 2011-07-21 12:33:19 EDT
Build Identifier: 3.7 I20110613-1736

This happens for both cdi and dsf debug.


java.lang.NullPointerException
	at org.eclipse.debug.internal.ui.actions.expressions.EditWatchExpressinInPlaceAction.getExpressionColumnIndex(EditWatchExpressinInPlaceAction.java:78)
	at org.eclipse.debug.internal.ui.actions.expressions.EditWatchExpressinInPlaceAction.run(EditWatchExpressinInPlaceAction.java:62)
	at com.ti.ccstudio.leru.model.ExprEdit.executeOriginal(ExprEdit.java:88)
	at com.ti.ccstudio.leru.model.ExprEdit$MyEditInPlaceAction.run(ExprEdit.java:130)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:119)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100)
	at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1809)
	at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4892)
	at org.eclipse.swt.widgets.Tree.WM_KEYDOWN(Tree.java:6069)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4560)
	at org.eclipse.swt.widgets.Tree.windowProc(Tree.java:5937)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4985)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2530)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)


Reproducible: Always

Steps to Reproduce:
1. Launch debug (cdi or dsf)
2. Open expression view and set it to show without columns
3. Enter a valid expression
4. Press F2 on the expression
Get null pointer exception.
Comment 1 Pawel Piech CLA 2011-07-21 13:39:04 EDT
*** Bug 352783 has been marked as a duplicate of this bug. ***
Comment 2 Pawel Piech CLA 2011-07-21 13:40:41 EDT
Created attachment 200111 [details]
Fix.

This fix gets rid of both exceptions.  We still have the problem in that in DSF, in that F2 does not activate in-line editing, instead it opens a dialog.  I'll file a separate bug for that.
Comment 3 Pawel Piech CLA 2011-07-21 13:42:04 EDT
I'd like to target this for SR1.  Mike, could you review the changes?
Comment 4 Winnie Lai CLA 2011-07-21 14:06:35 EDT
(In reply to comment #2)
> Created attachment 200111 [details]
> Fix.
> This fix gets rid of both exceptions.  We still have the problem in that in
> DSF, in that F2 does not activate in-line editing, instead it opens a dialog. 
> I'll file a separate bug for that.

I would think one possible solution for getting F2 to work is to make 
IDebugVMConstants.COLUMN_ID__EXPRESSION to have value of 
VariableColumnPresentation.COLUMN_VARIABLE_NAME, instead of its own value DsfUIPlugin.PLUGIN_ID + ".COLUMN_ID__EXPRESSION". This allows us to reuse the same code from org.eclipse.debug.ui. This is better than duplicating the same code into dsf debug ui.

You may have other opinions of doing so.
Comment 5 Pawel Piech CLA 2011-07-21 14:48:59 EDT
(In reply to comment #4)
> I would think one possible solution for getting F2 to work is to make 
> IDebugVMConstants.COLUMN_ID__EXPRESSION to have value of 
> VariableColumnPresentation.COLUMN_VARIABLE_NAME, instead of its own value
...

I agree, see bug 352795.  I would like to move COLUMN_VARIABLE_NAME to IDebugUIConstants also, but since we're considering to promote all flex hierarchy API in 3.8 (bug 161435), I think it's be better to wait.
Comment 6 Winnie Lai CLA 2011-07-21 15:49:12 EDT
(In reply to comment #5)
> (In reply to comment #4)
> > I would think one possible solution for getting F2 to work is to make 
> > IDebugVMConstants.COLUMN_ID__EXPRESSION to have value of 
> > VariableColumnPresentation.COLUMN_VARIABLE_NAME, instead of its own value
> ...
> I agree, see bug 352795.  I would like to move COLUMN_VARIABLE_NAME to
> IDebugUIConstants also, but since we're considering to promote all flex
> hierarchy API in 3.8 (bug 161435), I think it's be better to wait.

(In reply to comment #5)
> (In reply to comment #4)
> > I would think one possible solution for getting F2 to work is to make 
> > IDebugVMConstants.COLUMN_ID__EXPRESSION to have value of 
> > VariableColumnPresentation.COLUMN_VARIABLE_NAME, instead of its own value
> ...
> I agree, see bug 352795.  I would like to move COLUMN_VARIABLE_NAME to
> IDebugUIConstants also, but since we're considering to promote all flex
> hierarchy API in 3.8 (bug 161435), I think it's be better to wait.

Great.  Eventually, I think IDebugVMConstants.COLUMN_ID__TYPE and COLUMN_ID__VALUE will map to the corresponding entries in VariableColumnPresentation, if someone adds funtionality for the type and the value columns in the future that we just want to get it without copying the code.
I will ping Patrick to review the patch of 352795.
Comment 7 Michael Rennie CLA 2011-08-08 12:11:36 EDT
The patch looks good.
Comment 8 Michael Rennie CLA 2011-08-08 12:12:22 EDT
Also my +1 for 3.7.1.
Comment 9 Michael Rennie CLA 2011-08-08 15:44:19 EDT
Applied patch to HEAD and 3.7.1