Bug 280932 - [exceptions] NullPointerException on autocomplete in js
Summary: [exceptions] NullPointerException on autocomplete in js
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.0.5   Edit
Hardware: PC Linux
: P3 normal with 2 votes (vote)
Target Milestone: 3.2 M3   Edit
Assignee: Chris Jaun CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: needinfo
: 275432 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-19 11:58 EDT by Moataz Elmasry CLA
Modified: 2010-03-03 11:14 EST (History)
2 users (show)

See Also:


Attachments
project with npe on autocomplete (2.03 KB, application/x-gzip)
2009-06-19 11:59 EDT, Moataz Elmasry CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Moataz Elmasry CLA 2009-06-19 11:58:38 EDT
I get a NPE when trying to autocmplete javascript in a html document. 
I noticed later that the project where this happened was a java project not a dynamic web project. So I created a new web project and it all worked fine. But to my knowldge I should be able to write web files(js, html, etc..) inside java projects. 

Attached is a small sample project where I get the NPE as well as the stack trace from .metadata/.log

Thanks in advance.
Comment 1 Moataz Elmasry CLA 2009-06-19 11:59:43 EDT
Created attachment 139647 [details]
project with npe on autocomplete
Comment 2 Chris Jaun CLA 2009-06-19 15:48:47 EDT
Thanks for opening the bug Moataz. I will look into this soon.

Comment 3 Chris Jaun CLA 2009-06-24 14:07:59 EDT
Hi Moataz,

I'm having a hard time reproducing this problem.

Can you provide me step-by-step instructions on how you created your project and html file and what you did to invoke content assist?

In the attachment you provided I don't see the JavaScript nature or any of the JSDT library files included, so its not clear to me how the JSDT code was even invoked.

Thanks,
Chris

Comment 4 Moataz Elmasry CLA 2009-06-25 03:49:29 EDT
Hello Chris

I created a java project, then a folder inside the project, then a html file in the folder. Then I added <script type="text/javascript"></script> into the <body> then I tried docu then autocomplete, then bang null pointer exception. 

Does it actually matter that I'm on linux not on windows?. I recall while using windows last year I had no similar problem while autocompleting in html files inside projects of java nature. 
about invoking JSDT, isn't it not so, that jsdt is invoked when I write javascript code inside html files?

In the attched project zip, you can find the stack trace I pulled out from eclipse .log. 

Best regards
Moataz
Comment 5 Chris Jaun CLA 2009-09-15 13:28:32 EDT
Categorizing JSDT bugzillas for planning purposes.
Comment 6 Chris Jaun CLA 2009-10-21 09:29:35 EDT
Fixed the NPE, however, content assist will still not work in a Java Project unless you enable JavaScript support.

1. Right-click on the project
2. Configure > Add JavaScript Support

Code checked into the 3.2 stream.
Comment 7 Chris Jaun CLA 2009-10-21 10:15:15 EDT
*** Bug 275432 has been marked as a duplicate of this bug. ***