Bug 16129 - [Navigator] exception when attempting to paste a deleted file
Summary: [Navigator] exception when attempting to paste a deleted file
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 2.1 M5   Edit
Assignee: Knut Radloff CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
: 22605 (view as bug list)
Depends on:
Blocks: 28602
  Show dependency tree
 
Reported: 2002-05-16 06:27 EDT by Adam Kiezun CLA
Modified: 2003-01-13 16:40 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-05-16 06:27:27 EDT
20020514
in the navigator, select a file,
copy it
delete it 
select its folder and paste

your get a big and scary error dialog.

if you try doing this with a java file you get sth like the following in the 
log:

java.version=1.4.1-beta
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -dev bin -data D:\runtime-workspace
!ENTRY org.eclipse.ui 4 0 Thu May 16 12:28:19 CEST 2002
!MESSAGE Problems creating buffer
!ENTRY org.eclipse.jdt.core 4 969 Thu May 16 12:28:19 CEST 2002
!MESSAGE Sd.java does not exist.
Comment 1 Nick Edgar CLA 2002-05-16 14:59:53 EDT
Tried this in 0515.  Got the error dialog, but it's not that big and scary.
Shouldn't happen though.  FWIW, MS Explorer has the same bug.
We could improve our error handling and give a message dialog, rather than an 
error dialog, indicating that the paste could not be completed because the 
original file was deleted.
Comment 2 Knut Radloff CLA 2002-08-27 16:18:35 EDT
*** Bug 22605 has been marked as a duplicate of this bug. ***
Comment 3 Knut Radloff CLA 2002-10-21 14:17:16 EDT
PasteAction is now disabled if resources/files on clipbaord do not exist.
In addition, CopyFilesAndFoldersOperation aborts when a workspace resource or 
external file does not exist. 
This still uses an error dialog since such a copy/import attempt does in fact 
present an error case. The copy/paste action should check if the file exists 
before calling the CopyFilesAndFoldersOperation.
However, the error message presented in this case is a lot clearer.
Comment 4 Knut Radloff CLA 2002-10-23 15:09:39 EDT
Backed out the change in CopyFilesAndFoldersOperation.validateImportOperation 
that checks for non-existent external files. This check prevented the content 
of WinZip archives from being dragged into Eclipse. Winzip puts a name in the 
clipboard that points to a temporary file. The file is not actually 
created/extracted from the archive until the drop occurs. The 
CopyFilesAndFoldersOperation check failed because it tested the temporary file.
We still test for non-existent files when the copy operation actually runs 
because by then the file really has to exist.
Comment 5 Knut Radloff CLA 2002-12-18 12:43:30 EST
The current fix can adversely affect performance during startup and when the 
Navigator context menu is displayed. See bug 28602.
Should take out file exists check in PasteAction and in 
CopyFilesAndFolderOperation.validateDestination. Should check all files in 
CopyFilesAndFolderOperation.copyFiles and copyResources and display those that 
are missing.
Comment 6 Adam Kiezun CLA 2002-12-20 06:17:47 EST
i removed the exists() check from our code
i call CopyFilesAndFolderOperation.copyFiles so once this is fixed we'll be fine

Comment 7 Knut Radloff CLA 2003-01-13 16:40:42 EST
Fixed CopyFilesAndFoldersOperation and PasteAction.
Fixed in > 20030113.