Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java7
2 files changed, 12 insertions, 1 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 3bee4d934..884448c04 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
@@ -141,7 +141,11 @@ public class QueryProvider {
// We need an expression that uses the requirements of the element's requirements, which could be merged
// from multiple category IUs shown as one in the UI.
IExpression matchesRequirementsExpression = ExpressionUtil.parse("$0.exists(r | this ~= r)"); //$NON-NLS-1$
- memberOfCategoryQuery = QueryUtil.createMatchQuery(matchesRequirementsExpression, ((CategoryElement) element).getRequirements());
+ // First perform the "top level" query to limit the amount of
+ // data we need to match in our category query.
+ IQuery<IInstallableUnit> iuGroupQuery = topLevelQuery;
+ IQuery<IInstallableUnit> memberQuery = QueryUtil.createMatchQuery(matchesRequirementsExpression, ((CategoryElement) element).getRequirements());
+ memberOfCategoryQuery = QueryUtil.createPipeQuery(iuGroupQuery, memberQuery);
} else {
memberOfCategoryQuery = QueryUtil.createIUCategoryMemberQuery(((IIUElement) element).getIU());
}
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java
index a478e683f..451cfc74b 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java
@@ -66,6 +66,10 @@ public abstract class QueriedElement extends ProvElement {
}
public Object[] getChildren(Object o) {
+ Object[] cache = getCachedChildren();
+ if (cache.length > 0) {
+ return getCachedChildren();
+ }
return fetchChildren(o, new NullProgressMonitor());
}
@@ -159,6 +163,9 @@ public abstract class QueriedElement extends ProvElement {
}
public Object[] getCachedChildren() {
+ if (cachedChildren == null) {
+ return new Object[0];
+ }
return cachedChildren.toArray();
}

Back to the top