Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311999 - NPE when setting a function breakpoint
Summary: NPE when setting a function breakpoint
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Simon Kaegi CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 00:11 EDT by Simon Kaegi CLA
Modified: 2010-05-07 11:55 EDT (History)
2 users (show)

See Also:
Michael_Rennie: review+


Attachments
proposed patch (1.01 KB, patch)
2010-05-07 00:13 EDT, Simon Kaegi CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Kaegi CLA 2010-05-07 00:11:35 EDT
I'm getting an NPE when setting a breakpoint on a function with no name. e.g. something like:

AssertTestCase.prototype.testAssertFalse = function() {
	assertFalse(false);
	assertFalse("test", false);
	assertFalse(true, false);
};

The problem is on line 494 of BreakpointLocationFinder
 this.functionName = node.getName().getIdentifier();

we should instead do something like:
this.functionName = node.getName() == null ? null : node.getName().getIdentifier();
Comment 1 Simon Kaegi CLA 2010-05-07 00:13:34 EDT
Created attachment 167430 [details]
proposed patch
Comment 2 Michael Rennie CLA 2010-05-07 11:55:35 EDT
+1 looks good

Applied patch to HEAD