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 116620 - [60cat] Rename file in Files window gets exception
Summary: [60cat] Rename file in Files window gets exception
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2007-09-25 08:51 UTC by tetsu
Modified: 2008-12-22 11:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The unexpected exception error. (14.10 KB, image/png)
2007-09-25 08:52 UTC, tetsu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tetsu 2007-09-25 08:51:31 UTC
[ BUILD # : 200709200000 ]
[ JDK VERSION : 1.6.2 ]

In Files dialog, when you rename a file happen to a already exists file name, netbeans pop up a exception window with title of unexpected exception.

Obviously, it is an expected exception. Netbeans should give a waring such as cannot rename because of duplicated name.

I attached a screen capture.
Comment 1 tetsu 2007-09-25 08:52:37 UTC
Created attachment 49415 [details]
The unexpected exception error.
Comment 2 David Simonek 2007-09-26 10:44:45 UTC
What is Files dialog? How do I invoke it? Do you mean main menu File -> Open project or File -> Open file? Please follow
guidelines for entering bug reports and attach exact set of steps that leads to an error. Thank you.
Comment 3 tetsu 2007-09-26 11:14:40 UTC
Sorry. I mean Files Window, which you can invoke by pressing Ctrl + 2 or Windows --> Files on menu bar.
Then you select a file in the Files Window, press F2 to invoke rename function. 
Third, input an existing file name.
For example, I have 2 files in the Files Window,
--AAA.java
--BBB.java
Rename the BBB.java to AAA.java will case the error I mentioned.
Comment 4 David Simonek 2007-09-26 12:06:17 UTC
Great, now I can reproduce, but only with plain files created through new File -> empty file. In case of java files,
rename refactor comes in and it's all OK here.

So my steps for reproduction are:

1) Open Files window
2) Create empty file aaa (File -> New file -> Other -> Empty file)
3) Create empty file bbb
4) select bbb, invoke rename (press F2), try to rename to aaa

mentioned dialog with exception appear. Strangely, exception don't appear on console nor in the log, it seems to be
swallowed. Moreover, exception dialog contains wrong location of log file, it's not in "system" subdir, but "var/log"
subdir.
Comment 5 David Simonek 2007-09-26 15:00:36 UTC
Passing to openide/explorer. Error is in TreeViewCellEditor.editingStopped. IMHO exception is catched here and should be
only logged instead of popping the dialog.
Comment 6 Petr Nejedly 2007-11-01 15:56:35 UTC
The problem is in the presentation of the underlaying exception to the user.
It is properly annotated already, and if not, the code would annotate it with a generic message, but the
NotifyDescriptor.Exception doesn't use the annotation.
 
Comment 7 Petr Nejedly 2007-11-01 16:00:04 UTC
Fixed:
openide/explorer/src/org/openide/explorer/view/TreeViewCellEditor.java,v1.5