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 17570

Summary: Renaming a file object to an existing file object yields an IllegalArgumentException.
Product: platform Reporter: Paul Stremel <pstremel>
Component: ExplorerAssignee: David Strupl <dstrupl>
Status: CLOSED DUPLICATE    
Severity: blocker    
Priority: P1    
Version: 3.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Paul Stremel 2001-11-12 18:50:57 UTC
Renaming a file object in the explorer to an existing file object results in 
the stack trace shown below. The renaming error is reproducible.  This can be 
demonstrated for the creation/renaming of two text files: 1) Create a text file 
called &#8220;test&#8221;. 2) Try to create another text file called &#8220;test&#8221;, Template 
Wizard will not allow &#8220;test&#8221;, use &#8220;test1&#8221;.  3) Go to explorer and 
rename &#8220;test1&#8221; to &#8220;test&#8221;.  Following stack trace results.  Shouldn&#8217;t the ide 
search for a unique name and complete the rename?

Mon Nov 12 10:41:37 PST 2001: org.openide.filesystems.FSException: null
Annotation: The new name is in a bad format; cannot rename test1.
Nested annotation: Cannot rename file nbTest/test1.txt in 
D:\netBeans\netBeansFiles to nbTest/test.txt.
java.lang.IllegalArgumentException
        at org.openide.loaders.DataNode.setName(DataNode.java:124)
        at org.openide.loaders.DataNode.setName(DataNode.java:135)
        at org.openide.nodes.FilterNode.setName(FilterNode.java:219)
        at org.openide.actions.RenameAction.performAction(RenameAction.java:73)
        at org.openide.util.actions.NodeAction.performAction(NodeAction.java:92)
        at org.openide.util.actions.NodeAction.actionPerformed
(NodeAction.java:83)
        at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:76)
        at org.openide.util.Task.run(Task.java:124)
[catch] at org.openide.util.RequestProcessor$ProcessorThread.run
(RequestProcessor.java:626)
 
Mon Nov 12 10:41:37 PST 2001: org.openide.filesystems.FSException:  Cannot 
rename file nbTest/test1.txt in D:\netBeans\netBeansFiles to nbTest/test.txt.
org.openide.filesystems.FSException: Cannot rename file nbTest/test1.txt in 
D:\netBeans\netBeansFiles to nbTest/test.txt.
        at org.openide.filesystems.FSException.io(FSException.java:78)
        at org.openide.filesystems.LocalFileSystem.rename
(LocalFileSystem.java:260)
        at org.openide.filesystems.LocalFileSystem$Impl.rename
(LocalFileSystem.java:587)
        at org.openide.filesystems.AbstractFileObject.rename
(AbstractFileObject.java:415)
        at org.openide.loaders.FileEntry.rename(FileEntry.java:59)
        at org.openide.loaders.MultiDataObject.handleRename
(MultiDataObject.java:382)
        at org.openide.loaders.DataObject$4.run(DataObject.java:544)
        at org.openide.filesystems.EventControl.runAtomicAction
(EventControl.java:69)
        at org.openide.filesystems.FileSystem.runAtomicAction
(FileSystem.java:366)
        at org.openide.loaders.DataObject.rename(DataObject.java:542)
        at org.openide.loaders.DataNode.setName(DataNode.java:118)
        at org.openide.loaders.DataNode.setName(DataNode.java:135)
        at org.openide.nodes.FilterNode.setName(FilterNode.java:219)
        at org.openide.actions.RenameAction.performAction(RenameAction.java:73)
        at org.openide.util.actions.NodeAction.performAction(NodeAction.java:92)
        at org.openide.util.actions.NodeAction.actionPerformed
(NodeAction.java:83)
        at org.netbeans.core.ModuleActions$1.run(ModuleActions.java:76)
        at org.openide.util.Task.run(Task.java:124)
[catch] at org.openide.util.RequestProcessor$ProcessorThread.run
(RequestProcessor.java:626)
Comment 1 Marian Mirilovic 2001-11-13 09:41:12 UTC
Platform/OS independent problem.

In [nb_dev](20011113) seems to work. If you rename file object to an
existing one, IDE inform you about impossibility renamed it. Exception
is logged only to log file .


*** This issue has been marked as a duplicate of 11681 ***
Comment 2 Quality Engineering 2003-07-01 15:51:53 UTC
Resolved for 3.4.x or earlier, no new info since then -> verified
Comment 3 Quality Engineering 2003-07-01 16:12:20 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.