Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 241384

Summary: [Markers] Cannot delete marker from in marker, problems, task or bookmarks view
Product: [Eclipse Project] Platform Reporter: Axel Mueller <aegges>
Component: UIAssignee: Tod Creasey <Tod_Creasey>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: james.georgas, Luke.Maurer, pwebster, remy.suen
Version: 3.4   
Target Milestone: 3.4.1   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 242246    
Bug Blocks:    
Attachments:
Description Flags
Patch none

Description Axel Mueller CLA 2008-07-18 08:22:31 EDT
Build ID: I20080617-2000

Steps To Reproduce:
1. Select any type of marker (bookmark, user-created task, problem marker etc.) and try to delete it
2. A popup window appears and wants your confirmation to delete the marker
3. Nothing happens. The marker is still alive and kicking.


More information:
Deleting a bookmark or user created task by right clicking on them in the editor's annotation bar works.

Don't know if this matters but I have installed Eclipse CDT with Mylin support.
Comment 1 Remy Suen CLA 2008-07-18 08:38:40 EDT
Hi Axel, I can't seem to reproduce this on I20080715-1015.

My steps are as follows:
1. Open 'Tasks' view.
2. Open the context menu on the farthest left column, select 'Add Task...'.
3. Enter in a random description, click 'OK'.
4. The 'asdf' task appears at the top of the list.
5. Open the context menu on it, see two 'Delete' menu items (?).
6. Select the first one, a confirmation window appears, click 'Yes'.
7. The task is deleted.
8. Repeat the steps for the second 'Delete' menu item, the results are identical.
Comment 2 Axel Mueller CLA 2008-07-19 12:40:38 EDT
reply to comment #1
> Hi Axel, I can't seem to reproduce this on I20080715-1015.
Well, I am using I20080617-2000. And there is no update available.
Comment 3 Remy Suen CLA 2008-07-19 12:53:40 EDT
(In reply to comment #2)
> reply to comment #1
> > Hi Axel, I can't seem to reproduce this on I20080715-1015.
> Well, I am using I20080617-2000. And there is no update available.

Well, I'm using an integration build so it's not really the same as an "update" in the typical sense.

So if you follow the steps I outlined in comment 1, you can reproduce the problem, is this correct? You are opening the 'Tasks' view and not the 'Task List' view, correct?
Comment 4 Axel Mueller CLA 2008-07-19 13:16:51 EDT
(In reply to comment #3)
I can reproduce the problem following the steps you proposed in comment #1. The problem appears in the "Tasks" view, the "Markers" view, the "Bookmarks" view and the "Problems" view. I am not using the "Task List" view.
Comment 5 Tod Creasey CLA 2008-07-23 20:14:57 EDT
Remy were you trying Windows or Linux?
Comment 6 Remy Suen CLA 2008-07-23 20:19:24 EDT
(In reply to comment #5)
> Remy were you trying Windows or Linux?

Hi Tod, that was on Vista Business.

I'm using Gentoo Linux right now and just tried my steps in comment 1 with a fresh workspace using -data. I can reproduce it on I20080716-1200. I also get the double 'Delete' buttons. I checked for a .log file but none was generated.
Comment 7 Remy Suen CLA 2008-07-23 20:31:24 EDT
Tod, this is what I've found on gtk+.

DeleteHandler calls getSelectedMarkers(event) at line 58.
MarkerViewHandler calls getView(event). The returned view is null, so the method just returns EMPTY_MARKER_ARRAY, then back in DeleteHandler, the zero-length array is "iterated over".
Comment 8 Remy Suen CLA 2008-07-24 17:57:00 EDT
If the MessageDialog is commented completely and we let the delete code just move on without prompting for confirmation works properly. The loss of focus to the popup dialog has somehow affected the information about the active part in the ExecutionEvent.

I added ww.getActivePage().activate(view); after the dialog was closed but that didn't help at all. Technically, it could be worked around by simply using...

final IMarker[] selected = view.getSelectedMarkers();

...instead, but I'm pretty sure we don't want to do that.
Comment 9 Tod Creasey CLA 2008-07-28 11:03:51 EDT
Created attachment 108544 [details]
Patch

The workaround is simple - we ask for the selected markers before we open the dialog. I have opened bug 242246 to cover the bug in handlers.
Comment 10 Tod Creasey CLA 2008-07-28 15:03:35 EDT
Fixed in build > 20080728 in 3.4.1 and 3.5
Comment 11 Tod Creasey CLA 2008-09-04 07:54:42 EDT
*** Bug 245035 has been marked as a duplicate of this bug. ***
Comment 12 Tod Creasey CLA 2008-09-05 09:42:29 EDT
Verified in M20080903-2000
Comment 13 Remy Suen CLA 2008-12-14 01:09:58 EST
*** Bug 258737 has been marked as a duplicate of this bug. ***