Bug 84736 - Search engine erroneously reports "inaccurate" matches under JUnit plug-in test harness
Summary: Search engine erroneously reports "inaccurate" matches under JUnit plug-in te...
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 15:39 EST by Robert M. Fuhrer CLA
Modified: 2005-02-09 09:50 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 Robert M. Fuhrer CLA 2005-02-08 15:39:25 EST
For the program below, the refactoring Introduce Factory performs an exact 
search for references to the constructor Cell1() to find all call sites.

Under the JUnit plug-in test harness, the search engine produces results that 
are tagged "inaccurate". Under an ordinary run-time workbench, the results are 
tagged as "accurate".

The code that calls the search engine appears below the example program.

// ======================================================================
package p;

public class Annotation1 {
	public void foo() {
		Cell1 c= new Cell1();
	}
}
@interface Preliminary { }
class Cell1 {
	@Preliminary public Cell1() { }
}

// ==========================================================================

SearchResultGroup[] findCallsTo(IMethod ctor, IJavaProject project) {
    RefactoringStatus status= new RefactoringStatus();
    SearchPattern pat= SearchPattern.createPattern(ctor,
                IJavaSearchConstants.REFERENCES,
                SearchUtils.GENERICS_AGNOSTIC_MATCH_RULE);
    final RefactoringSearchEngine2 engine= new RefactoringSearchEngine2(pat);

    engine.setFiltering(true, true);
    engine.setScope(createSearchScope(method, methodBinding, javaProject));
    engine.setStatus(status);
    engine.searchPattern(new NullProgressMonitor());

    return (SearchResultGroup[]) engine.getResults();
}
Comment 1 Robert M. Fuhrer CLA 2005-02-09 09:41:48 EST
Mea culpa. A typo in the testcase input source led to a mismatch between the CU 
name and the primary type name; hence the inaccurate results. There is no bug 
here. Sorry!
Comment 2 Jerome Lanneluc CLA 2005-02-09 09:50:03 EST
No problem. Closing.