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 78967 - NPE when switching to HTML indentaion engine for java file
Summary: NPE when switching to HTML indentaion engine for java file
Status: VERIFIED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Document Model (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Tomasz Slota
URL:
Keywords:
: 79067 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-06-23 12:49 UTC by Max Sauer
Modified: 2007-09-25 01:31 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
NPE stack trace (2.23 KB, text/plain)
2006-06-23 13:07 UTC, Max Sauer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max Sauer 2006-06-23 12:49:24 UTC
I'm getting following NPE upon each reformat code usage, when HTML indentation
engine is selected for java file type:

java.lang.NullPointerException
	at
org.netbeans.modules.editor.structure.formatting.TagBasedFormatter.reformat(TagBasedFormatter.java:66)
	at org.netbeans.editor.ext.ExtFormatter.reformat(ExtFormatter.java:274)
	at
org.netbeans.editor.ActionFactory$FormatAction.actionPerformed(ActionFactory.java:1030)
...
(whole stack trace attached)

Steps to reproduce:
-------------------
1) Open a j2se project and a java file from it
2) Invoke Tools|options|Advanced options|Editing|Editor Settings|JavaEditor
3) Choose HTML indent. en. as Indentation engine
4) Close OD
5) Right-click inside source and invoke "reformat code"

----------
Product Version         = NetBeans 5.5 Dev (Build 200606230200)
Operating System        = SunOS version 5.10 running on sparc
Java; VM; Vendor; Home  = Java HotSpot(TM) Client VM 1.6.0-rc-b88
System Locale; Encoding = en (nb); ISO646-US
Comment 1 Max Sauer 2006-06-23 13:07:29 UTC
Created attachment 31335 [details]
NPE stack trace
Comment 2 Miloslav Metelka 2006-06-26 13:12:19 UTC
Reassigning to xml for evaluation.
Comment 3 Marek Fukala 2006-06-26 14:11:18 UTC
Easy fix, Tomasz is the owner now... BTW, it would be nice to have the IEs
parametrized so noone would be able to use HTML IE for java...
Comment 4 Tomasz Slota 2006-06-27 09:22:22 UTC
Fixed. Logging a warning for using incompatible indentation engine instead of
throwing exception.
Comment 5 Max Sauer 2006-06-28 09:11:58 UTC
Verified. Please attach CVS commit trace next time, thx.

-------
Product Version         = NetBeans 5.5 Dev (Build 200606280200)
Operating System        = SunOS version 5.10 running on sparc
Java; VM; Vendor; Home  = 1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b89; Sun
Microsystems Inc.; /usr/jdk1.6.0/jre
System Locale; Encoding = en (nb); ISO646-US
Comment 6 Tomasz Slota 2006-06-29 09:49:54 UTC
*** Issue 79067 has been marked as a duplicate of this issue. ***