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 218651 - NullPointerException at org.netbeans.modules.javascript2.editor.formatter.FormatTokenStream.getCoveringToken
Summary: NullPointerException at org.netbeans.modules.javascript2.editor.formatter.For...
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
: 219420 219591 219631 219902 220067 220651 222007 222266 223211 224167 227927 229941 234798 248027 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-20 06:59 UTC by Martin Fousek
Modified: 2014-11-07 09:10 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 192411


Attachments
stacktrace (5.12 KB, text/plain)
2012-09-20 06:59 UTC, Martin Fousek
Details
stacktrace (2.62 KB, text/plain)
2012-09-21 19:05 UTC, bingalls
Details
stacktrace (2.62 KB, text/plain)
2012-09-28 17:17 UTC, mago_ebon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fousek 2012-09-20 06:59:43 UTC
Build: NetBeans IDE Dev (Build 20120920-47773ac111ae)
VM: Java HotSpot(TM) 64-Bit Server VM, 19.0-b09, Java(TM) SE Runtime Environment, 1.6.0_23-b05
OS: Linux

User Comments:
marfous: 1, have this source in .html file
<script>
    
    alert(arguments);
</script>
2, in the empty line write "fun"
3, press TAB to apply code template
-> NPE

bingalls: Tried to auto-format inline javascript

rozwell: autoformatting html file with some issues




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.javascript2.editor.formatter.FormatTokenStream.getCoveringToken(FormatTokenStream.java:250)
   at org.netbeans.modules.javascript2.editor.formatter.FormatContext.getEmbeddingIndent(FormatContext.java:278)
   at org.netbeans.modules.javascript2.editor.formatter.JsFormatter$1.run(JsFormatter.java:224)
   at org.netbeans.editor.GuardedDocument.runAtomic(GuardedDocument.java:317)
   at org.netbeans.modules.javascript2.editor.formatter.JsFormatter.reformat(JsFormatter.java:118)
   at org.netbeans.modules.csl.core.GsfReformatTask$1.run(GsfReformatTask.java:105)
Comment 1 Martin Fousek 2012-09-20 06:59:45 UTC
Created attachment 124613 [details]
stacktrace
Comment 2 Martin Fousek 2012-09-20 09:43:12 UTC
Reassign to phejl.
Comment 3 Petr Hejl 2012-09-20 11:00:27 UTC
Fixed in web-main 6fb17a2b7902.
Comment 4 Quality Engineering 2012-09-21 02:24:05 UTC
Integrated into 'main-golden', will be available in build *201209210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6fb17a2b7902
User: Petr Hejl <phejl@netbeans.org>
Log: #218651 - NullPointerException at org.netbeans.modules.javascript2.editor.formatter.FormatTokenStream.getCoveringToken
Comment 5 bingalls 2012-09-21 19:05:18 UTC
Created attachment 124734 [details]
stacktrace

formatting js at the bottom of html
Comment 6 mago_ebon 2012-09-28 17:17:14 UTC
Created attachment 125074 [details]
stacktrace

I was formatting a segment of a html page with <Shift>+<Alt>+F. First I had a javascript error and thougth it was the reason, but then fixed the error and saved the file and it kept on happening.
Comment 7 Petr Hejl 2012-10-03 08:39:16 UTC
*** Bug 219420 has been marked as a duplicate of this bug. ***
Comment 8 Petr Hejl 2012-10-05 12:28:30 UTC
*** Bug 219591 has been marked as a duplicate of this bug. ***
Comment 9 Petr Hejl 2012-10-06 19:48:00 UTC
*** Bug 219631 has been marked as a duplicate of this bug. ***
Comment 10 Petr Hejl 2012-10-11 13:43:44 UTC
*** Bug 219902 has been marked as a duplicate of this bug. ***
Comment 11 Petr Hejl 2012-10-15 09:23:44 UTC
*** Bug 220067 has been marked as a duplicate of this bug. ***
Comment 12 Petr Hejl 2012-10-29 16:19:53 UTC
*** Bug 220651 has been marked as a duplicate of this bug. ***
Comment 13 markuszeller 2012-11-07 16:35:16 UTC
This happened at my workstations on formatting HTML Source.

After LONG investigation I found out, that there were non closing tags who caused the crashes.

Which are:
<input .... > and <br>

chaning that to:
<input .... /> and <br />

makes the source formatter happy.
Comment 14 Petr Hejl 2012-11-13 09:30:26 UTC
*** Bug 222007 has been marked as a duplicate of this bug. ***
Comment 15 Petr Hejl 2012-11-16 14:41:45 UTC
*** Bug 222266 has been marked as a duplicate of this bug. ***
Comment 16 Petr Hejl 2012-12-04 09:51:43 UTC
*** Bug 223211 has been marked as a duplicate of this bug. ***
Comment 17 Petr Hejl 2013-01-08 13:18:01 UTC
*** Bug 224167 has been marked as a duplicate of this bug. ***
Comment 18 Petr Hejl 2013-03-26 09:53:49 UTC
*** Bug 227927 has been marked as a duplicate of this bug. ***
Comment 19 Petr Hejl 2013-06-25 13:58:34 UTC
*** Bug 229941 has been marked as a duplicate of this bug. ***
Comment 20 Petr Hejl 2013-08-22 21:57:22 UTC
*** Bug 234798 has been marked as a duplicate of this bug. ***
Comment 21 Petr Pisl 2014-11-07 09:10:33 UTC
*** Bug 248027 has been marked as a duplicate of this bug. ***