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 58236 - New files are created with unix newlines
Summary: New files are created with unix newlines
Status: RESOLVED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
: 12010 37669 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-22 16:19 UTC by Maros Sandor
Modified: 2008-12-22 22:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Generated Main class (622 bytes, text/plain)
2005-04-27 09:59 UTC, Maros Sandor
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maros Sandor 2005-04-22 16:19:15 UTC
New files created from templates are created having unix \n newline separators.
Comment 1 Roman Strobl 2005-04-26 15:18:04 UTC
Yes, they are. Why do you think it's wrong? It's not a P2 IMO - downgrading to P3.
Comment 2 Maros Sandor 2005-04-26 15:58:35 UTC
If a new file is created on a system, it MUST contain correct, system-dependent
line separators. I don't understand your question: it is obviously wrong to
separate lines with \n on Windows just as it is wrong to separate lines with
\r\n on unix. Why would we let Netbeans look so amateur in this easy-to-fix aspect?
Comment 3 _ rkubacki 2005-04-26 17:54:47 UTC
What files - all, Java, text, other? Part can be in loaders where template
instantiating is done. Modules that have special handling may need to fix it in
their own code.
Comment 4 Maros Sandor 2005-04-27 08:13:18 UTC
Bug affects at least all Java templates. I created an ANT file and it was OK.
Owners of templates should each check their own ones.
Comment 5 Jaroslav Tulach 2005-04-27 09:45:42 UTC
msandor, where is your logic? When you say "Bug affects at least all Java, ANT 
file was OK" why you believe there is a bug in datasystems? 
Comment 6 Maros Sandor 2005-04-27 09:54:32 UTC
I do not know where the bug is, that's why I filed this issue against "ide" module.
Comment 7 Martin Matula 2005-04-27 09:55:21 UTC
Do all the lines in the newly generated file contain unix EOLs, or just some of
them? Could you please attach such file?
Comment 8 Maros Sandor 2005-04-27 09:59:13 UTC
Created attachment 21888 [details]
Generated Main class
Comment 9 Maros Sandor 2005-04-27 10:01:11 UTC
As I said, I observed this bug only with Java files.
Comment 10 Tomas Hurka 2005-04-27 17:09:56 UTC
That is because you have build NetBeans on Windows platform so your templates already have CR/LF. 
Try official build which is build on Solaris.
Comment 11 Maros Sandor 2005-04-27 18:51:54 UTC
Both official RC1 and custom 4.2dev build contain the bug ... and new files do
NOT have CR/LF, that is the problem.
Comment 12 Martin Matula 2005-05-04 13:30:35 UTC
Tomas' comment was related to why with ant it works and with java it does not.
There are two problems - java replaces CRLF from templates by LF even if the
templates are correct. This problem is specific to java dataobject.
The second problem is that generally when NB were built on Linux, templates do
not contain CRLF (they contain LF instead) and this is not corrected when a new
file from template is created - you did not experience this second problem
probably because you built NB on Windows. This may be a problem in case of zip
installation of NetBeans. This needs to be fixed in core.
After discussion with Jarda we came up with the following plan. We will fix the
first problem and then reassign this to him to fix the second problem.
Comment 13 Tomas Hurka 2005-08-19 14:58:10 UTC
*** Issue 37669 has been marked as a duplicate of this issue. ***
Comment 14 Tomas Hurka 2005-09-16 12:45:44 UTC
This bug is now fixed for Java files.
Checking in org/netbeans/modules/java/IndentFileEntry.java;
/cvs/java/src/org/netbeans/modules/java/IndentFileEntry.java,v  <--  IndentFileEntry.java
new revision: 1.13; previous revision: 1.12
done

Assingning to openide to fix the problem for non java files.
Comment 15 Jaroslav Tulach 2005-09-17 08:56:56 UTC
There are no templates in openide to fix. 
Comment 16 Jan Becicka 2005-10-12 14:24:45 UTC
*** Issue 12010 has been marked as a duplicate of this issue. ***