Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 112885 Details for
Bug 247551
[search] SearchEngine.searchDeclarationsOfReferencedTypes does not return the correct reference when type is in a source folder
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Method implementing the search
CodeSnippet.txt (text/plain), 1.96 KB, created by
Frederic Fusier
on 2008-09-18 07:48:02 EDT
(
hide
)
Description:
Method implementing the search
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2008-09-18 07:48:02 EDT
Size:
1.96 KB
patch
obsolete
>public void findMatches( IJavaProject javaProject) throws JavaModelException { > this.searchEngine = new SearchEngine(); > List requiredProjects = new ArrayList(); > List requiredPath = new ArrayList(); > IPackageFragmentRoot[] roots = javaProject.getPackageFragmentRoots(); > for (int i=0; i<roots.length; i++) { > System.out.println("Package fragment root: "+roots[i].getElementName()); > IJavaElement[] children = roots[i].getChildren(); > for (int j=0; j<children.length; j++) { > if (children[j].getElementType() == IJavaElement.PACKAGE_FRAGMENT) { > IPackageFragment fragment = (IPackageFragment) children[j]; > System.out.println(" - package fragment: "+fragment.getElementName()); > ICompilationUnit[] units = fragment.getCompilationUnits(); > for (int k=0; k<units.length; k++) { > SearchMatchCollector collector = new SearchMatchCollector(javaProject.getProject()); > System.out.println(" + compilation unit: "+ units[k].getElementName()); > this.searchEngine.searchDeclarationsOfReferencedTypes(units[k], collector, null); > > SearchMatch[] matches = collector.getMatches(); > int length = matches.length; > if (length == 0) { > System.out.println(" - > No declaration or no referenced types found!"); > } else { > System.out.println(" -> "+length+" referenced types were found:"); > for (int m = 0; m < length; m++) { > > System.out.println(" "+(m+1)+") "+matches[m].getResource()); > IProject p = matches[m].getResource().getProject(); > if (!p.equals(javaProject)) { > if (requiredProjects.indexOf(p) == -1) { > System.out.println(" => project "+p.getName()+" is required"); > requiredProjects.add(p); > } > } > > IPath path = matches[m].getResource().getFullPath(); > if (requiredPath.indexOf(path) == -1) { > System.out.println(" => path "+path+" is required"); > requiredPath.add(path); > } > } > } > } > } > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 247551
:
112769
|
112885
|
112887