Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hallgren2010-02-25 12:31:06 -0500
committerThomas Hallgren2010-02-25 12:31:06 -0500
commiteaa7cbe6e5818394bc1673a8babc7d4ebd30ed13 (patch)
tree6bc72abf5945357db9fa97b602b8d4b1ab138243 /bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse
parentd3c84a2ee68e14ef740e238f90a214a9b14422e8 (diff)
downloadrt.equinox.p2-eaa7cbe6e5818394bc1673a8babc7d4ebd30ed13.tar.gz
rt.equinox.p2-eaa7cbe6e5818394bc1673a8babc7d4ebd30ed13.tar.xz
rt.equinox.p2-eaa7cbe6e5818394bc1673a8babc7d4ebd30ed13.zip
302201 : Unify the two query approaches used in p2, final step.
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java6
2 files changed, 8 insertions, 14 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
index 787da352e..dc5ffe55a 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java
@@ -13,14 +13,11 @@ package org.eclipse.equinox.p2.internal.repository.tools.tasks;
import java.util.*;
import org.apache.tools.ant.types.DataType;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
-import org.eclipse.equinox.internal.p2.metadata.query.IUPropertyQuery;
-import org.eclipse.equinox.internal.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.p2.internal.repository.tools.Activator;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQuery;
-import org.eclipse.equinox.p2.query.PipedQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.osgi.framework.Filter;
import org.osgi.framework.InvalidSyntaxException;
@@ -111,10 +108,10 @@ public class IUDescription extends DataType {
if (id != null) {
if (version == null || version.length() == 0) {
// Get the latest version of the iu
- queries.add(new LatestIUVersionQuery<IInstallableUnit>(new InstallableUnitQuery(id)));
+ queries.add(QueryUtil.createLatestQuery(QueryUtil.createIUQuery(id)));
} else {
Version iuVersion = Version.parseVersion(version);
- queries.add(new InstallableUnitQuery(id, iuVersion));
+ queries.add(QueryUtil.createIUQuery(id, iuVersion));
}
}
@@ -125,8 +122,7 @@ public class IUDescription extends DataType {
if (queries.size() == 1)
return queries.get(0);
- @SuppressWarnings("unchecked")
- IQuery<IInstallableUnit> query = PipedQuery.createPipe(queries.toArray(new IQuery[queries.size()]));
+ IQuery<IInstallableUnit> query = QueryUtil.createPipeQuery(queries);
return query;
}
@@ -145,8 +141,8 @@ public class IUDescription extends DataType {
if (name == null)
return null;
if (value == null)
- value = IUPropertyQuery.ANY;
- return new IUPropertyQuery(name, value);
+ value = QueryUtil.ANY;
+ return QueryUtil.createIUPropertyQuery(name, value);
}
return null;
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
index cb4662088..c7933c227 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/MirrorTask.java
@@ -19,8 +19,8 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.query.CompoundQuery;
import org.eclipse.equinox.p2.query.IQuery;
+import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
public class MirrorTask extends AbstractRepositoryTask {
@@ -81,9 +81,7 @@ public class MirrorTask extends AbstractRepositoryTask {
if (queries.size() == 1)
return queries.get(0);
- @SuppressWarnings("unchecked")
- IQuery<IArtifactDescriptor>[] array = queries.toArray(new IQuery[queries.size()]);
- return CompoundQuery.<IArtifactDescriptor> createCompoundQuery(array, false);
+ return QueryUtil.<IArtifactDescriptor> createCompoundQuery(queries, false);
}
public SlicingOption createSlicingOptions() {

Back to the top