Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Java: Open Implementation only opens the declaration
Java: Open Implementation only opens the declaration [message #1855685] Wed, 26 October 2022 21:38 Go to next message
Mark Hansen is currently offline Mark HansenFriend
Messages: 1
Registered: October 2022
Junior Member
I'm using Eclipse 2022-09 for Java developers on a Windows 10 PC.
I've noticed the following problem:

When viewing a Java source file, if I press the Ctrl key while hovering over a method that is referenced via an interface, I get a pop-up which allows me to select the following:
- Open Declaration
- Open Implementation
- Open Return Type

If I select Open Declaration, I'm taken directly to the Interface class. If I select Open Return Type, I'm taken directly to the class which implements the return type.
However, if I select Open Implementation, then I'm given another pop-up which looks to want to provide a list of implementing classes, but only shows the interface class. Clicking on that takes me to the interface class, not the implementation.

However, if I open the implementing class (using Ctrl+Shift+T or whatever to get the class open in the workbench) and then go back to the previous class, clicking on Open Implementation takes me directly to the method in the implementation class.

If I close the implementation class and do the operation again, the same problem occurs again.

I opened the Error Log view but no messages are provided when I perform these operations.

I've seen this from time to time with various previous versions of Eclipse as well, but was never able to determine why it was happening. Today, I noticed that if the target implementation class is already open, you can navigate to the implementation methods just fine, and if not open, you cannot.

To be clear, see the following example:

I create an Interface class, named A which contains the declaration of a method named foo().
I create an implementing class, named AImpl, which implements A and provide the implementation for method foo().
I create another Java class and from there I create a reference (via Spring Boot) to the service class:

@autowired private A servicea;

Within the class, I then write the following code:

servicea.foo();

Now, when I hover the mouse over "foo" and press the Ctrl key, I see what I've described above.

Re: Java: Open Implementation only opens the declaration [message #1855716 is a reply to message #1855685] Fri, 28 October 2022 07:18 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
I think it's best to report this as an issue:

https://github.com/eclipse-jdt/eclipse.jdt.ui/issues

But please make sure that someone else can reproduce the problem from the instructions you provide. It can't be fixed if it can't be reproduced...


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Maven projects created with J2SE-1.5
Next Topic:Constant Exceptions in log file
Goto Forum:
  


Current Time: Tue Apr 23 10:26:19 GMT 2024

Powered by FUDForum. Page generated in 0.02522 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top