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

Bug 257919

Summary: [Viewers] OwnerDraw: Open type doesn't display the selected type
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Boris Bokowski <bokowski>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, daniel_megert, dj.houghton, francisu, markus.kell.r, remy.suen, Silenio_Quarti, steffen.pingel
Version: 3.5   
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Open Type capture
none
Open Type KeysPreferencePa
none
Screenshot to depict the oddity in question.
none
Patch to remove bug 228965's hacks.
none
patch none

Description Paul Webster CLA 2008-12-08 08:44:02 EST
Created attachment 119780 [details]
Open Type capture

This happens about once an hour, and when it happens it is reproducible.  I20081202-1812

I have platform-ui, platform-ui-tests, and platform-ui-examples checked out in my workspace, and go to the Plug-ins view and add all the plugins to the java search path.

I have EclipseEnvironmentInfo.class open, and do a CTRL+SHIFT+T.  When I type in my class "GlobalizationPref", it doesn't display it as found (but something else).  But if I hit ENTER, it will open the correct class, and it looks like the status at the bottom is pointing to the correct plugin.

Once it is in the remembered history, it displays the correct class.

PW
Comment 1 Dani Megert CLA 2008-12-08 10:57:58 EST
>This happens about once an hour, and when it happens it is reproducible. 
>I20081202-1812
When it happens does it then not select any type or can it be restricted to e.g. binary types (like in the screen shot)?

Anything in .log?

Might be related to bug 208028 (which is also on Linux).

Hard to track down with steps.
Comment 2 Paul Webster CLA 2008-12-08 11:06:28 EST
(In reply to comment #1)
> >This happens about once an hour, and when it happens it is reproducible. 
> >I20081202-1812
> When it happens does it then not select any type or can it be restricted to
> e.g. binary types (like in the screen shot)?

I was able to reproduce this in a different workspace (platform-ui modules and then all plugins added to the java search path).

Goto EclipseEnvironmentInfo and then open type and search for GlobalizationPref.  Waited a while so there was no race with the open type dialog.

I was also able to do it with KeyPreferencePa (to select KeyPreferencePage), and that involved 3 .java files in my workspace.

Hitting enter in all cases will open the correct type.

PW
Comment 3 Dani Megert CLA 2008-12-15 12:32:53 EST
Paul, I tried your steps with 3.5 M4 and a fresh workspace but no luck (at least not on WindowsXP). Will try on Linux-GTK tomorrow.
Comment 4 Dani Megert CLA 2008-12-16 05:42:18 EST
I'm sorry can also not reproduce on Linux-GTK.

We can keep the bug open but unless we have reproducible steps we can't do anything here.
Comment 5 Paul Webster CLA 2008-12-16 07:41:07 EST
(In reply to comment #4)
> I'm sorry can also not reproduce on Linux-GTK.
> 
> We can keep the bug open but unless we have reproducible steps we can't do
> anything here.

I do see it regularly, but its in my build350 workspace ... I'll download a fresh M4 copy and try and reproduce in a totally clean workspace.

PW
Comment 6 Paul Webster CLA 2008-12-16 09:18:11 EST
Created attachment 120568 [details]
Open Type KeysPreferencePa

Still reproducible for me:

1) I downloaded eclipse-SDK-3.5M4-linux-gtk.tar.gz and expanded it in a new directory
2) I launched eclipse with eclipse/eclipse -data workspaces/openType350 I've included the java version at the end.
3) open the CVS Repo Exploring perspective
4) add my repo, :extssh:pwebster@dev.eclipse.org:/cvsroot/eclipse
5) expand HEAD, check out platform-ui, platform-ui-examples, platform-ui-tests
6) select Run in background, and when asked to overwrite/replace, click "Yes to All"
7) after the build, close cocoa, carbon, and win32 fragments
8) use Open Type to open "EclipseEnvironmentInfo" (works fine)
9) use Open Type "GlobalizationPref" ... I still get the first picture I attached
10) cancel and use Open Type "KeysPreferencePa" and I get this open type dialog

(at least I'm not losing my mind :-)


java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pxi32dev-20080315 (SR7))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20080315 (JIT enabled)
J9VM - 20080314_17962_lHdSMr
JIT  - 20080130_0718ifx2_r8
GC   - 200802_08)
JCL  - 20080314
Comment 7 Dani Megert CLA 2009-01-29 07:16:17 EST
Paul, so far still no luck on WindowsXP and Linux-GTK. Some questions:

>2) I launched eclipse with eclipse/eclipse -data workspaces/openType350 I've
>included the java version at the end.
Is this a new workspace or an existing one?

>7) after the build, close cocoa, carbon, and win32 fragments
This means you wait until everything is checked out and the builder is completely done, right? Is there Java indexer still running?

>8) use Open Type to open "EclipseEnvironmentInfo" (works fine)
What exactly do you enter and how do you close the dialog?

