I observed different behaviour on UNIX and Windows machines:
On Linux & Solaris, one can rename the file even if the new name is already used in the folder. No exception is thrown and no message box is displayed. The file that was `renamed` is DELETED from the
On Windows (NT), the first attempt to rename a file in the described way produces an error message box. If you try to rename it again, no message/exception is displayed and NO ACTION is taken. The fil
e`s name remains the same in the Explorer window and on the disk.
This bug dates at least from build 498 and is most probably in org.openide.filesystems.*.
[Svata] The behaviour on UNIXes seems to be related to OS function rename(from, to), that OVERWRITES the destination (unless the destination is directory) unlike Windows` RenameFile API function that
needs extra flag to overwrite the target. It seems that JDK`s File.renameTo directly calls underlying OS` implementation without abstracting different behaviour.
This is currently fixed by checking if the destination exists() and if so, throwing exception as if renameTo failed.