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.directorywatcher
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.directorywatcher')
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java8
2 files changed, 6 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
index ac8a55a41..692f692f8 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java
@@ -248,7 +248,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
}
};
- return new CompoundQueryable<IArtifactDescriptor>(cached, innerRepo.descriptorQueryable());
+ return QueryUtil.compoundQueryable(cached, innerRepo.descriptorQueryable());
}
public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
@@ -259,7 +259,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
}
};
- CompoundQueryable<IArtifactKey> compound = new CompoundQueryable<IArtifactKey>(cached, innerRepo);
+ IQueryable<IArtifactKey> compound = QueryUtil.compoundQueryable(cached, innerRepo);
return compound.query(query, monitor);
}
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
index 7abea5696..d2fc576b8 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.net.URI;
import java.util.*;
@@ -20,8 +22,6 @@ import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction;
import org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction;
@@ -217,7 +217,7 @@ public class RepositoryListener extends DirectoryChangeListener {
// create a query that will identify all ius related to removed files.
// It's safe to compare a String with a File since the auto coercion will
// first convert the String into a File.
- IQuery<IInstallableUnit> removeQuery = ExpressionQuery.create( //
+ IQuery<IInstallableUnit> removeQuery = QueryUtil.createMatchQuery( //
"$1.exists(x | properties[$0] == x)", FILE_NAME, removedFiles); //$NON-NLS-1$
IQueryResult<IInstallableUnit> toRemove = metadataRepository.query(removeQuery, null);
metadataRepository.removeInstallableUnits(toRemove.toSet());
@@ -262,7 +262,7 @@ public class RepositoryListener extends DirectoryChangeListener {
private void synchronizeCurrentFiles() {
currentFiles.clear();
if (metadataRepository != null) {
- IQueryResult<IInstallableUnit> ius = metadataRepository.query(InstallableUnitQuery.ANY, null);
+ IQueryResult<IInstallableUnit> ius = metadataRepository.query(QueryUtil.createIUAnyQuery(), null);
for (Iterator<IInstallableUnit> it = ius.iterator(); it.hasNext();) {
IInstallableUnit iu = it.next();
String filename = iu.getProperty(FILE_NAME);

Back to the top