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.
Currently, there are templates which look something like this: <#assign licenseFirst = "/*"> <#assign licensePrefix = " * "> <#assign licenseLast = " */"> <#include "${project.licensePath}"> <#if package?? && package != ""> package ${package}; ... The problem with this approach is that there's no way *not* to skip a line after the license text. For example, I've created a blank license file called "license-none.txt" which I want to use when no license is required. The resulting file has a blank line at the top, before the "package" statement. Depending on how you look at it, there are two ways of fixing this. You could consider it a bug that the formatter doesn't remove the blank line and fix it there, or tweak the templates so they look like this and add a blank line in the license files: <#assign licenseFirst = "/*"> <#assign licensePrefix = " * "> <#assign licenseLast = " */"> <#include "${project.licensePath}"> <#if package?? && package != ""> package ${package}; ... Of course, if there's a better way I'm not aware of to specify no license, please let me know. :)
That is, the resulting *class* has a blank line at the top.
Ah! the blank line is caused by the new "Maximum Blank Lines" options in the formatter. It also causes blank lines to be inserted after javadoc comments and other inappropriate places. These options should probably be overridden to 0 when formatting templates, (which will make people who want extra blank lines in their templates unhappy), or the templates need to be tweaked to be smarter about blank lines and not rely on the formatter to make them come out right.
Fixed in jet-main. http://hg.netbeans.org/jet-main/rev/92fe1ec87f59
Integrated into 'main-golden', will be available in build *201305131004* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/92fe1ec87f59 User: Dusan Balek <dbalek@netbeans.org> Log: Issue #229042: templates should not "hard wire" a blank line after license text - fixed.
yup