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

Bug 513524

Summary: [regression] Can't navigate to super via left ruler annotation
Product: [Eclipse Project] JDT Reporter: Andrey Loskutov <loskutov>
Component: DebugAssignee: Andrey Loskutov <loskutov>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert, kevintownsend4219, stephan.herrmann
Version: 4.7   
Target Milestone: 4.7 M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/92857
Whiteboard:
Bug Depends on:    
Bug Blocks: 498428    

Description Andrey Loskutov CLA 2017-03-11 17:12:55 EST
Using 4.7 M6.
Open any class implementing or extending class or interface. In any method overriding or implementing super interface, try to click on the triangle on the left ruler => no effect at all.

Example class: navigation doesn't work neither for toString() nor for run().

public class A implements Runnable {
	@Override
	public String toString() {
		return super.toString();
	}

	@Override
	public void run() {
	}
}


This works fine in 4.6.2. For me this is a major regression, I really get used to navigate to super method via ruler icon.
Comment 1 Stephan Herrmann CLA 2017-03-11 18:03:54 EST
Still works in M5

Next experiment: SDK M5 plus JDT (core & ui) M6: works!

In order to get JDT/UI M6 to run on SDK M5 I only had to revert commit cc0cefa711d12e200790950c1a22bc292f30fd6c to get it to compile against older platform
Comment 2 Stephan Herrmann CLA 2017-03-11 18:21:29 EST
And for the final experiment: SDK M6 plus the JDT minus commit cc0cefa711d12e200790950c1a22bc292f30fd6c (the one I had to revert for comment 1): BROKEN.

Ergo: Not a JDT issue.
Comment 3 Andrey Loskutov CLA 2017-03-11 18:23:44 EST
(In reply to Stephan Herrmann from comment #1)
> Still works in M5
> 
> Next experiment: SDK M5 plus JDT (core & ui) M6: works!

Interesting. So I've reset platform.text to M5 and the bug is still there, so it is not platform.text too.

Has anyone any idea who implement this click handler? I see that the mouse changes the cursor while hovering over the rectangle, so someone seem to react on the triangle at least on hovering.
Comment 4 Andrey Loskutov CLA 2017-03-12 03:01:17 EDT
This was commit https://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=3ed1d1d5c87ffc437745c32a11bfece794c861ee.

Reverting it fixes the issue.
Comment 5 Andrey Loskutov CLA 2017-03-12 04:16:54 EDT
(In reply to Andrey Loskutov from comment #3)
> Has anyone any idea who implement this click handler?

To answer this, put a breakpoint under org.eclipse.ui.texteditor.AbstractTextEditor.getRulerMouseListener() and there in the mouseUp() handler. The base action is SelectMarkerRulerAction and the (desired) concrete action in our case is JavaSelectAnnotationRulerAction.

Regarding the current problem solution: given the fact that two action contributions to the "editorContribution" point exist with actionID="RulerClick" (one from jdt.ui and one from debug.ui), we can't implement single click editor ruler actions in the jdt.debug.ui without breaking jdt.ui contribution or vise-versa, because "there can be only one". See 
org.eclipse.ui.texteditor.AbstractTextEditor.findContributedAction(String).

It means, the implementation in org.eclipse.debug.ui.actions.RulerToggleBreakpointActionDelegate can't be directly used in jdt.debug.ui, instead, if we still want to implement bug 498428, jdt.debug.ui action contribution should use their custom handler which would decide if the "open super" or "run to line" is more appropriate for the current context and then run the concrete handler. Another possibility would be to introduce a new "I'm the default" argument for the editorContribution actions contributions... 

I don't have an idea now which solution is the right one.

I would do two things now: revert the offending commit and reopen bug 498428 for discussion which way the feature should be implemented.
Comment 6 Andrey Loskutov CLA 2017-03-13 03:47:55 EDT
Verified fixed in I20170312-2000.
Comment 7 Noopur Gupta CLA 2017-03-13 04:25:42 EDT
*** Bug 513501 has been marked as a duplicate of this bug. ***