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 72318 - New File Wizard doesn't work well with files without extensions
Summary: New File Wizard doesn't work well with files without extensions
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
: 88336 (view as bug list)
Depends on:
Blocks: 72320
  Show dependency tree
 
Reported: 2006-02-06 21:35 UTC by Thomas Preisler
Modified: 2007-02-20 11:46 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch for 5.5.1 (1.18 KB, text/plain)
2007-01-10 14:06 UTC, Milos Kleint
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Preisler 2006-02-06 21:35:36 UTC
When creating a file with the New File Wizard, the wizard checks whether the
file already exists on disk and doesn't allow the user to continue if it does.
This check fails for files without an extension. 

ProjectUtilities.canUseFileName(...) checks only whether the suffix is != null
where it probably also should check whether is not empty:

303: if (extension != null)
vs.
303: if (extension != null && extension.length () > 0)

FileObject.getExt() returns "" for files without an extension.

This worked in 4.1.
Comment 1 Jesse Glick 2006-02-06 22:04:18 UTC
Not a high priority; this code is only used if you do not supply a custom wizard
iterator. If you do, the logic is entirely up to you. So simple workaround is to
make your own iterator.
Comment 2 Thomas Preisler 2006-03-16 19:58:31 UTC
Try adding a folder (New File/Folder...| Other | Folder) to *any* project and
you will run into this bug. It is not only CND's makefiles that have this problem.
Comment 3 Jesse Glick 2006-03-17 10:25:52 UTC
I guess Thomas' last comment referred to the fact that the NF wiz does not
prevent you from adding a folder with the same name as an existing folder. But
this is more like a P5 bug since even if you Finish, nothing is harmed; you
cannot "overwrite" a folder.
Comment 4 Thomas Preisler 2006-10-24 00:31:33 UTC
making it a p2 and a candiadte for backport to release55-mars
Comment 5 Thomas Preisler 2006-10-31 18:18:14 UTC
see also http://www.netbeans.org/issues/show_bug.cgi?id=88336
Comment 6 Jiri Prox 2006-11-03 15:38:08 UTC
*** Issue 88336 has been marked as a duplicate of this issue. ***
Comment 7 Thomas Preisler 2006-11-14 16:08:50 UTC
marked issue with SSX3 making it a candicate to be bacported to mars/5.5.1 branch. 
Comment 8 Milos Kleint 2007-01-09 13:23:35 UTC
seems to have been fixed by vsejskal on Nov 23 in the same way as the reporter
suggests. closing as fixed.
Comment 9 Thomas Preisler 2007-01-09 21:12:47 UTC
Great it has been fixed in trunk, but please backport the fix to 5.5.1.
Comment 10 Milos Kleint 2007-01-10 14:06:45 UTC
Created attachment 37223 [details]
patch for 5.5.1
Comment 11 _ rkubacki 2007-01-10 14:29:20 UTC
patch is OK
Comment 12 Milos Kleint 2007-01-11 13:53:34 UTC
merged into release551 branch
Comment 13 Marian Mirilovic 2007-02-20 11:46:55 UTC
verified in NB 5.5.1 Beta