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 19772 - Explorer should not allow rename file to empty string
Summary: Explorer should not allow rename file to empty string
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2002-01-25 08:56 UTC by Marian Mirilovic
Modified: 2008-12-23 13:35 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
a proposed patch (2.49 KB, patch)
2002-05-09 16:02 UTC, Jiri Rechtacek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2002-01-25 08:56:23 UTC
[nb3.3.1_rc2](20020123), [jdk1.3.1](02)

Steps to reproduce:
- select TXT file in Explorer
- hit F2
-> in place textfield is created
- hit Delete and delete name of file(rename to empty string), hit Enter
-> node .txt is displayed

The same result for renaming by property name in properties window.
Comment 1 David Simonek 2002-02-06 13:45:29 UTC
Easy, explorer shouldn't allow this. (we're not showing extensions by
default and explorer isn't place for management of .something files).
This should behave exactly as if you try to put empty string or
invalid filename for java classes.
Comment 2 Jesse Glick 2002-03-18 21:54:15 UTC
IMHO this should be solved directly by a check in DataObject.rename which could throw 
an IllegalArgumentException (nicely annotated) if passed "". Unless someone thinks 
there might be a reason to programmatically rename a DataObject to "" (sounds dangerous 
to me).
Comment 3 Jiri Rechtacek 2002-05-09 16:02:22 UTC
Created attachment 5686 [details]
a proposed patch
Comment 4 Jiri Rechtacek 2002-05-09 16:24:12 UTC
DataObject check a new name and if it is empty then throw
IllegalArgumentException.
A question is is the name should be trimmed before check or a name "
.txt" is allowed. 
I'm going to commit a attached patch on 10/5.
Comment 5 Jiri Rechtacek 2002-05-10 10:02:38 UTC
the attached patch was commited.
Comment 6 Marian Mirilovic 2002-05-17 16:22:24 UTC
verified in [nb_dev](20020517)
Comment 7 Quality Engineering 2003-07-01 16:22:31 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.