Bug 102865 - NPE in XReference inplace view
Summary: NPE in XReference inplace view
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 1.2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Helen Beeken CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-06 10:46 EDT by Helen Beeken CLA
Modified: 2005-07-07 06:58 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helen Beeken CLA 2005-07-06 10:46:42 EDT
If you bring up the inplace xref view and then type some text in such that
there's nothing in the view (nothing matches the text), press TAB and then
RETURN, you get the following NPE:

java.lang.NullPointerException
	at
org.eclipse.contribution.xref.internal.ui.actions.DoubleClickAction.run(DoubleClickAction.java:44)
	at
org.eclipse.contribution.xref.internal.ui.inplace.XReferenceInplaceDialog$6.doubleClick(XReferenceInplaceDialog.java:392)
	at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720)
	at
org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
	at org.eclipse.core.runtime.Platform.run(Platform.java:783)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
........

What should happen is nothing (the view shouldn't disappear or anything).
Comment 1 Helen Beeken CLA 2005-07-07 06:58:41 EDT
The fix is to put an extra check in DoubleClickAction.run():

if (sel instanceof TreeObject) {
   ....
}

I've also written a manual test for this.

Fix is in build:

BUILD COMPLETE -  build.446
Date of build: 07/07/2005 10:55:37
Time to build: 47 minutes 21 seconds
Last changed: 07/07/2005 10:40:11