Bug 81377 - [1.5][search] Semantics of search for methods with generics
Summary: [1.5][search] Semantics of search for methods with generics
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-16 06:04 EST by Markus Keller CLA
Modified: 2005-03-31 11:20 EST (History)
2 users (show)

See Also:


Attachments
Document describing search engine behavior while searching generic or parameterized methods (36.77 KB, text/html)
2005-02-27 17:57 EST, Frederic Fusier CLA
no flags Details
New version for document search engine behavior (37.81 KB, text/html)
2005-02-27 18:20 EST, Frederic Fusier CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2004-12-16 06:04:04 EST
This bug is meant to foster a discussion about the meaning of matchRules
R_ERASURE_MATCH and R_EQUIVALENT_MATCH when searching for generic methods.

I currently see three cases that need to be defined:

(1) Search for references to parameterized methods:
Declaration: <T> void foo(T t);
References: foo("Eclipse"), foo(new Integer(1))

(2) Search for references to method in parameterized type, where signature
contains the type's type parameter:
Declaration: interface List<E> ... { ... boolean add(E o); ... }
References:
- new ArrayList<String>.add("Eclipse")
- new ArrayList.add("Eclipse")
- new ArrayList.add(new Object())
- class StringList extends ArrayList<String> {
      public boolean add(String s) {..}
  }
  ... and client: new StringList.add("Eclipse");

(3) Search for references to method with generic parameter type:
Declarations: foo(List l), foo(List<String> l)
References: foo(new ArrayList<String>()), foo(new ArrayList())
Comment 1 Frederic Fusier CLA 2004-12-16 06:24:02 EST
ok with this three cases, but I would have named them:
1) Search for generic methods (ie. methods with type parameters)
2) Search for methods with type parameter arguments
3) Search for methods with parameterized type arguments

I don't know yet if additional cases 4)=1)+2) and 5)=1)+3) are specific or
already treated by previous ones...
Comment 2 Frederic Fusier CLA 2005-02-27 17:57:55 EST
Created attachment 18345 [details]
Document describing search engine behavior while searching generic or parameterized methods
Comment 3 Frederic Fusier CLA 2005-02-27 18:00:24 EST
Fixed.

I've attached document which describes this behavior and have to figure out how
to document it in eclipse...

[jdt-core-internal]
No new test case added. Only modify existing ones
(JavaSearchGenericMethod*Tests) to match described behavior
Comment 4 Frederic Fusier CLA 2005-02-27 18:20:19 EST
Created attachment 18347 [details]
New version for document search engine behavior
Comment 5 Markus Keller CLA 2005-03-02 03:55:51 EST
Case (2) is not implemented/documented yet, but that's the subject of bug 79990,
I think. The examples in case (2) also don't work because of bug 86293.
Comment 6 David Audel CLA 2005-03-31 11:20:33 EST
Verified in I20050330-0500