Bug 73112 - [Search] SearchEngine doesn't find all fields multiple field declarations
Summary: [Search] SearchEngine doesn't find all fields multiple field declarations
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0.2   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-01 19:13 EDT by Emerson Murphy-Hill CLA
Modified: 2005-03-10 05:09 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emerson Murphy-Hill CLA 2004-09-01 19:13:29 EDT
It appears that the SearchEngine can't find all fields in multiple field
declarations.  For example, take the compiled method from the class:

--------

public class TestCase {

    int field1, field2, field3;
    int field4;
    
    public void method(){}
}

--------

when you run the following code (a pretty vanilla search):

--------

final List searchResults = new ArrayList();
SearchRequestor collector = new SearchRequestor(){
    public void acceptSearchMatch(SearchMatch match) throws
                            CoreException {
            searchResults.add(match);
    }
};

SearchPattern pattern = SearchPattern.createPattern("*",                       
 IJavaSearchConstants.FIELD,                            
IJavaSearchConstants.DECLARATIONS,                        
SearchPattern.R_PATTERN_MATCH);

SearchParticipant[] participants = new SearchParticipant[]
            {SearchEngine.getDefaultSearchParticipant()};
JavaSearchScope scope = new JavaSearchScope();
scope.add(unit);

new SearchEngine().search(pattern,participants,scope,collector,monitor);

--------

searchResults only contains two elements - field1 and field4.  I would expect
field1, field2, field3, and field4. 

This can also be confirmed by doing a standard GUI Java Search of the same
example class.
Comment 1 Frederic Fusier CLA 2004-09-13 07:30:19 EDT
Fixed and released in HEAD.
This bug will be targeted for 3.0.2 when available and released in
R3_0_maintenance stream after 3.0.1 is shipped...

Now package multiple fields declaration are found by SearchEngine correctly.

[jdt-core-internal]
Changes done in MatchLocator.reportMatching(FieldDeclaration,...) method.
Test cases added in JavaSearchTests
Comment 2 Frederic Fusier CLA 2004-09-20 05:07:12 EDT
Fixed and released in R3_0_maintenance stream.
Bug Target still needs to be set to 3.0.2 when it will be available...
Comment 3 Frederic Fusier CLA 2004-09-21 09:27:03 EDT
Setting target to 3.1 M2 while waiting for 3.0.2 one...
Comment 4 David Audel CLA 2004-09-23 11:02:38 EDT
Verified in I200409230100.
Comment 5 David Audel CLA 2004-09-23 11:15:22 EDT
Reopen to change status
Comment 6 David Audel CLA 2004-09-23 11:15:57 EDT
Change status to fixed
Comment 7 David Audel CLA 2004-09-23 11:17:28 EDT
Verified in I200409230100.
Comment 8 Frederic Fusier CLA 2004-09-24 05:17:40 EDT
Finally set status as VERIFIED.
We'll only change target when fix will be definitely put in R3_0_maintenance
stream...
Comment 9 Frederic Fusier CLA 2005-01-26 12:48:48 EST
Candidating fix for 3.0.2 release (not committed yet)
Comment 10 David Audel CLA 2005-03-10 05:09:12 EST
Verified with M20050216