Bug 544929 - [navigation] resolve "implementation" for final fields set at declaration that override a method
Summary: [navigation] resolve "implementation" for final fields set at declaration tha...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.10   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2019-02-28 16:28 EST by Mickael Istria CLA
Modified: 2019-03-01 03:09 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2019-02-28 16:28:51 EST
This is another form of expressing bug 544888.
Initial story
```
I have org.eclipse.jface.text.contentassist.CompletionProposalOpen in Java editor.
I'm looking at a line of code that shows `fFilterRunnable.run();` and try a Ctrl+Click on the `run` method > Open Implementation.
As the field is final and private, I'd expect the (anonymous) type would be resolved and it would jump to the run(...) method implementation of this object.
Instead, the UI seems to compute a type hierarchy and shows it a popup, that doesn't even seem to include the anonymous type.
```

More generic, assume the following code
```
public class Foo {
  final Runnable r = new Runnable() {
     @Override public void run() { ... }
  };

  void method() {
     r.run();
  }
```

In this case, it would be great to have a Ctrl+Click > Open Implementation on `run()` dereference resolving to the method definintion a few lines above, given that
1. r is a final field
2. r is initialized during field declaration.