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 7061 - Creating a Java source from template seems to kill any final newline
Summary: Creating a Java source from template seems to kill any final newline
Status: CLOSED FIXED
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Linux
: P4 normal (vote)
Assignee: _ lkramolis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2000-07-14 12:38 UTC by Jesse Glick
Modified: 2005-03-09 04:26 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Suggested patch (untested) (1.09 KB, patch)
2002-06-11 20:52 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2000-07-14 12:38:59 UTC
When you select a Java source template (e.g. Classes/Class) which has a final
newline (which all templates should!) and create from template, the resulting
file no longer has the final newline. This is annoying since text files as a
rule should end with a newline.
Comment 1 Svata Dedic 2000-07-17 07:57:59 UTC
[2008] There was a bug in IndentFileEntry; the final newline was lost during
indentation of the source.
Comment 2 Jesse Glick 2000-10-16 17:18:59 UTC
Also fixing for non-Java files (the original bug was in FileEntry.Format).
Comment 3 Jesse Glick 2002-06-11 20:51:38 UTC
Found it is broken for XML files, will attach patch.
Comment 4 Jesse Glick 2002-06-11 20:52:28 UTC
Created attachment 6216 [details]
Suggested patch (untested)
Comment 5 _ pkuzel 2002-06-12 09:54:45 UTC
It is broken for XML parsed entity template, currently the only
client. Also all user's templates may suffer from it.

It is copy pasted code:

        /*### 
          this code is copied from FileEntry 
          TT EXPECTS that all XML templates are encoded as UTF-8
          FileEntry implementation used just platform default encoding
        ###*/

Integrated.
Comment 6 Martin Schovanek 2002-09-18 14:25:06 UTC
VERIFIED
Comment 7 Quality Engineering 2003-07-02 08:39:47 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.