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 191244 - New "C Source File" contains 1 empty line (in studio-ide.tar.bz2 build from elif only)
Summary: New "C Source File" contains 1 empty line (in studio-ide.tar.bz2 build from e...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.0
Hardware: PC All
: P2 normal (vote)
Assignee: Alexander Simon
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2010-10-22 09:17 UTC by soldatov
Modified: 2010-10-27 11:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2010-10-22 09:17:45 UTC
On elif cnd.editor.TestIndentation.testIndentationC and cnd.editor.TestIndentation.testIndentationCSwitch tests fails for 14 and 16 days.

Scenario in order to reproduce this problem:
- Downloads studio-ide.tar.bz2 build from elif
- Create project
- Create "C Source File"
==> file contains 1 empty line only

In NetBeans this file contains 2 empty lines. Also new "C++ Source File" file contains 2 empty lines (in NetBeans and studio-ide).
Comment 1 Thomas Preisler 2010-10-26 20:55:46 UTC
New file wizard is not part of projects. It''s in CND core.
Comment 2 Vladimir Voskresensky 2010-10-27 08:54:57 UTC
Sasha, please, have a look
Comment 3 Alexander Simon 2010-10-27 10:23:28 UTC
The com.sun.tools.odb.PcCreateFromTemplateHandler catch createFromTemplate for .c file.
Comment 4 Alexander Simon 2010-10-27 10:33:16 UTC
com.sun.tools.odb.PcCreateFromTemplateHandler accept a MIMENames.C_MIME_TYPE.
It is wrong.
Solutions:
- use another acceptor (another extension).
- or inherit formatter from org.netbeans.modules.cnd.source.SourceAbstractDataLoader.CndFormat
Comment 5 Alexander Simon 2010-10-27 10:50:00 UTC
My proposal:
change method: protected boolean accept(FileObject orig):
return MIMENames.C_MIME_TYPE.equals(orig.getMIMEType());
->
return MIMENames.C_MIME_TYPE.equals(orig.getMIMEType()) && "pc".equals(orig.getExt());
Comment 6 Alexander Simon 2010-10-27 11:00:07 UTC
Egor approved fix.
fixed in private repository, change set:
1421:a95da3cb29cb