Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelaskavaia2016-10-14 13:38:21 -0400
committerElena Laskavaia2016-10-27 09:10:26 -0400
commitb7027ff906f5af925fae03d5e0088c36ee16fc51 (patch)
tree719ad5e0e998d2a75c4d1bd965edfb1f355c4a28
parentea6d5de458c9f6cff9f6d2443073f3761d3e10fe (diff)
downloadrt.equinox.p2-b7027ff906f5af925fae03d5e0088c36ee16fc51.tar.gz
rt.equinox.p2-b7027ff906f5af925fae03d5e0088c36ee16fc51.tar.xz
rt.equinox.p2-b7027ff906f5af925fae03d5e0088c36ee16fc51.zip
Bug 506008 - query for requirements returns everything if none
- fix - if there is no requirements return null since there is nothing to query Change-Id: I826cac8c60bcce38081c06ad00cd8bee9a60cd62 Signed-off-by: elaskavaia <elaskavaia.cdt@gmail.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java
index 9cb6a53a2..e7e4706da 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java
@@ -189,11 +189,14 @@ public class QueryProvider {
// Querying of IU's. We are drilling down into the requirements.
if (element instanceof IIUElement && context.getShowInstallChildren()) {
Collection<IRequirement> reqs = ((IIUElement) element).getRequirements();
+ if (reqs.size() == 0)
+ return null; // no children
IExpression[] requirementExpressions = new IExpression[reqs.size()];
int i = 0;
for (IRequirement req : reqs) {
requirementExpressions[i++] = req.getMatches();
}
+
IExpressionFactory factory = ExpressionUtil.getFactory();
IQuery<IInstallableUnit> meetsAnyRequirementQuery = QueryUtil.createMatchQuery(factory.or(requirementExpressions));
IQuery<IInstallableUnit> visibleAsAvailableQuery = policy.getVisibleAvailableIUQuery();

Back to the top