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 233352 - License Templates Add does not support arbitrarily named files
Summary: License Templates Add does not support arbitrarily named files
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Templates (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-24 22:35 UTC by jyeary
Modified: 2013-08-23 02:37 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (138.37 KB, text/plain)
2013-07-24 22:35 UTC, jyeary
Details
BSD 3 Clause License (2.06 KB, text/plain)
2013-07-24 22:38 UTC, jyeary
Details
BSD 3 Clause License (Working) (2.08 KB, text/plain)
2013-07-24 22:39 UTC, jyeary
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jyeary 2013-07-24 22:35:54 UTC
If you attempt to import a file called anything other than license-xxxx.txt such as BSD-3-Clause-License.txt the file will import, but will not work in the projects. It will produce an error.


Product Version = NetBeans IDE 7.4 Beta (Build 201307092200)
Operating System = Mac OS X version 10.8.4 running on x86_64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Comment 1 jyeary 2013-07-24 22:35:56 UTC
Created attachment 137740 [details]
IDE log
Comment 2 jyeary 2013-07-24 22:38:50 UTC
Created attachment 137741 [details]
BSD 3 Clause License

This is the license that fails.
Comment 3 jyeary 2013-07-24 22:39:29 UTC
Created attachment 137742 [details]
BSD 3 Clause License (Working)

This license will work if imported.
Comment 4 Martin Entlicher 2013-08-14 14:14:15 UTC
Reproduced.
It screws up at org.netbeans.modules.project.uiapi.ProjectTemplateAttributesProvider.ensureProjectAttrs()
Comment 5 Milos Kleint 2013-08-20 08:34:29 UTC
it has to be disallowed to include not properly named files or they have to be renamed to proper naming pattern
Comment 6 Milos Kleint 2013-08-20 09:04:57 UTC
ProjectTemplateAttributesProvider.ensureProjectAttrs() works correctly as far as I can see. The license-XXX.txt pattern is present since day one (nb 4.x or 5.x). XXX is used in project.properties files in ant based projects to indicate the license used.
the newly introduced LICENSE_PATH property is only handled in ProjectTemplateAttributesProvider.ensureProjectAttrs() to ensure the freemarker engine correctly processes both SFS based and filesystem based templates.

to fix the problem I believe the Tools/Templates dialog needs to enforce the templates/licenses folder's requirements on file names.
Comment 7 Martin Entlicher 2013-08-20 09:52:19 UTC
Hmm, I do not see a valid reason for that, but if you say that it must be that way...
Comment 8 Martin Entlicher 2013-08-21 17:10:54 UTC
Fixed by changeset:   262166:247757356d03
http://hg.netbeans.org/core-main/rev/247757356d03
Comment 9 Quality Engineering 2013-08-23 02:37:00 UTC
Integrated into 'main-silver', will be available in build *201308222300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/247757356d03
User: mentlicher@netbeans.org
Log: #233352: Do not allow to create license without the mandatory prefix and suffix.