Bug 138010 - Wrong overloaded method version shown when undefined argument is used
Summary: Wrong overloaded method version shown when undefined argument is used
Status: RESOLVED DUPLICATE of bug 116573
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-21 13:26 EDT by Michael Schneider CLA
Modified: 2006-04-21 13:40 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Schneider CLA 2006-04-21 13:26:55 EDT
There seams to be an error in the mechanism, which is responsible for finding the correct code position, when opening a method declation (by pressing F3).

Given the following class definition with an overloaded method: A no-arg version and a one-arg version of this method:

  public class C {
    /** * The overloaded method with no args. */
    public void overloadedMethod() { /* ... */ }
    
    /** * The overloaded method with one arg. */
    public void overloadedMethod(int i) { /* ... */ }
  }

Now call those methods from some other place in the following way:

  overloadedMethod();
  // OK: F3 jumps to no-arg version #overloadedMethod()

  overloadedMethod(42);
  // OK: F3 jumps to one-arg version #overloadedMethod(int)
        
  overloadedMethod(UNDEFINED_VARIABLE);  
  // WRONG: F3 jumps to no-arg version #overloadedMethod()

The first two calls are thought to be correct calls. The third call is thought to have an undefined variable name as its argument. This of course results in a compile error, but you should at least be able to open the declaration of the method by pressing F3, when the cursor is above the method call. But this is _not_ the case! In fact, when you try to open the method declaration, you will jump to the declaration of the _no-arg_ version. 

BTW: The analog problem occurs for the Javadoc View (Menu: Window->Show View->Javadoc): The no-arg version is described when the cursor is above the method call, which uses the undefined argument.
Comment 1 Olivier Thomann CLA 2006-04-21 13:40:16 EDT

*** This bug has been marked as a duplicate of 116573 ***