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

Bug 311725

Summary: Eclipse hangs when clicking on the open type/implementation hover
Product: [Eclipse Project] Platform Reporter: Lakshmi P Shanmugam <lshanmug>
Component: TextAssignee: Markus Keller <markus.kell.r>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert, markus.kell.r, skovatch
Version: 3.6Flags: daniel_megert: review+
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Bug Depends on: 308844, 311741    
Bug Blocks:    
Attachments:
Description Flags
screenshot showing extra row space in the hover
none
full thread dump
none
Fix daniel_megert: review+

Description Lakshmi P Shanmugam CLA 2010-05-05 09:54:14 EDT
Steps to reproduce:
1) Ctrl + click on the method name to open the 'open type' hover.
2) the table in the hover has extra space below the Open Implementation almost equal to a row. 
3) Click on the space below open implementation.
4) Eclipse hangs. 

I could reproduce this on OSX 10.5. I just upgraded to 10.6 and can't see it anymore.
Will attach the screen shot and stack trace soon.

Build: 3.6M7
Comment 1 Dani Megert CLA 2010-05-06 03:21:35 EDT
>2) the table in the hover has extra space below the Open Implementation almost
>equal to a row. 
See bug 311741.
Comment 2 Lakshmi P Shanmugam CLA 2010-05-06 03:40:59 EDT
Created attachment 167270 [details]
screenshot showing extra row space in the hover
Comment 3 Lakshmi P Shanmugam CLA 2010-05-06 06:51:13 EDT
Created attachment 167282 [details]
full thread dump
Comment 4 Lakshmi P Shanmugam CLA 2010-05-06 11:00:08 EDT
I debugged through this. Looks like the hang is happening in the Listener code due to an exception. Will post the stacktrace next.
Comment 5 Lakshmi P Shanmugam CLA 2010-05-06 11:18:33 EDT
AIOBE is happening in Listener code. Moving to platform UI.

java.lang.ArrayIndexOutOfBoundsException: 0
	at org.eclipse.jface.text.hyperlink.MultipleHyperlinkPresenter$LinkListInformationControl.openSelectedLink(MultipleHyperlinkPresenter.java:318)
	at org.eclipse.jface.text.hyperlink.MultipleHyperlinkPresenter$LinkListInformationControl.access$1(MultipleHyperlinkPresenter.java:317)
	at org.eclipse.jface.text.hyperlink.MultipleHyperlinkPresenter$3.widgetSelected(MultipleHyperlinkPresenter.java:278)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3756)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1343)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1366)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1351)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1163)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3601)
	at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:4457)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4717)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1001)
	at org.eclipse.swt.widgets.Table.mouseDownSuper(Table.java:1927)
	at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:997)
	at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2222)
	at org.eclipse.swt.widgets.Table.mouseDown(Table.java:1909)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4954)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1919)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2007)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5018)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4560)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4637)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3253)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2601)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2565)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2399)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:669)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:662)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 6 Dani Megert CLA 2010-05-06 11:23:52 EDT
Lakshmi, I have two questions:
1. why is the first stack trace from comment 3 different?
2. why does SWT hang? Besides the ArrayIndexOutOfBoundsException I still think
   there's a bug in SWT bug: it shouldn't hang due to that

Markus, can you take a look at this along with bug 311741? Thanks.
Comment 7 Scott Kovatch CLA 2010-05-06 12:57:13 EDT
(In reply to comment #6)

> 2. why does SWT hang? Besides the ArrayIndexOutOfBoundsException I still think
>    there's a bug in SWT bug: it shouldn't hang due to that

Yes, that's bug 308844, which I hope to address for 3.6.
Comment 8 Lakshmi P Shanmugam CLA 2010-05-07 03:57:51 EDT
> Lakshmi, I have two questions:
> 1. why is the first stack trace from comment 3 different?
Hi Dani,
I had to add a catch block around the code that calls the Listener handle event to get the exception in comment #5. Without that it just hangs at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper (the stack trace is same till here)
Comment 9 Markus Keller CLA 2010-05-07 04:46:46 EDT
Need to see what SWT can do for bug 311741 and bug 308844.

Maybe we have to hack around this. SWT.NO_SCROLL would be an option, but that would not be nice on other platforms (including Mac OS X 10.6, which we cannot distinguish from 10.5).

Or we protect all calls to "fTable.getSelection()[0]" in MultipleHyperlinkPresenter.
Comment 10 Markus Keller CLA 2010-05-09 11:44:07 EDT
Created attachment 167627 [details]
Fix

Fixes the AIOOBE and thus avoids the hanging up (bug 308844).

Does not hack around the scrollbars issue, since that's an SWT problem and only affects 10.5 (bug 311741).
Comment 11 Markus Keller CLA 2010-05-09 11:45:24 EDT
Dani, OK for RC1?
Comment 12 Dani Megert CLA 2010-05-10 02:43:14 EDT
+1 for RC1.
Comment 13 Markus Keller CLA 2010-05-10 08:30:38 EDT
Released fix from comment 10 to HEAD.
Comment 14 Markus Keller CLA 2010-05-17 04:54:17 EDT
Verified in I20100516-0800.
Comment 15 Dani Megert CLA 2010-05-17 08:27:47 EDT
Setting to VERIFIED (see comment 14).