Bug 25137 - Paste enabled with deleted file on clipboard [ccp]
Summary: Paste enabled with deleted file on clipboard [ccp]
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Adam Kiezun CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-21 14:31 EDT by Knut Radloff CLA
Modified: 2002-11-14 10:20 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Knut Radloff CLA 2002-10-21 14:31:55 EDT
build 20021018

-In the Windows Explorer select a file and copy it to the clipboard
-Delete the file
-In the package view select a target
->The paste menu item is enabled even though the file on the clipboard does not 
exist. The paste operation results in an error. The paste menu item should be 
disabled in this scenario.

Note:
I just released a fix for bug 16129 that fixes this for the Navigator 
PasteAction.
Comment 1 Adam Kiezun CLA 2002-11-13 10:24:13 EST
fixed

btw, code in PasteAction looks strange:
if (resources[i].exists() == false)

if (! resources[i].exists())
is used more commonly and certainly more readible
Comment 2 Knut Radloff CLA 2002-11-13 16:39:01 EST
We've had that discussion before.
Testing using ! is error prone. I've seen bugs that were hard to find because 
of an overlooked or missing !.
! is too easy on the eye, too easy to miss. Most people use ! without a space. 
I'm not sure the space helps any (readability making it less error prone).
== false also isn't deleted accidentally, ! easily can be.

This is one of my favorite subjects but it comes down to personal preference. I 
generally do my own thing but observe existing style when I hack in existing 
code. There's nothing worse than inconsistent coding style.
Comment 3 Claude Knaus CLA 2002-11-14 10:20:19 EST
verified 20021113

BTW, I like

  if (! condition) {}

better as well (can read more quickly). With the space there, you can't miss 
the exclamation mark. This is important when using proportional fonts.