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 163534 - [67cat] Renaming License templates doesn't rename the actual file
Summary: [67cat] Renaming License templates doesn't rename the actual file
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Templates (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
: 161878 178346 183647 188170 195241 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-23 22:56 UTC by big_al
Modified: 2011-02-11 10:30 UTC (History)
5 users (show)

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 big_al 2009-04-23 22:56:36 UTC
[ JDK VERSION : 1.6.* ]

License templates are not being recognised if they are renamed from
the templates section:


1. Got a Maven project where the license is specified as follows:

<properties>
    <netbeans.hint.license>gpl3</netbeans.hint.license>
</properties>

2. I add a license file called license-abc.txt into the license
template group

3. From the template manager I select the license file and rename it
to license-gpl3.txt

4. When I created Java files I get an error text in the top of the
file:

Error reading included file
Templates/J2EE/EJB30/../../Licenses/license-gpl3.txt

Looking into USERDIR/config/Templates/Licenses  the file was not
renamed from license-abc.txt to license-gpl3.txt, even though that is
what is appearing in the template manager.
Comment 1 Jiri Rechtacek 2009-04-30 15:22:15 UTC
*** Issue 161878 has been marked as a duplicate of this issue. ***
Comment 2 Jiri Rechtacek 2009-04-30 15:26:04 UTC
It's intentional behavior. Rename of template means just changing a display name of template instead of renaming a
primary file, since fix of issue 152973.
Comment 3 big_al 2009-05-01 23:18:39 UTC
Thanks for clearing that up. However, I don't think it makes sense at all to rename templates without the templates actually being renamed. What's the 
purpose of renaming the display name of a template?
Comment 4 aaronkaplan 2010-04-07 15:21:27 UTC
*** Bug 183647 has been marked as a duplicate of this bug. ***
Comment 5 aaronkaplan 2010-04-07 15:51:58 UTC
Comment #2 says that the license template retaining its original name is intended behavior.  Fine, but there's still a bug, even if you don't like the proposed solution.  The bug is that if you want to configure a custom license to be included in your file templates, you have to know the license template's file name, not its display name, and there's no way to know the file name via the template manager.  The only way to find the file name is to peek into ~/.netbeans/6.8/config/Templates/Licenses/ .  Furthermore, that name will typically be misleading: when you create a new template by copying an existing one, the new file name will be the original file name with a couple of extra characters appended.  For example, you could end up with the BSD license in a file named license-gpl30_1.txt.
Comment 6 Jesse Glick 2010-08-02 23:42:08 UTC
*** Bug 178346 has been marked as a duplicate of this bug. ***
Comment 7 Jesse Glick 2010-08-02 23:42:15 UTC
*** Bug 188170 has been marked as a duplicate of this bug. ***
Comment 8 Jesse Glick 2010-08-02 23:43:19 UTC
Must be fixed.
Comment 9 Martin Entlicher 2010-10-07 09:56:56 UTC
After discussion with Jiri, it looks like it's necessary to distinguish rename of file name and rename of the display name. The display name is the string under which the template is displayed in the New File dialog, therefore it has sense to rename that display name.
The file creation process operates with the file name, therefore it has a sense to be able to rename that as well.
Comment 10 Martin Entlicher 2010-10-12 15:53:15 UTC
Fixed by changeset:   179342:c50b3b53f3db
Both file name and display name can be renamed.
File name can be renamed only when it's not defined by a module layer (not used by any module).
Comment 11 Quality Engineering 2010-10-13 02:53:09 UTC
Integrated into 'main-golden', will be available in build *201010130000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/c50b3b53f3db
User: mentlicher@netbeans.org
Log: #163534 Allow to transparently rename the template display name and file name. The template file name can be renamed only if the template is not defined by a module layer.
Comment 12 Martin Entlicher 2011-02-11 10:30:22 UTC
*** Bug 195241 has been marked as a duplicate of this bug. ***