Skip to content

Commit 5419be9

Browse files
Montimortiloveeclipse
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 1f9b2c6 commit 5419be9

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
@@ -146,15 +146,8 @@ private boolean provideJavaClasses(IPluginModelBase[] models, IProgressMonitor m
146146
for (IPackageFragment pkgFragment : packageFragments) {
147147
SubMonitor iterationMonitor = subMonitor.split(2);
148148
if (pkgFragment.hasChildren()) {
149-
Requestor requestor = new Requestor();
150-
engine.search(SearchPattern.createPattern(pkgFragment, IJavaSearchConstants.REFERENCES),
151-
new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope,
152-
requestor, iterationMonitor.split(1));
153-
if (requestor.foundMatches()) {
154-
if (provideJavaClasses(pkgFragment, engine, searchScope,
155-
iterationMonitor.split(1))) {
156-
return true;
157-
}
149+
if (provideJavaClasses(pkgFragment, engine, searchScope, iterationMonitor.split(1))) {
150+
return true;
158151
}
159152
}
160153
}
@@ -179,12 +172,15 @@ private boolean provideJavaClasses(IPackageFragment packageFragment, SearchEngin
179172
if (types != null) {
180173
SubMonitor iterationMonitor = subMonitor.split(1).setWorkRemaining(types.length);
181174
for (IType type : types) {
182-
requestor = new Requestor();
183-
engine.search(SearchPattern.createPattern(type, IJavaSearchConstants.REFERENCES),
175+
IType[] allTypes = type.newSupertypeHierarchy(iterationMonitor.split(1)).getAllTypes();
176+
for (IType currType : allTypes) {
177+
requestor = new Requestor();
178+
engine.search(SearchPattern.createPattern(currType, IJavaSearchConstants.REFERENCES),
184179
new SearchParticipant[] { SearchEngine.getDefaultSearchParticipant() }, searchScope,
185180
requestor, iterationMonitor.split(1));
186-
if (requestor.foundMatches()) {
187-
return true;
181+
if (requestor.foundMatches()) {
182+
return true;
183+
}
188184
}
189185
}
190186
} else {

0 commit comments

Comments
 (0)