Skip to content

Commit 099ba3d

Browse files
MontimortHannesWell
authored andcommitted
Bug 533490 - Find unused dependencies does not respect indirectly
referenced class files Change-Id: I2fc1bb653d912d3d4be6caa4a3e0430c031cdd5f Signed-off-by: Andrey Loskutov <loskutov@gmx.de> Signed-off-by: Moritz Aleithe <moritz.aleithe@yahoo.de>
1 parent a5a2774 commit 099ba3d

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/dependencies/GatherUnusedDependenciesOperation.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,8 @@ private boolean provideJavaClasses(IPluginModelBase[] models, IProgressMonitor m
170170
for (IPackageFragment pkgFragment : packageFragments) {
171171
SubMonitor iterationMonitor = subMonitor.split(2);
172172
if (pkgFragment.hasChildren()) {
173-
Requestor requestor = new Requestor();
174-
engine.search(SearchPattern.createPattern(pkgFragment, IJavaSearchConstants.REFERENCES),
175-
new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope,
176-
requestor, iterationMonitor.split(1));
177-
if (requestor.foundMatches()) {
178-
if (provideJavaClasses(pkgFragment, engine, searchScope,
179-
iterationMonitor.split(1))) {
180-
return true;
181-
}
173+
if (provideJavaClasses(pkgFragment, engine, searchScope, iterationMonitor.split(1))) {
174+
return true;
182175
}
183176
}
184177
}
@@ -203,12 +196,15 @@ private boolean provideJavaClasses(IPackageFragment packageFragment, SearchEngin
203196
if (types != null) {
204197
SubMonitor iterationMonitor = subMonitor.split(1).setWorkRemaining(types.length);
205198
for (IType type : types) {
206-
requestor = new Requestor();
207-
engine.search(SearchPattern.createPattern(type, IJavaSearchConstants.REFERENCES),
199+
IType[] allTypes = type.newSupertypeHierarchy(iterationMonitor.split(1)).getAllTypes();
200+
for (IType currType : allTypes) {
201+
requestor = new Requestor();
202+
engine.search(SearchPattern.createPattern(currType, IJavaSearchConstants.REFERENCES),
208203
new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope,
209204
requestor, iterationMonitor.split(1));
210-
if (requestor.foundMatches()) {
211-
return true;
205+
if (requestor.foundMatches()) {
206+
return true;
207+
}
212208
}
213209
}
214210
} else {

0 commit comments

Comments
 (0)