Bug 160280 - Could not remove object from remote scratchpad if it multiply added
Summary: Could not remove object from remote scratchpad if it multiply added
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0   Edit
Assignee: Kushal Munir CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-10-10 05:53 EDT by Ali Burak Kulakli CLA
Modified: 2011-05-25 10:29 EDT (History)
0 users

See Also:
mober.at+eclipse: pmc_approved+
mober.at+eclipse: review+


Attachments
Added a check when adding items to the scratchpad to see if they already exist. (1.16 KB, patch)
2007-05-24 16:03 EDT, Kevin Doyle CLA
mober.at+eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ali Burak Kulakli CLA 2006-10-10 05:53:56 EDT
Remote scratchpad allows adding same object more than once. When you add a file two times, then try to delete that file selecting it from the scratchpad tries to delete all (in this case two) links. However, I think it deletes the file at first attempt and for second, it gives an error saying there is no such file. 
And when you try to remove link from remote scratchpad view, it is not possible to remove it by clicking X (Remove Selected From View) at the corner once. You have to click it twice.

-----------Enter bugs above this line-----------
RSE 1.0 Testing round 2
installation : eclipse-platform-3.2.1, cdt-3.1.1
RSE install  : update-site RSE-complete
java.runtime : Sun 1.5.0_08-b03
os.name:     : Windows XP 5.1, Service Pack 2
------------------------------------------------
systemtype   : Unix-ssh (dstore-processes)
targetos     : Fedora Core release 5 (Bordeaux)
targetuname  : Linux fedai 2.6.15-1.2054_FC5smp #1 SMP Tue Mar 14 16:05:46 EST 2006 i686 i686 i386 GNU/Linux
targetvm     : gij (GNU libgcj) version 4.1.0 20060304 (Red Hat 4.1.0-3)
------------------------------------------------
Comment 1 Kevin Doyle CLA 2007-04-13 17:16:59 EDT
I tried to follow the bug description and don't see the same error.

If you copy the same file twice into the scratchpad and Delete the file by right clicking on the file in the remote systems view or the scratchpad the 2 files stay in the scratchpad.

If you click on one of them in the scratchpad and click the "Remove Selected File From View" button it will remove the one file and change the other to act like a directory (i.e. it has the directory icon and the + symbol).  You can remove it though without error.

It would be nice if you delete a file it's removed from the scratchpad as well.
Comment 2 Kevin Doyle CLA 2007-05-24 16:03:16 EDT
Created attachment 68664 [details]
Added a check when adding items to the scratchpad to see if they already exist.

Legal Message: I, Kevin Doyle, declare that I developed attached code from
scratch, without referencing any 3rd party materials except material licensed
under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this
contribution under the EPL.
Comment 3 Kushal Munir CLA 2007-05-24 23:14:19 EDT
Thanks Kevin.

I'm ok with applying this patch, but given that Scratchpad should be able to contain anything, is it ok to not allow the same object from being added twice to the view? Is everyone ok with this change?
Comment 4 Martin Oberhuber CLA 2007-05-25 03:40:04 EDT
What would the semantics of adding exactly the same object twice be?
What would it be good for?

IMHO the scratchpad is a container of things, with the semantics of a set so it cannot contain exactly the same thing twice so I'm fine with the patch.
Comment 5 Kushal Munir CLA 2007-05-25 11:08:35 EDT
The Scratchpad view allows the same object (i.e. two objects satisfying o==e or o.equals(e)) to be added more than once as a top level node in the view.

With this fix we no longer allow this.
Comment 6 Martin Oberhuber CLA 2008-08-13 13:19:17 EDT
[target cleanup] 2.0 RC1 was the original target milestone for this bug