Summary: | Search reporting invalid inaccurate match | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Philipe Mulet <philippe_mulet> | ||||
Component: | Core | Assignee: | Jerome Lanneluc <jerome_lanneluc> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 2.1 | ||||||
Target Milestone: | 2.1 M5 | ||||||
Hardware: | PC | ||||||
OS: | Windows 2000 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Philipe Mulet
2003-01-13 05:18:25 EST
Created attachment 2954 [details]
BlockScope.java
SingleTypeReference.resolveType is null, thus the MatchLocator can only report an inaccurate match. Simpler test case: 1. Create the following cu in default package: public class A { public void foo() { A a; } public void bar() { new Object[]{ new Object() } } 2. Search for references to A Observe: 2 matches are found: 1 inexact, the other is exact Recovery is creating 2 SingleTypeReferences. The first one is forgotten but MatchLocator doesn't know about it. Thus this first node is never resolved and the MatchLocator thinks it is unresolved. It could ignore references for which it has a match/no-match already with the same source positions (filtering out duplicate cached references). Changed MatchSet to remove nodes that are at the same source position and that have the same class as a matching node. Added regression test JavaSearchTests.testTypeReferenceWithRecovery() Verified. |