Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 266443 - [navigation] JavaElementImplementationHyperlink does not work for method declarations
Summary: [navigation] JavaElementImplementationHyperlink does not work for method decl...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Raksha Vasisht CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-27 04:12 EST by Dani Megert CLA
Modified: 2009-03-09 13:43 EDT (History)
1 user (show)

See Also:
markus.kell.r: review+


Attachments
Patch with the fix. Calculates the reciever type for method declarations. (1.35 KB, patch)
2009-03-06 05:13 EST, Raksha Vasisht CLA
markus.kell.r: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2009-02-27 04:12:23 EST
HEAD.

The JavaElementImplementationHyperlink does not work for method declarations: it always opens the Quick Hierarchy.
Comment 1 Raksha Vasisht CLA 2009-03-06 05:13:59 EST
Created attachment 127793 [details]
Patch with the fix. Calculates the reciever type for method declarations.
Comment 2 Markus Keller CLA 2009-03-06 09:15:36 EST
The patch works fine for the declaration of an abstract method, but I find it strange that it still opens the quick hierarchy when I try to open an overriding implementation of a non-abstract method.

E.g. on declaration A#method(), it's obvious that A#method() must be an implementation, so why don't we just jump to B#method()?

public class Try {
	abstract class A {
//		public abstract void method();
		public void method() {}
	}
	
	public static class B extends A {
		public void method() {}
		
		void xx() {
			super.method();
		}
	}
}

If you agree to not count the click target itself as an implementation, then the same exclusion should probably be made for super.method(), where it's also clear that the click target would be an implementation itself, but the user probably wants to jump to a sub-implementation.
Comment 3 Dani Megert CLA 2009-03-09 08:54:59 EDT
>E.g. on declaration A#method(), it's obvious that A#method() must be an
>implementation, so why don't we just jump to B#method()?
This would be strange. Either we do a Ctrl+T or nothing. I prefer Ctrl+T.
Comment 4 Markus Keller CLA 2009-03-09 13:32:04 EDT
Thanks, released to HEAD.

Filed bug 267682 for the super invocation, since that's different from the declaration case.