Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311999

Summary: NPE when setting a function breakpoint
Product: [WebTools] JSDT Reporter: Simon Kaegi <simon_kaegi>
Component: DebugAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact: Simon Kaegi <simon_kaegi>
Severity: normal    
Priority: P3 CC: Michael_Rennie, thatnitind
Version: 3.2Flags: Michael_Rennie: review+
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed patch none

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