Bug 80914

Summary: [1.5][search] SearchPattern R_EQUIVALENT_MATCH matchRule does not work properly
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Frederic Fusier CLA 2004-12-14 05:46:36 EST
Using v_526.

It appears that specify R_EQUIVALENT_MATCH match rule for SearchPattern has no
effect. In fact search engine always works on this mode for generic types search
until R_ERASURE_MATCH is specified on search pattern.

So, searching List<Exception> without R_EQUIVALENT_MATCH match rule reports List
(raw type) and List<? extends Throwable> although it should not!
Comment 1 Frederic Fusier CLA 2004-12-14 07:25:58 EST
Fixed.

Now search engine handles R_EQUIVALENT_MATCH search pattern bit correctly.
Reminder: by default R_EQUIVALENT_MATCH and R_ERASURE bits are not set so only
perfect match will be reported. When R_EQUIVALENT_MATCH is set, it reports also
references which have an equivalent signature than pattern.
Also remind that R_ERASURE_MATCH overrides R_EQUIVALENT_MATCH bit and return all
references whose erasure matches the pattern (which obviously includes
equivalent signatures).

[jdt-core-internal]
Changes done in:
 - PatternLocator: add field isEquivalentMatch,
 - TypeReferenceLocator:
    -> #matchReportReference(Expression,IJavaElement,int,int,int,int,
        TypeBinding,MatchLocator)
    -> #matchReportImportRef(ImportReference,Binding,IJavaElement,int, 
        MatchLocator)
 - TypeReferencePattern: #typeParameterNames(IType)
Test cases added: class JavaSearchGenericTypeEquivalentTests
Comment 2 Olivier Thomann CLA 2004-12-14 15:17:57 EST
Verified in 200412140800