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 208684 - Project Template wiz does not forbid self-add when using Browse...
Summary: Project Template wiz does not forbid self-add when using Browse...
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Templates (show other bugs)
Version: 7.1
Hardware: PC Linux
: P4 normal (vote)
Assignee: Martin Kozeny
URL:
Keywords:
: 216798 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-21 09:25 UTC by arvindd
Modified: 2013-05-28 12:50 UTC (History)
1 user (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 arvindd 2012-02-21 09:25:09 UTC
Product Version = NetBeans IDE 7.1 (Build 201112071828)
Operating System = Linux version 3.1.0-1.2-desktop running on i386
Java; VM; Vendor = 1.7.0_01
Runtime = Java HotSpot(TM) Client VM 21.1-b02

Steps:
1) Create a "Module project"
2) Add a package and some files within that package (I added some XML files)
3) Right-click on the project node, click New->Other->Module Development->Project Template
4) Click "Next", and select the project that was created in step-1 (if the project is not seen, click on "Browse" and then select the project).
5) Click "Next" again, and fill in the name of the Template, display name, Category, and the package that was created in step-2
    ---> I am not sure if this info is relevant, but I used a name containing "_" as a "Template name" and the display name had a "."
6) Finally, click "Finish"

I now get an exception:

org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot get shared access to <path_to_my_package>/<my_project_name>Project.zip@ba4b0c90:6989c1 (probably opened for writing).
Comment 1 Jesse Glick 2012-02-21 19:02:32 UTC
User error: you cannot add a template of a project to itself, since the ZIP file would have to contain itself! It only makes sense to add a template of a _different_ project, which is why the _selected_ project is intentionally omitted from the list of open projects in the combo. However the wizard fails to prevent you from manually selecting the same project using Browse.
Comment 2 arvindd 2012-02-22 08:38:07 UTC
You are right, and thanks for the quick response. I just followed: http://platform.netbeans.org/tutorials/60/nbm-projectsamples.html which seem to suggest self-add (where it talks of right-click project node), but I might be mistaken.
Comment 3 Jesse Glick 2012-02-22 22:27:28 UTC
(In reply to comment #2)
> which seem to suggest self-add (where it talks of right-click project node)

I do not think so. It discusses "the project that you want to bundle as a sample", and the screenshot shows a Java SE project, not an NBM project.

BTW http://platform.netbeans.org/tutorials/70/nbm-projectsamples.html seems to be a newer version of the tutorial; not sure what the differences are.
Comment 4 Martin Kozeny 2012-12-18 10:17:25 UTC
Already fixed for NBM. Feel free to reopen.
Comment 5 Martin Kozeny 2013-05-28 12:50:37 UTC
*** Bug 216798 has been marked as a duplicate of this bug. ***