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

Bug 415359

Summary: "Open Declaration" gets confused with overloads for multiple classes of the same name
Product: [Eclipse Project] JDT Reporter: Zorzella Mising name <zorzella>
Component: CoreAssignee: ANIRBAN CHAKRABORTY <anchakrk>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: srikanth_sankaran
Version: 4.3   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Zorzella Mising name CLA 2013-08-19 12:59:44 EDT
If there's, say, two overloads of a method "foo", each that take a different class named, say, Key (from different packages), Eclipse gets confused when navigating.

In the example below (need three classes, in different packages as given), selecting either the first foo or the second foo and hitting F3 brings a dialog asking which "foo" I want. Ctrl-clicking also misbehaves -- ctrl-clicking on either call to "foo" takes the editor to the first overload, i.e. the one that takes a.Key (BTW, I encountered this when using ObjectifyFactory.getMetadata, where the quirk manifests slightly differently, but it's essentially the same thing -- in that case, both Ctrl-clicking and F3 would take me to one of the overloads). All that despite the fact there is no ambiguity about which overload is appropriate. So much so that the correct overload gets highlighted if you have "Mark Occurences" toggled on.

***********
public class Confused {

  private void foo(a.Key k) {}
  private void foo(b.Key k) {}
  
  private void bar() {
    a.Key ak = new a.Key();
    b.Key bk = new b.Key();
    
    foo(ak); // first foo
    foo(bk); // second foo
  }
}
************
package a;

public class Key {}
***********
package b;

public class Key {}
***********
Comment 1 Eclipse Genie CLA 2020-02-08 11:56:00 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.