Bug 84245 - Navigation from "concrete generic methods"
Summary: Navigation from "concrete generic methods"
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-02 12:28 EST by Dirk Baeumer CLA
Modified: 2009-08-30 02:42 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2005-02-02 12:28:14 EST
Consider the following example:

class A<E> {
  <T> void concat(A<E>, A<T>)
}

A<String> myA;

myA.concat(p1, p2). 

Navigating with the method binding representing concat in myA.concat(....) will
take you directly to A<E>#<T>concat(A<E>, A<T>). However it should take you
first to A<String>#<T>concat(A<String, A<T>) from which we then can navigate to
A<E>#<T>concat(A<E>, A<T>).
Comment 1 Dirk Baeumer CLA 2005-02-02 12:29:51 EST
Forget to mention that I am talking about IMethodBinding#getMethodDeclaration
Comment 2 Dirk Baeumer CLA 2005-02-02 12:30:22 EST
Alternatively we could have a second method.
Comment 3 Martin Aeschlimann CLA 2005-02-02 12:37:11 EST
IMO it's better to have getMethodDeclaration navigate directly to
A<E>#<T>concat(A<E>, A<T>). That's for me the only one I really need to know
(e.g. when I want to find the declaration node with
compilationRoot.findDeclaringNode(binding)
Comment 4 Philipe Mulet CLA 2005-02-02 12:44:29 EST
I think you need both, and per contract #getMethodDeclaration() is doing the
right thing for many clients. You would want an extra one to reach the
intermediate one... #getGenericMethod() ? might be hard to come up with a pretty
name.
Comment 5 Philipe Mulet CLA 2005-02-02 12:57:51 EST
Maybe, as suggested in title, #getConcreteGenericMethod() ?
or more subtle: #getInstantiatedMethod() ?
Comment 6 Dirk Baeumer CLA 2005-02-02 13:15:38 EST
What's about getParameterizedMethodDeclaration. This would somehow indicate that
we are navigating to a parameterized type.
Comment 7 Markus Keller CLA 2005-02-07 06:31:09 EST
Note that this "stepwise type variable un-substitution" is in general not only a
two-step navigation, since each enclosing type or method can declare more type
variables. E.g. for

    class Outer<O> {
        class A<E> {
            <T> void concat(A<O> o, A<E> e, A<T> t) {}
        }
    }

and

    Outer<Double>.A<String> myA;
    myA.concat(p1, p2, p3);

, we have three steps towards the method declaration:
    Outer<Double>.A<String>#<Integer>concat(...)
    Outer<Double>.A<String>#<T>concat(...)
    Outer<Double>.A<E>#<T>concat(...)
    Outer<O>.A<E>#<T>concat(...)

However, I currently don't have a better name for this either...
Comment 8 Philipe Mulet CLA 2006-02-03 05:07:56 EST
Is this still an issue ? Internal bindings allow to find both methods.
Comment 9 Markus Keller CLA 2006-02-03 09:26:40 EST
We currently don't need this method for 3.2, but I think it would still be handy to have it some time in the future.

Another name suggestion: getGeneralizedMethod().
Comment 10 Olivier Thomann CLA 2006-04-20 13:19:12 EDT
Defer post 3.2 since this requires an API addition.
Comment 11 Eclipse Webmaster CLA 2009-08-30 02:42:25 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.