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

Bug 357127

Summary: Source hover does not show any source code
Product: [Eclipse Project] Platform Reporter: Maik Musall <maik>
Component: SWTAssignee: Lakshmi P Shanmugam <lshanmug>
Status: RESOLVED FIXED QA Contact: Silenio Quarti <Silenio_Quarti>
Severity: normal    
Priority: P3 CC: eclipse.felipe, kim.moir, lshanmug, markus.kell.r, michael, Olivier_Thomann, satyam.kandula, Silenio_Quarti, y29cheng
Version: 3.7Flags: Silenio_Quarti: review+
Target Milestone: 3.7.2   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
patch none

Description Maik Musall CLA 2011-09-08 13:27:37 EDT
Build Identifier: 20110615-0604

Shift-Hover does not show any source code as it used to in Eclipse 3.6. I tried all possible settings in the corresponding preference tab, but none of them yielded any source code display.

I confirmed this does *not* happen with Eclipse on win32, but it does on Mac 64.

Reproducible: Always

Steps to Reproduce:
1. shift-hover over any method call
Comment 1 Maik Musall CLA 2011-09-08 13:41:38 EDT
Additional remark: this bug was present with Mac OS X 10.6 and is still there with 10.7.
Comment 2 Olivier Thomann CLA 2011-09-09 09:27:46 EDT
Do you mean source code from the JDK or from your own source ?
Comment 3 Maik Musall CLA 2011-09-09 10:16:15 EDT
I mean my own source codes. The effect is that holding the Shift key does not make a difference, it looks like I wouldn't.
Comment 4 Satyam Kandula CLA 2011-09-12 02:37:32 EDT
I could reproduce the problem on Mac. Moving it to JDT/UI for further analysis.
Comment 5 Markus Keller CLA 2011-09-12 09:33:15 EDT
Cocoa, I suppose. The problem is that MouseHover events don't have their stateMask filled in (is always 0).

Broken in 3.7 and in I20110906-0905 (didn't check further back).
Comment 6 Felipe Heidrich CLA 2011-09-12 10:38:31 EDT
Lakshmi, please investigate.
Comment 7 Lakshmi P Shanmugam CLA 2011-09-13 08:30:50 EDT
It works fine in 3.6.2. Caused by the changes for bug 332083.
Comment 8 Lakshmi P Shanmugam CLA 2011-09-15 16:30:28 EDT
Created attachment 203453 [details]
patch

The patch puts back the code in Display. For the MouseHover event, it uses the currentEvent to get the stateMask but not the mouse location.
Silenio, can you please review?
Comment 9 George Cheng CLA 2011-09-23 17:16:57 EDT
The patch looks ok.

Another option would be to get the currentEvent in Widget.setInputState() when the event parameter is null.
Comment 10 Silenio Quarti CLA 2011-09-23 17:18:30 EDT
Comment above was done by me...
Comment 11 Lakshmi P Shanmugam CLA 2011-09-26 09:34:04 EDT
Modified the patch based on above comments and fixed --> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=cba9ee10aa6ad748491400bbc29d8d3ad5cdfba4
Thanks Silenio!
Comment 12 Maik Musall CLA 2011-09-28 04:45:44 EDT
Target Milestone 3.8 M3... does this mean there won't be a fix in 3.7 and this will stay unfixed until 2012?
Comment 13 Markus Keller CLA 2011-09-28 05:55:32 EDT
Too bad this was too late for 3.7.1, but I agree it's worth backporting to 3.7.2.
Comment 14 Lakshmi P Shanmugam CLA 2011-09-28 06:10:21 EDT
Reopening to fix this in 3.7.2.
Comment 15 Silenio Quarti CLA 2011-10-24 15:01:08 EDT
+1 for 3.7.2
Comment 16 Michael Brown CLA 2011-10-27 13:07:06 EDT
+1 for 3.7.2.

Is there any way I can get the patch above to my installation of 3.7.1? Is it available in a nightly build or similar?
Comment 17 Lakshmi P Shanmugam CLA 2011-10-28 02:58:12 EDT
Thanks Silenio!
Fixed in R3_7_maintenance branch for 3.7.2 --> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?h=R3_7_maintenance&id=201b8ca7b95929c38e81013b0e83dc557483eb82
Comment 18 Lakshmi P Shanmugam CLA 2011-10-28 03:31:27 EDT
(In reply to comment #16)
> +1 for 3.7.2.
> 
> Is there any way I can get the patch above to my installation of 3.7.1? Is it
> available in a nightly build or similar?
The patch will apply to 3.7.1 source, but you'll have to build it yourself.
The fix is now in the 3.7.2 branch, it should be available in the next 3.7 maintenance build. Also, the fix is already in the 3.8 stream (you can try the 3.8M3 build).
Comment 19 Maik Musall CLA 2011-10-28 03:42:43 EDT
As the original reporter of this bug: thank you all! I'm looking forward to 3.7.2.
Comment 20 Michael Brown CLA 2011-11-04 11:30:07 EDT
(In reply to comment #18)
> (In reply to comment #16)
> > +1 for 3.7.2.
> > 
> > Is there any way I can get the patch above to my installation of 3.7.1? Is it
> > available in a nightly build or similar?
> The patch will apply to 3.7.1 source, but you'll have to build it yourself.
> The fix is now in the 3.7.2 branch, it should be available in the next 3.7
> maintenance build. Also, the fix is already in the 3.8 stream (you can try the
> 3.8M3 build).

Is there a p2 update site for the 3.7.x maintenance builds? I don't seem to be able to find one that has the 3.7.x M20111102-0800 build which contains the fix for this bug. Apologies for asking the question here, but no one else seems to know this stuff.
Comment 21 Markus Keller CLA 2011-11-07 11:00:52 EST
Not sure if there's an official update site for 3.7.x M-builds.

You could try http://download.eclipse.org/eclipse/updates/3.7.x , but you have to uncheck "Group items by category" and choose the Eclipse Platform SDK manually.
Comment 22 Kim Moir CLA 2011-11-07 11:53:08 EST
Yes, there is a p2 repo for maintenance builds

http://download.eclipse.org/eclipse/updates/3.7.x

http://wiki.eclipse.org/Eclipse_Project_Update_Sites