eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
36 stars 87 forks source link

Method parameter tooltip offers wrong class #1471

Open robertyoudan opened 3 months ago

robertyoudan commented 3 months ago

When mousing over a parameter type declaration, the tooltip offers up an unrelated class; not reachable by current package and imports and misses the correct class which is declared in the current file/class. eclipseerror

jjohnstn commented 3 months ago

@robertyoudan Which version of Eclipse are you using? I tried a similar generic abstract class with an inner static interface called Callback and I get the correct inner interface referred to. When I do completion on Callback, I see the inner interface first and then the javax.security one after. Are there any error markers in your file or are you using some add-on plug-ins?

robertyoudan commented 3 months ago

@robertyoudan Which version of Eclipse are you using? I tried a similar generic abstract class with an inner static interface called Callback and I get the correct inner interface referred to. When I do completion on Callback, I see the inner interface first and then the javax.security one after. Are there any error markers in your file or are you using some add-on plug-ins?

Thanks for your reply. I believe it was the current version (4.32) but there's a small possibility it was 4.31. No build errors. I will try to reproduce today (using 4.32).

robertyoudan commented 3 months ago

Yep. Still does it with the current version. No build errors. Latest Temurin JDK (21.0.3.9-hotspot). Note when I get rid of the "..." it only finds the correct interface.

iloveeclipse commented 3 months ago

Ideally you should provide a simple project (with settings) demonstrating the problem.

robertyoudan commented 3 months ago

Ideally you should provide a simple project (with settings) demonstrating the problem.

Believe me; if it was that simple I would have! This is part of a huge project so I will need to spend some time "de-coupling" the hierarchy,

robertyoudan commented 3 months ago

I just noticed another seemingly unrelated side effect. I have one codebase without the Callback parameter and one with it still included. The type hierarchy of an unrelated class has extra descendants that actually have NO RELATIONSHIP with the type hierarchy! See screenshot. Once the Callback class and parameters are removed, the erroneous descendants disappear!

image

NOTE: the DrawingFilter interface extends NOTHING.