Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361944 - NullPointerException when "Requesting JavaScript AST from selection"
Summary: NullPointerException when "Requesting JavaScript AST from selection"
Status: CLOSED DUPLICATE of bug 342461
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-25 11:35 EDT by Marshall Scorcio CLA
Modified: 2012-02-02 15:48 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marshall Scorcio CLA 2011-10-25 11:35:21 EDT
I recently upgraded to Eclipse 3.7.1, JSDT 1.3.1.v201108102009, and Eclipse WDT 3.3.1.v201107072200. After the upgrade I've been getting "'Requesting JavaScript AST from selection' has encountered a problem" dialogs when editing JavaScript files. 

I am able to consistently reproduce a specific case where clicking on "return" in a function that returns a string literal will cause a NullPointerException. It seems to only happen the first time you click on "return" after opening the file.

Steps to Reproduce:
1. In a JavaScript project, create a file named foo.js with the following contents:
function foo() {
  return "bar";
}

2. Open up foo.js with the JavaScript editor.

3. Click on the keyword "return".

Actual Result:
A dialog appears with the title "Problem Occurred" is displayed that says:
An internal error occurred during: "Requesting JavaScript AST from selection".
java.lang.NullPointerException

Expected Result:
No error should occur.
Comment 1 Nitin Dahyabhai CLA 2012-02-02 15:48:37 EST

*** This bug has been marked as a duplicate of bug 342461 ***