Bug 94267 - [1.5][select] Selecting type parameter in binary answer match on line 0
Summary: [1.5][select] Selecting type parameter in binary answer match on line 0
Status: VERIFIED FIXED
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.1 RC1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-10 07:03 EDT by Philipe Mulet CLA
Modified: 2005-05-27 06:07 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 Philipe Mulet CLA 2005-05-10 07:03:34 EDT
Build 20050509-2010

- Open editor on file java.lang.reflect.Constructor.class (with attached sources).
- Select 2nd or 3rd occurrence of 'T' on line 573 :
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
                              ^                     ^

- Press F3: the editor goes to line 0, where I would have expected the type
parameter T to be selected instead (#getAnnotation is a generic method).
Comment 1 David Audel CLA 2005-05-18 06:49:59 EDT
SelectionEngine return the correct JavaElement but the source range of this
element is false ([offset=0, length=1]).

I found some problems:
- getSourceRange() does not use the source mapper if the type parameter is
inside a binary type or method.
- SourceMapper does not compute source range for type parameters
Comment 2 Olivier Thomann CLA 2005-05-25 15:23:07 EDT
Fixed and released in HEAD.
I checked that the steps to reproduce are working fine, but I don't know how to
add a regression test.
Comment 3 Olivier Thomann CLA 2005-05-25 15:24:02 EDT
Changes in org.eclipse.jdt.internal.core.SourceMapper and
org.eclipse.jdt.internal.core.TypeParameter.
Comment 4 Frederic Fusier CLA 2005-05-27 06:07:21 EDT
Verified for 3.1 RC1 with build I20050527-0010.