Bug 573604 - Delete while typing in conditional breakpoint editor area deletes breakpoint
Summary: Delete while typing in conditional breakpoint editor area deletes breakpoint
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.20   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-18 07:13 EDT by Martin Fabricius CLA
Modified: 2023-06-03 18:31 EDT (History)
2 users (show)

See Also:


Attachments
Screencast of Bug 573604 - Hitting 3 times DELETE (1.41 MB, video/x-matroska)
2021-05-26 13:43 EDT, Martin Fabricius CLA
no flags Details
screencast in mp4 (910.01 KB, video/mp4)
2021-05-27 07:07 EDT, Sarika Sinha CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fabricius CLA 2021-05-18 07:13:49 EDT
When editing the condition of a conditional breakpoint in the editor area of the breakpoints view: If I hit delete in an empty editor OR at the end of the input, instead of deleting nothing of your input, the breakpoint itself will be deleted from the list of all breakpoints.

This even gets worse if you hold the delete key because you want to delete a whole bunch of characters before the caret. Once all characters are deleted and you hit the end of your input, it will start to delete all your breakpoints because after your conditional breakpoint gets deleted the next breakpoint on the list gets the focus and will also be deleted. With this it is easily possible to delete all your breakpoints at once by accident.

This bug does not occur in other input fields like the Hit count.
------------------------------------
Expected behaviour:
Do not delete breakpoints at all when the focus is in the editor area.
------------------------------------
Tested with 

Eclipse IDE for Enterprise Java and Web Developers
Version: 2021-03 (4.19.0)
Build id: 20210312-0638

and

Eclipse SDK
Version: 2021-06 (4.20)
Build id: I20210503-1800
Comment 1 Sarika Sinha CLA 2021-05-25 08:19:19 EDT
Can you attach a small video to show?

I tried but could not reproduce.
Comment 2 Martin Fabricius CLA 2021-05-26 13:30:59 EDT
I am using a Windows 10 PC. This could be relevant if you are trying to reproduce it on a Mac or Linux since the SWT components sometimes behave differently.
I will try to create a screencast.
Comment 3 Martin Fabricius CLA 2021-05-26 13:43:30 EDT
Created attachment 286459 [details]
Screencast of Bug 573604 - Hitting 3 times DELETE
Comment 4 Sarika Sinha CLA 2021-05-27 07:07:02 EDT
Created attachment 286462 [details]
screencast in mp4

Yes I can reproduce now. 
Even on Mac I can reproduce with Fn + delete.

Will ask for SWT suggestion, as it looks like a focus issue.

@Lakshmi, any suggestion?
Comment 5 Lakshmi P Shanmugam CLA 2021-05-28 09:29:14 EDT
(In reply to Sarika Sinha from comment #4)
> Created attachment 286462 [details]
> screencast in mp4
> 
> Yes I can reproduce now. 
> Even on Mac I can reproduce with Fn + delete.
> 
> Will ask for SWT suggestion, as it looks like a focus issue.
> 
> @Lakshmi, any suggestion?

When there is no text to delete in the editor area, looks like the delete event is sent to the view and Edit > Delete is invoked, deleting the breakpoint.
We can check for a way to avoid this and also look at HitCount textbox code.
Comment 6 Martin Fabricius CLA 2021-05-28 10:58:26 EDT
Yes, this it what happens. If you activate "Show key binding when command is invoked" in Preferences -> General -> Keys, you will see
"Delete - Delete \n Delete the selection".
Unfortunately the screencast did not capture this info box.
Comment 7 Sarika Sinha CLA 2021-06-02 09:31:54 EDT
I tried adding a key Listener for the text widget and also to set the focus back but still the RemoveBreakpointAction which is associated to the Breakpoint view remove action. 
I tried adding handlers as well and also comparing the yourkit snapshot in both the cases when there is nothing to delete and when there is text to delete.

But still it's a mystery as to how that "RemoveAction" is called or why not called when there is a text.
Comment 8 Martin Fabricius CLA 2021-06-03 05:17:18 EDT
I did a little testing on older Eclipse version and this bug is present at least since 4.2.2 (Juno). It is not present in 3.7.2 (Indigo). I did not check the version chaos in between these two versions apart from 4.0 where the Breakpoint view doesn't work at all since it does not show any of my breakpoints.
Comment 9 Eclipse Genie CLA 2023-06-03 18:31:22 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.