Bug 409782 - Deleting a file from Project Explorer can result in a "Resource does not exist" editor
Summary: Deleting a file from Project Explorer can result in a "Resource does not exis...
Status: CLOSED DUPLICATE of bug 41431
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-03 16:05 EDT by John Cortell CLA
Modified: 2013-06-04 08:39 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Cortell CLA 2013-06-03 16:05:47 EDT
If you have file X "open" in the editor, and you delete X from the Project Explorer view, you can end up with X remaining in the editor pane with the content being the message "Resource 'X' does not exist", instead of the editor for X closing automatically. This happens if X was not actually brought to the forefront of the editor pane.

I looked into this and it seems to me this is due to the fact that an editor isn't instantiated until it comes to the forefront. Because it's not instantiated, it can't "close" itself when the backing file is deleted.

I can reproduce this with both Eclipse 3.7 and 4.2

Reproducibility Steps:
----------------------
1. Launch Eclipse and open the Resource perspective
2. Create a General project
3. Add a text file to the project, give it some content (a single letter will suffice) and then make five copies of it, to end up with a project that has six files.
4. Make sure all six files are open in the editor.
5. Close Eclipse
6. Relaunch eclipse
7. The editor pane should show tabs for all six files. One is in the forefront. Click two (and only two) of the other tabs. At this point, three files have seen the light of day, and three have not.
7. In the Project Explorer view, expand the project and select all six text files, and delete them.
BUG: You end up with three files in the editor pane, each saying "Resource 'X' does not exist.
EXPECTED BEHAVIOR: The editor pane should have gone empty (no tabs)
Comment 1 Paul Webster CLA 2013-06-04 08:39:54 EDT

*** This bug has been marked as a duplicate of bug 41431 ***