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 4378 Details for
Bug 35755
Search in hierarchy misses dependent projects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
MatchLocator2 patch
(text/plain), 3.53 KB, created by
Jerome Lanneluc
on 2003-03-28 07:20:17 EST
(
hide
)
Description:
MatchLocator2 patch
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2003-03-28 07:20:17 EST
Size:
3.53 KB
patch
obsolete
>Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator2.java >=================================================================== >RCS file: /data/cvs/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator2.java,v >retrieving revision 1.12 >diff -u -r1.12 MatchLocator2.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator2.java 21 Mar 2003 16:14:08 -0000 1.12 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator2.java 28 Mar 2003 12:11:27 -0000 >@@ -781,7 +781,8 @@ > this.pattern.initializePolymorphicSearch(this, progressMonitor); > > IType focusType = getFocusType(); >- JavaProject previousJavaProject = focusType == null ? null : (JavaProject)focusType.getJavaProject(); >+ JavaProject focusProject = focusType == null ? null : (JavaProject)focusType.getJavaProject(); >+ JavaProject previousJavaProject = null; > for (int i = 0; i < length; i++) { > if (progressMonitor != null && progressMonitor.isCanceled()) { > throw new OperationCanceledException(); >@@ -814,10 +815,9 @@ > if (resource == null) { // case of a file in an external jar > resource = javaProject.getProject(); > } >- if (focusType == null // when searching in hierarchy, all potential matches are resolved in the focus project context >- && !javaProject.equals(previousJavaProject)) { >- // locate matches in previous project >- if (previousJavaProject != null) { >+ if (!javaProject.equals(previousJavaProject)) { >+ // locate matches in previous project if not a prereq of focus project >+ if (previousJavaProject != null && !preqsProject(focusProject, previousJavaProject)) { > try { > this.locateMatches(previousJavaProject); > } catch (JavaModelException e) { >@@ -846,7 +846,7 @@ > } > > // last project >- if (previousJavaProject != null) { >+ if (previousJavaProject != null && !preqsProject(focusProject, previousJavaProject)) { > try { > this.locateMatches(previousJavaProject); > } catch (JavaModelException e) { >@@ -859,6 +859,20 @@ > this.potentialMatches = new PotentialMatchSet(); > } > >+ // focus project >+ if (focusProject != null) { >+ try { >+ this.locateMatches(focusProject); >+ } catch (JavaModelException e) { >+ if (e.getException() instanceof CoreException) { >+ throw e; >+ } else { >+ // problem with classpath in last project -> skip it >+ } >+ } >+ this.potentialMatches = new PotentialMatchSet(); >+ } >+ > if (progressMonitor != null) { > progressMonitor.done(); > } >@@ -922,6 +936,27 @@ > } > } > } >+ } >+ /* >+ * Returns whether the focus project prereqs the given project. >+ * Returns true if they are the same. >+ * Returns false if focus project is null. >+ */ >+ private boolean preqsProject(JavaProject focusProject, JavaProject project) { >+ if (focusProject == null) return false; >+ if (focusProject.equals(project)) return true; >+ IPath path = project.getPath(); >+ try { >+ IClasspathEntry[] resolvedClasspath = focusProject.getResolvedClasspath(true/*ignore unresolved entry*/); >+ for (int i = 0, length = resolvedClasspath.length; i < length; i++) { >+ IClasspathEntry entry = resolvedClasspath[i]; >+ if (entry.getEntryKind() == IClasspathEntry.CPE_PROJECT && entry.getPath().equals(path)) { >+ return true; >+ } >+ } >+ } catch (JavaModelException e) { >+ } >+ return false; > } > /* > * Process a compilation unit already parsed and build.
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 35755
:
4378
|
4379