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

Bug 297899

Summary: Stepping key-bindings get ignored the first time they are pressed
Product: [Eclipse Project] JDT Reporter: Marc Khouzam <marc.khouzam>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: darin.eclipse, ndsilva
Version: 3.6Flags: darin.eclipse: review? (pawel.1.piech)
Target Milestone: 3.6 M7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch none

Description Marc Khouzam CLA 2009-12-15 15:47:40 EST
If I want to step in a debug session, the first of each of F5, F6, F7 and F8 gets ignored.  The second press and all following work as expected.  This happens once, every time I restart eclipse.

I am able to reproduce with a very simply program:

public class Test {
	public static void main(String[] args) {
		Test t = new Test();
		t.init();
	}
	
	public void init() {
		System.out.println("init");
	}
}

Set a breakpoint anywhere.  Then press any step key shortcut and the first press will be ignored.

I've am able to reproduce this in 3.6 M2, M3 and M4.  I didn't try with an older 3.6.  It works properly for 3.5.1
Comment 1 Darin Wright CLA 2010-03-16 16:26:38 EDT
Created attachment 162212 [details]
patch

The problem is due to a race condition caused by the fact that the action's constructor was setting fInitialized to true. This needs to be done, unless the action is associated with a part or window, in which case enablement should be updated based on the debug context service, asynchronously.

Without this fix, the action's initial enabled state was set to false by the constructuor, and then the action was #run(...) before it had a chance to get it's real enablement state. The fix is to set fInitialized to false when the action is initialized for a part or window. This causes the first execution to wait for initialization to complete.
Comment 2 Darin Wright CLA 2010-03-16 16:28:27 EDT
Fixed in HEAD. Please verify, Pawel.
Comment 3 Marc Khouzam CLA 2010-07-28 22:41:11 EDT
I'm still seeing this in 3.6.
Should re-open this bug or create a new one?
Comment 4 Darin Wright CLA 2010-07-29 09:14:21 EDT
(In reply to comment #3)
> I'm still seeing this in 3.6.
> Should re-open this bug or create a new one?

Please open a new one - I'm not seeing this. Is it specific to CDT or JDT?
Comment 5 Marc Khouzam CLA 2010-07-29 09:36:11 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > I'm still seeing this in 3.6.
> > Should re-open this bug or create a new one?
> 
> Please open a new one - I'm not seeing this. Is it specific to CDT or JDT?

It was for JDT.
I saw it last night on my Windows7 box but I can't reproduce it today on Linux.  I'll try to see if my Windows7 Eclipse installation is correct and that I can consistently see the problem before opening a new bug.

Thanks
Comment 6 Marc Khouzam CLA 2010-07-30 06:56:15 EDT
(In reply to comment #5)

> It was for JDT.
> I saw it last night on my Windows7 box but I can't reproduce it today on Linux.
>  I'll try to see if my Windows7 Eclipse installation is correct and that I can
> consistently see the problem before opening a new bug.

I can't see it anymore, even on my Windows7 box.  Maybe I got confused...  Sorry.