This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 231633 - "Action items" window shows NullPointerException in HTML files
Summary: "Action items" window shows NullPointerException in HTML files
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-21 13:29 UTC by jo.navy
Modified: 2013-06-25 02:43 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
One of the HTML files causing the problem (17.27 KB, text/html)
2013-06-21 13:29 UTC, jo.navy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jo.navy 2013-06-21 13:29:06 UTC
Created attachment 136143 [details]
One of the HTML files causing the problem

I have added to my web project several HTML files generated by oXygen Developer (they are the xhtml documentation of some XSD file) and Netbeans reports several strange errors in them, including NullPointerException.

I have tried to disable HTML validator in Tools/Options/Editor/Hints but nothing changed.

Now in the Projects tree I have a lot of files marked with a red icon without any apparent reason and this is very annoying because it could hide real errors.
Comment 1 Vladimir Riha 2013-06-23 20:38:14 UTC
Reproducible, the error icon on your file is caused by JavaScript ( I think the closing --> is causing it) so reassigning to JS.  I'm not sure about the null pointer error though, no idea where it comes from


It could be a bit similar to issue 229637


Product Version: NetBeans IDE Dev (Build web-main-10878-on-20130622)
Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b15
System: Linux version 3.2.0-45-generic-pae running on i386; UTF-8; en_US (nb)
Comment 2 jo.navy 2013-06-24 06:35:09 UTC
I've tried to upgrade from v7.3 to v7.3.1 and the problem is still there, so I updated my bug report to the most recent version.
Comment 3 Vladimir Riha 2013-06-24 06:39:37 UTC
Reporter, according to [1] The comment marks should be preceded by JS comment marks, which in my case helped. Can you please try it?


<script type="text/javascript">
   //<!--
   window.alert("Hello World!");
   //-->
 </script> 



[1] https://developer.mozilla.org/en/docs/Writing_JavaScript_for_XHTML
Comment 4 jo.navy 2013-06-24 09:09:13 UTC
Yes, adding JS comment marks solves the problem, thank you!
I had to manually modify 29 machine-generated files but this is an acceptable workaround for now.

I noted that the IDE became progressively slow while I was editing those files, so I decided to restart it after 20 files.

I will report this defect to Oxygen too, hovewer I hope that this kind of JS will be handled better by next versions of Netbeans.

Thank you, anyway.
Comment 5 Vladimir Riha 2013-06-24 09:19:55 UTC
You're welcome. I'm not sure if this is bug on NetBeans side, according to the link above, this is the correct way for XHTML files to use <!-- --> and since your sources were missing it, they were marked as incorrect. But I might be wrong.

If you agree, I'd lower this issue to P3 as the NullPointerException appears only with 'incorrect' JavaScript syntax.
Comment 6 jo.navy 2013-06-24 10:17:32 UTC
OK for lowering priority, however I think that some fix is needed: those NullPointerExceptions in "Action items" seem Netbeans internal errors that popped up that way.  Also the slow-down of the IDE when editing those files suggests that something is going wrong.

A collegue of mine that added the files to the webapp uses an older version of Netbeans (I'll ask him the version number ASAP) and he didn't get any error in "Action items".
Comment 7 Vladimir Riha 2013-06-24 10:37:08 UTC
Please, take some profiling snapshot (see [1]) when this slowdown occurs and file a new bug with this snapshot attached. 


[1] http://wiki.netbeans.org/FaqProfileMeNow
Comment 8 Petr Pisl 2013-06-24 11:46:25 UTC
Should be fixed in web-main:
http://hg.netbeans.org/web-main/rev/4eb03444b2b4
Comment 9 Quality Engineering 2013-06-25 02:43:55 UTC
Integrated into 'main-golden', will be available in build *201306242301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4eb03444b2b4
User: Petr Pisl <ppisl@netbeans.org>
Log: #231633 - "Action items" window shows NullPointerException in HTML files