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 116037 - license template: assumption about support for block comments
Summary: license template: assumption about support for block comments
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Milan Kubec
Depends on:
Blocks: 116034
  Show dependency tree
Reported: 2007-09-19 16:41 UTC by Marian Petras
Modified: 2007-09-21 16:58 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

suggested patch (702 bytes, patch)
2007-09-19 16:41 UTC, Marian Petras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Petras 2007-09-19 16:41:13 UTC
The default license template file has format


that is, it requires that FreeMarker variables "licenseFirst" and "licenseLast" are defined.

I believe this format was made with an idea of block comments (in Java, HTML, JSP, etc.) in mind. However, not all
languages and file formats support block comments - for example, .properties files do not support block comments. So
what value should be set to "licenseFirst" and "licenseLast"? Empty string! But that leads to empty lines in place of
${licenseFirst} and ${licenseLast}. I suggest that the license templates are changed such that "licenseFirst" and
"licenseLast" are not required:

   <#if licenseFirst??>
   <#if licenseLast??>

This should be made into NetBeans 6.0 (until people develop their own license files based on the default ones).
Comment 1 Marian Petras 2007-09-19 16:41:55 UTC
Created attachment 49087 [details]
suggested patch
Comment 2 Milan Kubec 2007-09-21 10:45:31 UTC
Makes sense, although I think that licenseFirst and licenseLast can be set to '#' in case of properties files. 

Adding jpokorsky to CC to comment on this - was it meant as a start and end of block comment? Thanks.

If we agree on the fix I will integrate it even when it's set to correct priority, which is IMO P4. Thanks for
Comment 3 Jan Pokorsky 2007-09-21 14:32:28 UTC
Not necessary a block comment but as a header and footer too. The proposed patch makes it even more customizable and it
is compatible. So +1 from me.

Please update also
apisupport/project/src/org/netbeans/modules/apisupport/project/ui/resources/license-cddl-netbeans-sun.txt the same way.
Comment 4 Marian Petras 2007-09-21 14:44:28 UTC
license-cddl-netbeans-sun.txt is already modified (see issue #116035).
Comment 5 Jan Pokorsky 2007-09-21 14:55:58 UTC
Comment 6 Milan Kubec 2007-09-21 16:13:56 UTC
Patch applied. Thanks.

Checking in license-default.txt;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/resources/license-default.txt,v  <--  license-default.txt
new revision: 1.4; previous revision: 1.3
Comment 7 Marian Petras 2007-09-21 16:58:45 UTC