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

Bug 340771

Summary: [Compatibility] Debug views are empty when first opened
Product: [Eclipse Project] Platform Reporter: DJ Houghton <dj.houghton>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: daniel_megert, david_williams, Mike_Wilson, ob1.eclipse, pinnamur, pwebster, remy.suen, thatnitind, tom.schindl
Version: 4.2   
Target Milestone: 4.2 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
deltas.xml none

Description DJ Houghton CLA 2011-03-23 10:53:03 EDT
Version: 4.1.0
Build id: I20110316-1035

I don't know the exact steps to reproduce this problem but I have seen a couple of times where a View has been empty when it is first activated. This has happened to me at least in the Variables, Breakpoints, and Debug views. I switch to them (they are hidden in a stack) and they are empty, so I bring another view in the stack into focus and then switch back and they are populated with the correct contents.
Comment 1 DJ Houghton CLA 2011-03-23 16:25:04 EDT
Oops, thought I opened this already bug didn't find it when I first searched. Sorry for the noise.

*** This bug has been marked as a duplicate of bug 338955 ***
Comment 2 Remy Suen CLA 2011-03-23 17:58:09 EDT
(In reply to comment #1)
> Oops, thought I opened this already bug didn't find it when I first searched.
> Sorry for the noise.
> 
> *** This bug has been marked as a duplicate of bug 338955 ***

I'm going to reopen this bug as I'm not currently convinced that they are the same problem. They might be but I'll have to step through the code to check.
Comment 3 DJ Houghton CLA 2011-04-01 16:42:15 EDT
Wow, this bug is increasingly annoying. ;-)
Comment 4 Remy Suen CLA 2011-04-04 10:24:28 EDT
Is this problem "permanent" in that it doesn't go away until you restart?

Or is it that sometimes you switch perspectives the views are populated but other times when you switch perspectives they're not populated?
Comment 5 DJ Houghton CLA 2011-04-04 10:30:56 EDT
I've noticed it when I start Eclipse and bring focus to a view which is in a stack (but not on top), it is empty. I can fix it (until next startup) by giving another view in the stack focus and then switching back.

I only use a single perspective so I haven't noticed the behaviour when switching perspectives.
Comment 6 Remy Suen CLA 2011-04-04 10:38:16 EDT
(In reply to comment #5)
> I've noticed it when I start Eclipse and bring focus to a view which is in a
> stack (but not on top), it is empty.

If it's a view that is on top on startup, then I can see why it would be empty. I'll need to investigate this more though since you say the view is not on top on startup.
Comment 7 DJ Houghton CLA 2011-04-04 10:57:48 EDT
Created attachment 192466 [details]
deltas.xml

Here is my deltas.xml file. This morning I had the same problem when switching to the Breakpoints view.
Comment 8 Remy Suen CLA 2011-04-04 11:18:38 EDT
*** Bug 338955 has been marked as a duplicate of this bug. ***
Comment 9 Remy Suen CLA 2011-04-04 11:21:05 EDT
Event handlers are supposedly notified based on service ranking order. If we want the renderers to always be notified of events first then they need to handle events first before we forward them out to other consumers.

Since the notification ordering is currently "random", the problem is not 100% reproducible.
Comment 10 Eric Moffatt CLA 2011-04-05 10:53:41 EDT
What is the ordering issue here ? I have no problem believing that we likely need some ordering control on the event listeners but how is this affecting whether the contents of the part get displayed ?
Comment 11 Remy Suen CLA 2011-04-05 10:59:04 EDT
(In reply to comment #10)
> What is the ordering issue here ?

OSGi event handlers are notified in a non-deterministic way. Well, they could be by service ranking order but we don't use that right now anyway since the broker just throws them in as-is.

> I have no problem believing that we likely
> need some ordering control on the event listeners but how is this affecting
> whether the contents of the part get displayed ?

If a handler for checking when parts have become the selected element of a stack is notified before the renderer is, then the part will not have been rendered yet and presumably should not try to display anything.
Comment 12 Remy Suen CLA 2011-04-12 13:01:51 EDT
*** Bug 338456 has been marked as a duplicate of this bug. ***
Comment 13 Remy Suen CLA 2011-05-05 12:40:11 EDT
Well, I guess we can forget about the service ranking thing...

-----

Remy Suen: Should an EventHandler with a higher serivce ranking be guaranteed to be notified of events first?

Thomas J. Watson: I don't think that is spelled out in the specification. I know the impl does not sort the order in which the handlers are called.
Comment 14 Oleg Besedin CLA 2011-05-05 13:18:01 EDT
(In reply to comment #9)
> Event handlers are supposedly notified based on service ranking order. If we
> want the renderers to always be notified of events first then they need to
> handle events first before we forward them out to other consumers.
> 
> Since the notification ordering is currently "random", the problem is not 100%
> reproducible.

Probably use two different events? Something like "part needs to rendered" vs "part has been activated".
Comment 15 Remy Suen CLA 2011-05-05 14:53:09 EDT
I've made a slight tweak to the part service to "enforce" rendering of parts in the event that the renderer doesn't do the job properly (doesn't have its own listeners). This should help alleviate the problem.
Comment 16 Remy Suen CLA 2011-05-13 14:08:54 EDT
If you are still seeing this problem with the latest build (today is May 13th), please ping on this bug.
Comment 17 Remy Suen CLA 2011-05-26 19:04:57 EDT
Using I20110526-1435, I started Eclipse, had some breakpoints, hit F11, when the breakpoint hit and the perspective switch was triggered, the 'Variables' view was empty. As expected, clicking the 'Breakpoints' view and then back fixed the problem.
Comment 18 DJ Houghton CLA 2011-11-10 11:00:24 EST
I've started seeing this again. First in the Variables view yesterday when debugging. Then today when I started up Eclipse the Breakpoints view was empty. I'm using:
  Eclipse SDK	4.2.0.I20111108-2200
Comment 19 DJ Houghton CLA 2011-11-11 14:38:12 EST
This seems to be happening consistently for me on every startup. The Breakpoints view is showing but empty. I'm using the same build as in the previous comment. I won't update builds until I talk to Remy or Paul.
Comment 20 Remy Suen CLA 2011-11-14 16:33:27 EST
DJ, do you see this problem during regular use or only on startup? Though I expect you may also see it if you make a new workbench window (startup-ish code).
Comment 21 DJ Houghton CLA 2011-11-14 16:37:13 EST
I believe that it is only on started or when a view is first activated in a session.
Comment 22 Remy Suen CLA 2011-11-17 09:17:17 EST
I've fixed the startup problem.
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=40367ebc94e9431896b75c2d6780831975cb873b

I think there may be problems in a new workspace with a fresh debug session, taking a look...
Comment 23 Remy Suen CLA 2011-11-17 09:38:47 EST
(In reply to comment #22)
> I think there may be problems in a new workspace with a fresh debug session,
> taking a look...

This looks okay to me right now.
Comment 24 Remy Suen CLA 2011-12-08 14:09:44 EST
The startup case seems okay with I20111208-0200 on Windows 7.