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 257245 - Formatting and template exception in editor : NullPointerException at java.lang.String.contentEquals
Summary: Formatting and template exception in editor : NullPointerException at java.la...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 10 x64
: P1 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 256517 258335 269505 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-21 14:47 UTC by dathyrius
Modified: 2017-02-07 15:55 UTC (History)
13 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 220555


Attachments
stacktrace (6.29 KB, text/plain)
2015-12-21 14:47 UTC, dathyrius
Details
Editor custom configuration (3.02 KB, application/xml)
2016-01-11 13:16 UTC, alainvitry
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dathyrius 2015-12-21 14:47:19 UTC
Build: NetBeans IDE 8.1 (Build 201510222201)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.66-b17, Java(TM) SE Runtime Environment, 1.8.0_66-b17
OS: Mac OS X

User Comments:
GUEST: run formater

GUEST: error

GUEST: .

GUEST: Tried to reformat the code with CTRL+ALT+F. The file is just opened in the editor.

GUEST: ccode complition just fails. When I click  enter, the completion selected disappears.

GUEST: Reformat use ctrl alt f

dathyrius: Formatting Code recursive on a directory

GUEST: editing an output statement where i wanted to show the actual name of an enum literal... had it a little dorked up before it was corrected.

GUEST: Saving to reformat

GUEST: Editing code in the netbeans editor.

GUEST: <Please provide a description of the problem or the steps to reproduce>

GUEST: I can't desribe the problem. Reason: don't know the origin.




Stacktrace: 
java.lang.NullPointerException
   at java.lang.String.contentEquals(String.java:1066)
   at org.netbeans.modules.java.source.save.Reformatter$Pretty.blankLines(Reformatter.java:3532)
   at org.netbeans.modules.java.source.save.Reformatter$Pretty.newline(Reformatter.java:3280)
   at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:1556)
   at org.netbeans.modules.java.source.save.Reformatter$Pretty.visitBlock(Reformatter.java:406)
   at com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:924)
Comment 1 dathyrius 2015-12-21 14:47:23 UTC
Created attachment 157880 [details]
stacktrace
Comment 2 alainvitry 2016-01-11 13:15:45 UTC
Here are my editor preferences. I am not sure it all boils down to formatting/editor, but this was the only change I made.
Comment 3 alainvitry 2016-01-11 13:16:52 UTC
Created attachment 158085 [details]
Editor custom configuration
Comment 4 alainvitry 2016-01-11 13:21:24 UTC
Removing custom preferences did not fix the issue. The bug prevents code formatting and macro expansion (fori -> for(int i....). 
Code sense works as expected
Comment 5 Exceptions Reporter 2016-02-12 21:40:49 UTC
This bug already has 50 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=220555
Comment 6 Dusan Balek 2016-03-14 11:30:56 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/c9b93f2511c1
Comment 7 Quality Engineering 2016-03-15 04:56:34 UTC
Integrated into 'main-silver', will be available in build *201603150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c9b93f2511c1
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #257245 - Formatting and template exception in editor : NullPointerException at java.lang.String.contentEquals - fixed.
Comment 8 Jiri Prox 2016-03-23 15:50:40 UTC
*** Bug 258335 has been marked as a duplicate of this bug. ***
Comment 9 Dusan Balek 2016-05-20 15:36:17 UTC
*** Bug 256517 has been marked as a duplicate of this bug. ***
Comment 10 Milutin Kristofic 2017-02-07 15:55:14 UTC
*** Bug 269505 has been marked as a duplicate of this bug. ***