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 196704 - Poor recovery after requesting impossible localizing bundle path
Summary: Poor recovery after requesting impossible localizing bundle path
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P4 normal (vote)
Assignee: Martin Kozeny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-15 02:52 UTC by Vibhuti
Modified: 2012-12-21 02:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
error1 (101.73 KB, image/png)
2011-03-15 02:55 UTC, Vibhuti
Details
error2 (102.92 KB, image/png)
2011-03-15 02:56 UTC, Vibhuti
Details
project created (86.35 KB, image/png)
2011-03-15 02:56 UTC, Vibhuti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vibhuti 2011-03-15 02:52:01 UTC
I tested TS_60_ProjectsWizard (http://wiki.netbeans.org/TS_60_ProjectsWizard)on NetBeans IDE 7.0 RC 1 

Product Version: NetBeans IDE 7.0 RC1 (Build 201103100000)
Java: 1.6.0; Java HotSpot(TM) Client VM 1.6.0-b105
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\Pithwa\.netbeans\7.0rc1

there is an unusual behaviour in the module project wizard. After we give a valid code name base such as org.my.m1 it takes the default localizing bundle name as org/my/m1/Bundle.properties . After doing this if i try to change the localizing bundle name as org/:*/m1.Bundle.properties that time finish button is enabled after clicking on it,an error is shown on the wizard itself 

Cannot create folder :* in folder C:/Documents and Settings/Pithwa/My Documents/NetBeansProjects/suite4/module6/src/org. 

So naturally a user would try to correct himself. so after that i wrote the correct name org/my/m1/Bundle.properties and clicked finish. naturally it shd behave in a usual  manner but it gave error :

File MasterFileObject[C:\Documents and Settings\Pithwa\My Documents\NetBeansProjects\suite4\module6\nbproject\project.xml@100de71:fb6e9b,valid=true] already exists.

the wizard doesnt get closed after it. And on canceling we find that the project is created but with just org as package. Naturally a user should not at all create such module project. Otherwise this inconsistent created module is inconvenient to the user. 

Steps to regenerate the bug are :

1.Go to new project
2. select netbeans module
3. Select module from projects.
4. Give a valid name of module as module7 etc.
5. click on next then give valid name codename base.
6. Then give invalid localizing bundle name.
click on finish it gives error 1 which is normal behaviour
7. try to give correct name in localizing bundle then click on finish it gives error 2 and morever wizard doesnt get closed and also it created project with package as org. 

Attaching the snapshot
Comment 1 Vibhuti 2011-03-15 02:55:57 UTC
Created attachment 106999 [details]
error1
Comment 2 Vibhuti 2011-03-15 02:56:26 UTC
Created attachment 107000 [details]
error2
Comment 3 Vibhuti 2011-03-15 02:56:57 UTC
Created attachment 107001 [details]
project created
Comment 4 Jesse Glick 2011-03-15 19:40:39 UTC
After clicking Finish the first time, the wizard starts to create project metadata, but of course it breaks on the impossible bundle path (something Windows cannot create), and there is no backup logic to delete what had been created in case of error. The proper solution is to disable Finish and show an error when such a bundle path is entered to begin with, but the exact set of file patterns which could form a legitimate folder path is platform-dependent and difficult to predict.

Probably the bundle (and layer) paths should be restricted to those which would form valid Java packages; while in principle you could create a src/number/23/Bundle.properties and refer to it from the manifest, this would just be asking for trouble since it would be impossible to create Java sources in the same folder.

P4 since this is an artificial attempt to break the wizard.
Comment 5 Martin Kozeny 2012-12-20 08:01:29 UTC
https://hg.netbeans.org/core-main/rev/f2981ab8b97b
Comment 6 Quality Engineering 2012-12-21 02:35:21 UTC
Integrated into 'main-golden', will be available in build *201212210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f2981ab8b97b
User: Martin Kozeny <mkozeny@netbeans.org>
Log: #196704: At the end of wizard for creating module, button Finish is disabled for invalid bundle path