In a previous comment you wrote: "all plugins added to the java search path". This is not mentioned (and not needed?) by the steps from comment 6?


Markus, can you give it a try as well. Maybe I'm doing one obvious step different than Paul.
Comment 8 Paul Webster CLA 2009-01-29 09:46:09 EST
(In reply to comment #7)
> Paul, so far still no luck on WindowsXP and Linux-GTK. Some questions:
> 
> >2) I launched eclipse with eclipse/eclipse -data workspaces/openType350 I've
> >included the java version at the end.
> Is this a new workspace or an existing one?

This was a new workspace.


> >7) after the build, close cocoa, carbon, and win32 fragments
> This means you wait until everything is checked out and the builder is
> completely done, right? Is there Java indexer still running?

Yes, all the building is done.  The Java indexer might have been running in that case, but I have the same problem demonstrated by attachement #120568 today with I20090129-0100, and my workspace has been up for an hour.


> >8) use Open Type to open "EclipseEnvironmentInfo" (works fine)
> What exactly do you enter and how do you close the dialog?

I'm typing it in by hand (I get about EclipseEnv far) and then simply hit ENTER (no down arrow or anything like that).

> In a previous comment you wrote: "all plugins added to the java search path".
> This is not mentioned (and not needed?) by the steps from comment 6?

Correct, I don't need the plugins in java search to reproduce this problem.

> Markus, can you give it a try as well. Maybe I'm doing one obvious step
> different than Paul.

I'll go through comment #6 with a fresh workspace and confirm the steps still reproduce the problem.

PW


Comment 9 Paul Webster CLA 2009-01-29 10:15:43 EST
OK, I ran I20090129-0100 with a blank workspace and followed the steps from comment #6 and was able to reproduce the problem (I'm not making this up, I swear :-)

1) I downloaded eclipse-SDK-3.5M4-linux-gtk.tar.gz and expanded it in a new
directory
2) I launched eclipse with eclipse/eclipse -data workspaces/openType350 I've
included the java version at the end.
3) open the CVS Repo Exploring perspective
4) add my repo, :extssh:pwebster@dev.eclipse.org:/cvsroot/eclipse
5) expand HEAD, check out platform-ui, platform-ui-examples, platform-ui-tests
6) select Run in background, and when asked to overwrite/replace, click "Yes to
All"
7) after the build, close cocoa, carbon, and win32 fragments
8) use Open Type to open "EclipseEnvironmentInfo" (works fine)
9) use Open Type "GlobalizationPref" ... I still get the first picture I
attached
10) cancel and use Open Type "KeysPreferencePa" and I get this open type dialog


After #6, I waited for 10 minutes to let the system settle down.  When I ran the steps in a different workspace and skipped step 7 I did not have the problem.

PW
Comment 10 Markus Keller CLA 2009-01-29 13:21:57 EST
I also tried it on Linux/GTK with the exact build and VM you mentioned. Unfortunately, I also couldn't reproduce (but I do believe that you didn't fake the screenshots;-).

> 9) use Open Type "GlobalizationPref" ... I still get the first picture
So your list skipped the step that explains how a class from org.eclipse.gmf.* can show up in a workspace on a fresh SDK install?

Could you try it on a Windows machine? That would tell whether it's an OS issue or a timing problem that only shows up with your speed of interaction.

I'm not really fast in typing camelCased type names. If you're a speedster on the keyboard, could you try whether you can still reproduce it when you type slower?
Comment 11 Paul Webster CLA 2009-01-29 13:33:46 EST
(In reply to comment #10)
> > 9) use Open Type "GlobalizationPref" ... I still get the first picture
> So your list skipped the step that explains how a class from org.eclipse.gmf.*
> can show up in a workspace on a fresh SDK install?

Oh, I'm aiming for the GlobalizationPref* in com.ibm.icu ... the first time I ran it it was in my e4 workspace (lots of stuff).  With just the SDK, it shows GlobalBuildAction (org.eclipse.ui.actions) instead of GlobalizationPreferences (and I just didn't add another picture :-)

> Could you try it on a Windows machine? That would tell whether it's an OS issue
> or a timing problem that only shows up with your speed of interaction.

I'll go run this with Eric.


> I'm not really fast in typing camelCased type names. If you're a speedster on
> the keyboard, could you try whether you can still reproduce it when you type
> slower?

I am fast :-) but even if I type slowly (hunt and peck) I can reproduce.

