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.
Summary: | License Changer doesn't recognize project.displayName template variable | ||
---|---|---|---|
Product: | contrib | Reporter: | err <err> |
Component: | License Changer | Assignee: | nhoffmann |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | tboudreau |
Priority: | P2 | ||
Version: | 7.4 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
err
2013-12-17 23:10:37 UTC
Thank you for spotting this. The next version of the LicenseChanger will support the ${project.name} and ${project.displayName} variables for interpolation. However, ${name}, ${nameAndExt},${encoding}, ${time} and ${date} will not be included since their use in license headers is questionable. These should better be included in a custom file template. The LicenseChanger will respect existing comments and class-level javadoc and inserts the license header before those. (In reply to nhoffmann from comment #1) > However, ${name}, ${nameAndExt},${encoding}, ${time} and ${date} will not be > included since their use in license headers is questionable. I understand all of these except ${date}. It looks like all of the license headers have Copyright (C) ${date?date?string("yyyy")} and the lines usually contain ${licensePrefix} and some variant of ${user}. How would license changer handle this, if ${date} is not interpolated? (I can see how you wouldn't want to change the date, just because you change the license, but...) Some license headers have ${project.organization!user} as part of the Copyright line. I just checked FreeMarker site and found out what "!" does. I don't see project.organization in the template variable FAQ. Is it, or should it, be handled? In licensechanger source I see Project and getOrganization. I couldn't find any FreeMarker stuff, but I just saw javax.script (which I didn't know about). I can see it would take a while to dig through this... (In reply to err from comment #2) > (In reply to nhoffmann from comment #1) > > However, ${name}, ${nameAndExt},${encoding}, ${time} and ${date} will not be > > included since their use in license headers is questionable. On second thoughts, I will include those in the next version. I agree that users would expect the default variables to be available in License Changer as well. 'name', 'nameAndExt', and 'encoding' will be set individually for each processed file. Date and Time will be set to the same initial date for all changed files and will be date objects, so you will be able to format them with the 'string(...)' directive from freemarker: http://freemarker.org/docs/ref_builtins_date.html > > I understand all of these except ${date}. It looks like all of the license > headers have > > Copyright (C) ${date?date?string("yyyy")} > > and the lines usually contain ${licensePrefix} and some variant of ${user}. > How would license changer handle this, if ${date} is not interpolated? (I > can see how you wouldn't want to change the date, just because you change > the license, but...) > > Some license headers have > ${project.organization!user} > as part of the Copyright line. I just checked FreeMarker site and found out > what "!" does. I don't see project.organization in the template variable > FAQ. Is it, or should it, be handled? This property is set via the Copyright Holder dialog on the first panel of the wizard. You can add simply add it to your user.properties in case your project's copyright is not held by an individual. Fixed in changeset http://hg.netbeans.org/main/contrib/rev/5e27d570de18. I'm wondering if you intended to change the 'number of spaces per indent' from 4 to 8 when you made these changes? Or maybe it was some other setting about indent? This change and the one for Bug 239631 have this issue. Anyway, just to bring it to your attention. |