Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322860 - NPE after failed lookup request
Summary: NPE after failed lookup request
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.3 M2   Edit
Assignee: Michael Rennie CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-16 23:00 EDT by Michael Rennie CLA
Modified: 2010-08-26 14:10 EDT (History)
1 user (show)

See Also:


Attachments
fix (2.54 KB, patch)
2010-08-26 14:09 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2010-08-16 23:00:34 EDT
code from HEAD

If a lookup request fails, we get this pleasant NPE:

java.lang.NullPointerException
at org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.StackFrameImpl.initializeVariables(StackFrameImpl.java:200)
at org.eclipse.wst.jsdt.debug.internal.rhino.jsdi.StackFrameImpl.variables(StackFrameImpl.java:182)
at org.eclipse.wst.jsdt.debug.internal.core.model.JavaScriptStackFrame.getVariables(JavaScriptStackFrame.java:140)
at org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider.getAllChildren(StackFrameContentProvider.java:51)
at org.eclipse.debug.internal.ui.model.elements.StackFrameContentProvider.getChildCount(StackFrameContentProvider.java:28)
at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.retrieveChildCount(ElementContentProvider.java:114)
at org.eclipse.debug.internal.ui.model.elements.ElementContentProvider$2.run(ElementContentProvider.java:63)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

We should be asking the response for its success and doing the right thing when it fails.
Comment 1 Michael Rennie CLA 2010-08-26 14:09:34 EDT
Created attachment 177553 [details]
fix

The patch checks the response status, and does nothing if not successful. It no longer returns null from the variables() call (obeying the API contract) and does not initialize the variables cache when a failure happens - which allows it to try again to get the variables.
Comment 2 Michael Rennie CLA 2010-08-26 14:10:09 EDT
applied to HEAD