PW
Comment 12 Dani Megert CLA 2009-02-02 02:50:53 EST
*** Bug 263179 has been marked as a duplicate of this bug. ***
Comment 13 Dani Megert CLA 2009-02-02 03:05:02 EST
Francis, you're on Linux right? Remy, you too? We suspect a race condition which we are not able to reproduce on our machine. I guess we the only way to get closer to it is debugging on Paul's machine, as he has a reproducible test case.
Comment 14 Francis Upton IV CLA 2009-02-02 03:08:03 EST
(In reply to comment #13)
> Francis, you're on Linux right? Remy, you too? We suspect a race condition
> which we are not able to reproduce on our machine. I guess we the only way to
> get closer to it is debugging on Paul's machine, as he has a reproducible test
> case.
> 

Yes, I run fedora 10 (or 9 I forget which) on a fast dual core machine.  SO a race condition would easily show up.
Comment 15 Remy Suen CLA 2009-02-02 09:55:38 EST
(In reply to comment #13)
> Francis, you're on Linux right? Remy, you too?

Yeah, I run Gentoo. I believe I was seeing the 'Open Resource' problem on XP though.
Comment 16 Remy Suen CLA 2009-02-18 23:04:19 EST
Created attachment 126109 [details]
Screenshot to depict the oddity in question.

(In reply to comment #15)
> I believe I was seeing the 'Open Resource' problem on XP though.

I'm seeing this on 'Open Type' too now (on Linux). I'm on a T61 running a Core 2 Duo processor. The build I'm using is I20090217-2200.

I've tried to debug this problem myself but I'm not really getting anywhere over here. :( As you can see from the screenshot, I'm getting the same kind of thing that Paul observes.

I altered TableViewerRow's setText(int, String) method to output the string prior to setting it in the table's item.

CheckoutM:
CheckoutMap
CheckoutMap
CheckoutMap - org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckout
CheckoutMap - org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckout
CheckoutMultipleProjectsOperation
CheckoutMap - org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckout

CheckoutMu:
CheckoutMultipleProjectsOperation
CheckoutMultipleProjectsOperation
CheckoutMultipleProjectsOperation - org.eclipse.team.internal.ccvs.ui.operations
CheckoutMultipleProjectsOperation - org.eclipse.team.internal.ccvs.ui.operations
CheckoutMultipleProjectsOperation - org.eclipse.team.internal.ccvs.ui.operations

It _appears_ that there is no problem with the text but reality appears to contradict this. What's even more odd is that the image is actually correct! I'd be willing to spare some cycles putting breakpoints and print statements here and there if anyone has any ideas as to what I should look into.
Comment 17 Dani Megert CLA 2009-02-19 02:06:00 EST
If the text is right then there's a problem with owner draw. Can you guys disable colored labels (Appearance pref page) and check whether the problem goes away?
Comment 18 Paul Webster CLA 2009-02-19 07:52:47 EST
(In reply to comment #17)
> If the text is right then there's a problem with owner draw. Can you guys
> disable colored labels (Appearance pref page) and check whether the problem
> goes away?

The problem went away as soon as I disabled coloured labels. ... I guess this is going to owner draw :-)

PW
Comment 19 Remy Suen CLA 2009-02-19 09:38:37 EST
(In reply to comment #18)
> (In reply to comment #17)
> > If the text is right then there's a problem with owner draw. Can you guys
> > disable colored labels (Appearance pref page) and check whether the problem
> > goes away?
> 
> The problem went away as soon as I disabled coloured labels. ... I guess this
> is going to owner draw :-)

Goes away for me too, thanks Dani. *starts debugging owner draw code*
Comment 20 Remy Suen CLA 2009-02-19 10:04:35 EST
Created attachment 126169 [details]
Patch to remove bug 228965's hacks.

Boris, if I remove the code that's in StyledCellLabelProvider that's for bug 228965, I no longer get this drawing problem. However, when I run your attachment 97479 [details], I still get the incorrect behaviour. :O
Comment 21 Remy Suen CLA 2009-02-19 10:05:25 EST
(In reply to comment #20)
Damn, I mean bug 228695.
Comment 22 Francis Upton IV CLA 2009-03-05 19:53:50 EST
*** Bug 267278 has been marked as a duplicate of this bug. ***
Comment 23 Paul Webster CLA 2009-03-05 21:00:07 EST
*** Bug 267132 has been marked as a duplicate of this bug. ***
Comment 24 Boris Bokowski CLA 2009-03-06 15:52:09 EST
I should try to fix this for M6. Will try on Monday.
Comment 25 Remy Suen CLA 2009-03-10 11:54:25 EDT
*** Bug 267856 has been marked as a duplicate of this bug. ***
Comment 26 Boris Bokowski CLA 2009-03-10 17:46:43 EDT
back to me...

Comment 27 Boris Bokowski CLA 2009-03-10 17:50:02 EDT
Created attachment 128286 [details]
patch

preliminary patch, this should fix the problems we are seeing but needs to be revisited in M7 for a proper fix.
Comment 28 Boris Bokowski CLA 2009-03-10 17:52:56 EDT
Fix released to HEAD.
Comment 29 Boris Bokowski CLA 2009-03-10 17:53:26 EDT
Will open a new bug for M7 when I verify this one.
Comment 30 Dani Megert CLA 2009-03-11 04:19:45 EDT
>Will open a new bug for M7 when I verify this one.
Please post the bug number here when available, or add me to the cc list. Thanks.