Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoribull2009-12-16 07:03:12 +0000
committeribull2009-12-16 07:03:12 +0000
commitc689f67658a0258d3c9bddf7be86feb952c03879 (patch)
tree8b380859c90b6c205f6fb471f01a712adff2109e
parent8bff37da2e766f70de525492a30ed8212a517737 (diff)
downloadrt.equinox.p2-c689f67658a0258d3c9bddf7be86feb952c03879.tar.gz
rt.equinox.p2-c689f67658a0258d3c9bddf7be86feb952c03879.tar.xz
rt.equinox.p2-c689f67658a0258d3c9bddf7be86feb952c03879.zip
256411: Use an Iterator in favor of a Collector in the IQueryable interface
https://bugs.eclipse.org/bugs/show_bug.cgi?id=256411 IQueryable now returns an IQueryResult which has an iterator attached.
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Optimizer.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.common/src/org/eclipse/equinox/p2/common/TranslationSupport.java23
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/IProfile.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningPlan.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/URLMetadataRepository.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/CompoundQueryable.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/IQueryable.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IAcceptor.java31
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IQueryResult.java64
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/PublisherResult.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableArtifactRepositoryManagerTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractAntProvisioningTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/IUPropertyUtils.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/MockQueryable.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java27
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/RepoTasksTests.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MD5Tests.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java55
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUProperties.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUPropertyRemoval.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UpdateQueryTest.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java74
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTest.java52
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java40
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java21
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/LocalUpdatesiteTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryProvider.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableProfileRegistry.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepository.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java5
132 files changed, 717 insertions, 570 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF
index e5b8e6b8b..38e6657ad 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF
@@ -16,6 +16,7 @@ Import-Package: ie.wombat.jbdiff,
org.eclipse.equinox.internal.provisional.p2.metadata,
org.eclipse.equinox.internal.provisional.p2.metadata.query,
org.eclipse.equinox.p2.metadata,
+ org.eclipse.equinox.p2.metadata.query,
org.eclipse.equinox.p2.repository,
org.eclipse.equinox.p2.repository.artifact,
org.eclipse.equinox.p2.repository.artifact.spi,
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Optimizer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Optimizer.java
index bb01b6897..a5edc6de6 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Optimizer.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Optimizer.java
@@ -21,8 +21,8 @@ import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processin
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
@@ -75,8 +75,8 @@ public class Optimizer {
public void run() {
System.out.println("Starting delta (jardelta) optimizations (width=" + width + ", depth=" + depth + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- Collector collector = repository.query(ArtifactKeyQuery.ALL_KEYS, null);
- IArtifactKey[][] keys = getSortedRelatedArtifactKeys((IArtifactKey[]) collector.toArray(IArtifactKey.class));
+ IQueryResult queryResult = repository.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IArtifactKey[][] keys = getSortedRelatedArtifactKeys((IArtifactKey[]) queryResult.toArray(IArtifactKey.class));
for (int i = 0; i < keys.length; i++) {
if (keys[i].length < 2)
// Nothing to diff here!
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java
index 344bf09f6..e4b0a4fc6 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java
@@ -20,8 +20,8 @@ import org.eclipse.equinox.internal.p2.artifact.optimizers.VersionlessArtifactKe
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
@@ -77,8 +77,8 @@ public class Optimizer {
public void run() {
System.out.println("Starting delta (jbdiff) optimizations (width=" + width + ", depth=" + depth + ", nosar=" + nosar + ")");
- Collector collector = repository.query(ArtifactKeyQuery.ALL_KEYS, null);
- IArtifactKey[][] keys = getSortedRelatedArtifactKeys((IArtifactKey[]) collector.toArray(IArtifactKey.class));
+ IQueryResult queryResult = repository.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IArtifactKey[][] keys = getSortedRelatedArtifactKeys((IArtifactKey[]) queryResult.toArray(IArtifactKey.class));
for (int i = 0; i < keys.length; i++) {
if (keys[i].length < 2)
// Nothing to diff here!
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
index 8fde98f20..c209c319b 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
@@ -18,8 +18,8 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStep;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.osgi.util.NLS;
@@ -32,7 +32,7 @@ public class Optimizer {
}
public void run() {
- Collector keys = repository.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = repository.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
if (!key.getClassifier().equals("plugin")) //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
index c1978d309..5b05cf8d9 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepository.java
@@ -23,11 +23,13 @@ import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.ArtifactComparatorFactory;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactComparator;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.CompoundQueryable;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.ICompositeRepository;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
@@ -453,7 +455,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
* Check the two given repositories against each other using the given comparator.
*/
private boolean isSane(IArtifactRepository one, IArtifactRepository two, IArtifactComparator comparator) {
- Collector toCheckKeys = one.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult toCheckKeys = one.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = toCheckKeys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
if (!two.contains(key))
@@ -514,7 +516,7 @@ public class CompositeArtifactRepository extends AbstractArtifactRepository impl
}
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
// Query all the all the repositories this composite repo contains
List repos = new ArrayList();
for (Iterator repositoryIterator = loadedRepos.iterator(); repositoryIterator.hasNext();) {
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
index c66762e12..ec75e8051 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
@@ -34,6 +34,7 @@ import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.Abstr
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.MappedCollectionIterator;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
@@ -979,17 +980,17 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
return location.toString();
}
- public synchronized Collector query(IQuery query, IProgressMonitor monitor) {
- Collector collector = new Collector();
+ public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ Collector queryResult = new Collector();
if (monitor != null && monitor.isCanceled())
- return collector;
+ return queryResult;
boolean excludeKeys = Boolean.TRUE.equals(query.getProperty(IArtifactRepository.QUERY_EXCLUDE_KEYS));
boolean excludeDescriptors = Boolean.TRUE.equals(query.getProperty(IArtifactRepository.QUERY_EXCLUDE_DESCRIPTORS));
if (excludeKeys && excludeDescriptors)
- return collector;
+ return queryResult;
Iterator iterator = !excludeDescriptors ? new MappedCollectionIterator(artifactMap, !excludeKeys) : artifactMap.keySet().iterator();
- return query.perform(iterator, collector);
+ return query.perform(iterator, queryResult);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.common/src/org/eclipse/equinox/p2/common/TranslationSupport.java b/bundles/org.eclipse.equinox.p2.common/src/org/eclipse/equinox/p2/common/TranslationSupport.java
index 964cad9f8..cb60d5a4b 100644
--- a/bundles/org.eclipse.equinox.p2.common/src/org/eclipse/equinox/p2/common/TranslationSupport.java
+++ b/bundles/org.eclipse.equinox.p2.common/src/org/eclipse/equinox/p2/common/TranslationSupport.java
@@ -11,9 +11,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.common;
-
-import org.eclipse.equinox.p2.metadata.ICopyright;
-
import java.lang.ref.SoftReference;
import java.util.*;
import org.eclipse.core.runtime.IStatus;
@@ -28,10 +25,8 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.IRequirement;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
-import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.query.*;
/**
* TranslationSupport provides string translations for properties of an
@@ -51,7 +46,7 @@ public class TranslationSupport {
private Locale locale;
// Cache the IU fragments that provide localizations for a given locale.
- // map: locale => soft reference to a collector
+ // map: locale => soft reference to a queryResult
private Map LocaleCollectorCache = new HashMap(2);
/**
@@ -162,7 +157,7 @@ public class TranslationSupport {
final List locales = buildLocaleVariants();
final IInstallableUnit theUnit = iu;
- Collector localizationFragments = getLocalizationFragments(locales);
+ IQueryResult localizationFragments = getLocalizationFragments(locales);
MatchQuery hostLocalizationQuery = new MatchQuery() {
public boolean isMatch(Object object) {
@@ -222,15 +217,15 @@ public class TranslationSupport {
/**
* Collects the installable unit fragments that contain locale data for the given locales.
*/
- private synchronized Collector getLocalizationFragments(List localeVariants) {
+ private synchronized IQueryResult getLocalizationFragments(List localeVariants) {
if (fragmentSource == null) {
LogHelper.log(new Status(IStatus.ERROR, Activator.ID, "Profile registry unavailable. Default language will be used.", new RuntimeException())); //$NON-NLS-1$
return new Collector();
}
- SoftReference collectorRef = (SoftReference) LocaleCollectorCache.get(locale);
- if (collectorRef != null) {
- Collector cached = (Collector) collectorRef.get();
+ SoftReference queryResultReference = (SoftReference) LocaleCollectorCache.get(locale);
+ if (queryResultReference != null) {
+ Collector cached = (Collector) queryResultReference.get();
if (cached != null)
return cached;
}
@@ -243,7 +238,7 @@ public class TranslationSupport {
}
IQuery iuQuery = new PipedQuery(new IQuery[] {new FragmentQuery(), CompoundQuery.createCompoundQuery(localeQuery, false)});
- Collector collected = fragmentSource.query(iuQuery, null);
+ IQueryResult collected = fragmentSource.query(iuQuery, null);
LocaleCollectorCache.put(locale, new SoftReference(collected));
return collected;
}
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
index ddc449562..02d3765c2 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
@@ -20,12 +20,14 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.GroupQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.osgi.framework.console.CommandInterpreter;
@@ -297,7 +299,7 @@ public class ProvCommandProvider implements CommandProvider {
if (repoURL == null)
return;
IArtifactRepository repo = ProvisioningHelper.getArtifactRepository(repoURL);
- Collector keys = null;
+ IQueryResult keys = null;
try {
keys = (repo != null) ? repo.query(ArtifactKeyQuery.ALL_KEYS, null) : null;
} catch (UnsupportedOperationException e) {
@@ -440,8 +442,8 @@ public class ProvCommandProvider implements CommandProvider {
}
}
- private IInstallableUnit[] sort(Collector collector) {
- IInstallableUnit[] units = (IInstallableUnit[]) collector.toArray(IInstallableUnit.class);
+ private IInstallableUnit[] sort(IQueryResult queryResult) {
+ IInstallableUnit[] units = (IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class);
Arrays.sort(units, new Comparator() {
public int compare(Object arg0, Object arg1) {
return arg0.toString().compareTo(arg1.toString());
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
index 87ef5efb0..b53aa9fab 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
@@ -21,6 +21,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
@@ -151,7 +152,7 @@ public class ProvisioningHelper {
* @param monitor A progress monitor, or <code>null</code>
* @return The IUs that match the query
*/
- public static Collector getInstallableUnits(URI location, IQuery query, IProgressMonitor monitor) {
+ public static IQueryResult getInstallableUnits(URI location, IQuery query, IProgressMonitor monitor) {
IQueryable queryable = null;
if (location == null) {
queryable = (IQueryable) ServiceHelper.getService(Activator.getContext(), IMetadataRepositoryManager.SERVICE_NAME);
@@ -180,7 +181,7 @@ public class ProvisioningHelper {
public static IStatus install(String unitId, String version, IProfile profile, IProgressMonitor progress) throws ProvisionException {
if (profile == null)
return null;
- Collector units = getInstallableUnits((URI) null, new InstallableUnitQuery(unitId, Version.create(version)), progress);
+ IQueryResult units = getInstallableUnits((URI) null, new InstallableUnitQuery(unitId, Version.create(version)), progress);
if (units.isEmpty()) {
StringBuffer error = new StringBuffer();
error.append("Installable unit not found: " + unitId + ' ' + version + '\n');
@@ -280,7 +281,7 @@ public class ProvisioningHelper {
public static IStatus uninstall(String unitId, String version, IProfile profile, IProgressMonitor progress) throws ProvisionException {
if (profile == null)
return null;
- Collector units = profile.query(new InstallableUnitQuery(unitId, Version.create(version)), progress);
+ IQueryResult units = profile.query(new InstallableUnitQuery(unitId, Version.create(version)), progress);
if (units.isEmpty()) {
StringBuffer error = new StringBuffer();
error.append("Installable unit not found: " + unitId + ' ' + version + '\n');
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
index 8d4d4da6d..9cb6e50ae 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/Application.java
@@ -32,6 +32,7 @@ import org.eclipse.equinox.p2.core.IProvisioningAgentProvider;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.osgi.framework.log.FrameworkLog;
@@ -91,7 +92,7 @@ public class Application implements IApplication {
throw new CoreException(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.Ambigous_Command, new Object[] {COMMAND_NAMES[cmd1], COMMAND_NAMES[cmd2]})));
}
- private ProfileChangeRequest buildProvisioningRequest(IProfile profile, Collector roots, boolean install) {
+ private ProfileChangeRequest buildProvisioningRequest(IProfile profile, IQueryResult roots, boolean install) {
ProfileChangeRequest request = new ProfileChangeRequest(profile);
markRoots(request, roots);
if (install) {
@@ -249,7 +250,7 @@ public class Application implements IApplication {
throw new RuntimeException(Messages.Missing_Engine);
}
- private void markRoots(ProfileChangeRequest request, Collector roots) {
+ private void markRoots(ProfileChangeRequest request, IQueryResult roots) {
for (Iterator iterator = roots.iterator(); iterator.hasNext();) {
request.setInstallableUnitProfileProperty((IInstallableUnit) iterator.next(), IProfile.PROP_PROFILE_ROOT_IU, Boolean.TRUE.toString());
}
@@ -402,7 +403,7 @@ public class Application implements IApplication {
IStatus operationStatus = Status.OK_STATUS;
InstallableUnitQuery query;
- Collector roots;
+ IQueryResult roots;
try {
initializeRepositories(command == COMMAND_INSTALL);
switch (command) {
@@ -490,12 +491,12 @@ public class Application implements IApplication {
this.location = location;
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return ProvisioningHelper.getInstallableUnits(location, query, monitor);
}
}
- private Collector collectRootIUs(URI[] locations, IQuery query) {
+ private IQueryResult collectRootIUs(URI[] locations, IQuery query) {
IProgressMonitor nullMonitor = new NullProgressMonitor();
if (locations == null || locations.length == 0)
diff --git a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
index 27d452bee..b59d6e0b0 100644
--- a/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
+++ b/bundles/org.eclipse.equinox.p2.director.app/src/org/eclipse/equinox/internal/p2/director/app/DirectorApplication.java
@@ -31,6 +31,7 @@ import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IVersionedId;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.osgi.framework.log.FrameworkLog;
@@ -54,7 +55,7 @@ public class DirectorApplication implements IApplication {
Assert.isNotNull(location);
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return getInstallableUnits(location, query, monitor);
}
}
@@ -227,7 +228,7 @@ public class DirectorApplication implements IApplication {
}
}
- private Collector collectRootIUs(IQuery query) {
+ private IQueryResult collectRootIUs(IQuery query) {
IProgressMonitor nullMonitor = new NullProgressMonitor();
int top = metadataRepositoryLocations.size();
@@ -247,7 +248,7 @@ public class DirectorApplication implements IApplication {
IVersionedId rootName = (IVersionedId) rootNames.get(i);
Version v = rootName.getVersion();
IQuery query = new InstallableUnitQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
- Collector roots;
+ IQueryResult roots;
if (forInstall)
roots = collectRootIUs(new PipedQuery(new IQuery[] {query, new LatestIUVersionQuery()}));
else
@@ -461,7 +462,7 @@ public class DirectorApplication implements IApplication {
ArrayList allRoots = new ArrayList();
if (rootsToList.size() == 0) {
- Collector roots = collectRootIUs(InstallableUnitQuery.ANY);
+ IQueryResult roots = collectRootIUs(InstallableUnitQuery.ANY);
allRoots.addAll(roots.toCollection());
} else {
Iterator r = rootsToList.iterator();
@@ -469,7 +470,7 @@ public class DirectorApplication implements IApplication {
IVersionedId rootName = (IVersionedId) r.next();
Version v = rootName.getVersion();
IQuery query = new InstallableUnitQuery(rootName.getId(), Version.emptyVersion.equals(v) ? VersionRange.emptyRange : new VersionRange(v, true, v, true));
- Collector roots = collectRootIUs(query);
+ IQueryResult roots = collectRootIUs(query);
allRoots.addAll(roots.toCollection());
}
}
@@ -772,7 +773,7 @@ public class DirectorApplication implements IApplication {
strm.print(' ');
}
- Collector getInstallableUnits(URI location, IQuery query, IProgressMonitor monitor) {
+ IQueryResult getInstallableUnits(URI location, IQuery query, IProgressMonitor monitor) {
IQueryable queryable = null;
if (location == null) {
queryable = metadataManager;
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
index f72d7ec02..a281fece0 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java
@@ -20,11 +20,11 @@ import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.p2.metadata.LDAPQuery;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
-import org.eclipse.equinox.p2.metadata.query.IQuery;
-import org.eclipse.equinox.p2.metadata.query.PatchQuery;
+import org.eclipse.equinox.p2.metadata.query.*;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.InvalidSyntaxException;
import org.sat4j.pb.IPBSolver;
@@ -159,10 +159,10 @@ public class Projector {
solver = SolverFactory.newEclipseP2();
}
solver.setTimeoutOnConflicts(1000);
- Collector collector = picker.query(InstallableUnitQuery.ANY, null);
+ IQueryResult queryResult = picker.query(InstallableUnitQuery.ANY, null);
dependencyHelper = new DependencyHelper(solver);
- Iterator iusToEncode = collector.iterator();
+ Iterator iusToEncode = queryResult.iterator();
if (DEBUG) {
List iusToOrder = new ArrayList();
while (iusToEncode.hasNext()) {
@@ -252,7 +252,7 @@ public class Projector {
for (int j = 0; j < reqs.length; j++) {
if (reqs[j].getMin() > 0)
continue;
- Collector matches = picker.query(reqs[j].getMatches(), null);
+ IQueryResult matches = picker.query(reqs[j].getMatches(), null);
for (Iterator iterator = matches.iterator(); iterator.hasNext();) {
IInstallableUnit match = (IInstallableUnit) iterator.next();
if (match instanceof IInstallableUnitPatch) {
@@ -408,7 +408,7 @@ public class Projector {
return;
}
- Collector applicablePatches = getApplicablePatches(iu);
+ IQueryResult applicablePatches = getApplicablePatches(iu);
expandLifeCycle(iu, isRootIU);
//No patches apply, normal code path
if (applicablePatches.size() == 0) {
@@ -434,7 +434,7 @@ public class Projector {
Object left;
}
- private void expandRequirementsWithPatches(IInstallableUnit iu, Collector applicablePatches, boolean isRootIu) throws ContradictionException {
+ private void expandRequirementsWithPatches(IInstallableUnit iu, IQueryResult applicablePatches, boolean isRootIu) throws ContradictionException {
//Unmodified dependencies
Map unchangedRequirements = new HashMap(getRequiredCapabilities(iu).length);
Map nonPatchedRequirements = new HashMap(getRequiredCapabilities(iu).length);
@@ -639,7 +639,7 @@ public class Projector {
*/
private List getApplicableMatches(IRequirement req) {
List target = new ArrayList();
- Collector matches = picker.query(req.getMatches(), null);
+ IQueryResult matches = picker.query(req.getMatches(), null);
for (Iterator iterator = matches.iterator(); iterator.hasNext();) {
IInstallableUnit match = (IInstallableUnit) iterator.next();
if (isApplicable(match)) {
@@ -729,7 +729,7 @@ public class Projector {
}
//Return IUPatches that are applicable for the given iu
- private Collector getApplicablePatches(IInstallableUnit iu) {
+ private IQueryResult getApplicablePatches(IInstallableUnit iu) {
if (patches == null)
patches = new QueryableArray((IInstallableUnit[]) picker.query(new PatchQuery(), null).toArray(IInstallableUnit.class));
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java
index 06fe7d5fc..5393ac757 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java
@@ -18,6 +18,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
public class QueryableArray implements IQueryable {
static class IUCapability {
@@ -37,7 +38,7 @@ public class QueryableArray implements IQueryable {
dataSet = Arrays.asList(ius);
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
if (query instanceof IRequiredCapability)
return queryCapability((IRequiredCapability) query, collector, monitor);
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
index a1235bcc4..ede46a407 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/SimplePlanner.java
@@ -27,6 +27,7 @@ import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -250,7 +251,7 @@ public class SimplePlanner implements IPlanner {
throw new OperationCanceledException();
IMetadataRepository repository = repoManager.loadRepository(repositories[i], sub.newChild(100));
- Collector matches = repository.query(new InstallableUnitQuery(null, VersionRange.emptyRange), sub.newChild(100));
+ IQueryResult matches = repository.query(new InstallableUnitQuery(null, VersionRange.emptyRange), sub.newChild(100));
for (Iterator it = matches.iterator(); it.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) it.next();
String key = iu.getId() + "_" + iu.getVersion().toString(); //$NON-NLS-1$
@@ -387,8 +388,8 @@ public class SimplePlanner implements IPlanner {
allMetaRequirements.add(reqs[i]);
}
}
- Collector c2 = plan.getRemovals().query(InstallableUnitQuery.ANY, null);
- for (Iterator iterator = c2.iterator(); iterator.hasNext();) {
+ IQueryResult queryResult = plan.getRemovals().query(InstallableUnitQuery.ANY, null);
+ for (Iterator iterator = queryResult.iterator(); iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
IRequirement[] reqs = iu.getMetaRequiredCapabilities();
for (int i = 0; i < reqs.length; i++) {
@@ -552,7 +553,7 @@ public class SimplePlanner implements IPlanner {
}
private IInstallableUnit getPreviousIUForMetaRequirements(IProfile profile, String iuId, IProgressMonitor monitor) {
- Collector c = profile.query(new InstallableUnitQuery(iuId), monitor);
+ IQueryResult c = profile.query(new InstallableUnitQuery(iuId), monitor);
if (c.size() == 0)
return null;
return (IInstallableUnit) c.toArray(IInstallableUnit.class)[0];
@@ -687,7 +688,7 @@ public class SimplePlanner implements IPlanner {
if (sub.isCanceled())
throw new OperationCanceledException();
IMetadataRepository repository = repoManager.loadRepository(repositories[i], sub.newChild(100));
- Collector matches = repository.query(new UpdateQuery(toUpdate), sub.newChild(100));
+ IQueryResult matches = repository.query(new UpdateQuery(toUpdate), sub.newChild(100));
for (Iterator it = matches.iterator(); it.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) it.next();
String key = iu.getId() + "_" + iu.getVersion().toString(); //$NON-NLS-1$
@@ -712,7 +713,7 @@ public class SimplePlanner implements IPlanner {
profile = p;
}
- public Collector available(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult available(IQuery query, IProgressMonitor monitor) {
return profile.available(query, monitor);
}
@@ -742,7 +743,7 @@ public class SimplePlanner implements IPlanner {
return profile.getTimestamp();
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return profile.query(query, monitor);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java
index aca61052c..e22e2535d 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Slicer.java
@@ -17,11 +17,11 @@ import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
import org.eclipse.equinox.internal.p2.metadata.LDAPQuery;
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnitPatch;
import org.eclipse.equinox.internal.provisional.p2.metadata.IRequirementChange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.InvalidSyntaxException;
@@ -167,7 +167,7 @@ public class Slicer {
private void expandRequirement(IInstallableUnit iu, IRequirement req) {
if (req.getMax() == 0)
return;
- Collector matches = possibilites.query(req.getMatches(), null);
+ IQueryResult matches = possibilites.query(req.getMatches(), null);
int validMatches = 0;
for (Iterator iterator = matches.iterator(); iterator.hasNext();) {
IInstallableUnit match = (IInstallableUnit) iterator.next();
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 0298f4f52..f99b632e3 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
@@ -9,6 +9,8 @@
******************************************************************************/
package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.io.File;
import java.io.OutputStream;
import java.net.URI;
@@ -235,7 +237,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
return innerRepo.createArtifactDescriptor(key);
}
- public synchronized Collector query(IQuery query, IProgressMonitor monitor) {
+ public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
if (monitor != null && monitor.isCanceled())
return collector;
@@ -246,7 +248,7 @@ public class CachingArtifactRepository implements IArtifactRepository, IFileArti
return collector;
IQueryable cached = new IQueryable() {
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
Iterator i = !excludeDescriptors ? new MappedCollectionIterator(artifactMap, !excludeKeys) : artifactMap.keySet().iterator();
return query.perform(i, collector);
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 f303d1663..2c7bc4a7c 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
@@ -21,6 +21,7 @@ import org.eclipse.equinox.internal.p2.update.Site;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction;
import org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction;
@@ -227,7 +228,7 @@ public class RepositoryListener extends DirectoryChangeListener {
return removedFiles.contains(iuFile);
}
};
- Collector toRemove = metadataRepository.query(removeQuery, null);
+ IQueryResult toRemove = metadataRepository.query(removeQuery, null);
metadataRepository.removeInstallableUnits((IInstallableUnit[]) toRemove.toArray(IInstallableUnit.class), null);
}
// Then add all the new IUs as well as the new copies of the ones that have changed
@@ -246,7 +247,7 @@ public class RepositoryListener extends DirectoryChangeListener {
if (artifactRepository == null)
return;
if (!removedFiles.isEmpty()) {
- Collector descriptors = artifactRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
+ IQueryResult descriptors = artifactRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
for (Iterator iterator = descriptors.iterator(); iterator.hasNext();) {
SimpleArtifactDescriptor descriptor = (SimpleArtifactDescriptor) iterator.next();
String filename = descriptor.getRepositoryProperty(FILE_NAME);
@@ -270,7 +271,7 @@ public class RepositoryListener extends DirectoryChangeListener {
private void synchronizeCurrentFiles() {
currentFiles.clear();
if (metadataRepository != null) {
- Collector ius = metadataRepository.query(InstallableUnitQuery.ANY, null);
+ IQueryResult ius = metadataRepository.query(InstallableUnitQuery.ANY, null);
for (Iterator it = ius.iterator(); it.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) it.next();
String filename = iu.getProperty(FILE_NAME);
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java
index 10c2c6e7e..ba90779a8 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java
@@ -19,6 +19,7 @@ import org.eclipse.equinox.p2.engine.ISurrogateProfileHandler;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.osgi.util.NLS;
public class Profile implements IQueryable, IProfile {
@@ -161,7 +162,7 @@ public class Profile implements IQueryable, IProfile {
/* (non-Javadoc)
* @see org.eclipse.equinox.internal.provisional.p2.engine.IProfile#query(org.eclipse.equinox.internal.provisional.p2.query.Query, org.eclipse.equinox.internal.provisional.p2.query.Collector, org.eclipse.core.runtime.IProgressMonitor)
*/
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
propagateProfileContext(query);
if (query instanceof IUProfilePropertyQuery) {
@@ -187,7 +188,7 @@ public class Profile implements IQueryable, IProfile {
}
}
- public Collector available(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult available(IQuery query, IProgressMonitor monitor) {
if (surrogateProfileHandler != null)
return surrogateProfileHandler.queryProfile(this, query, monitor);
return query(query, new NullProgressMonitor());
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java
index 7deed5c2c..71c5189a6 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileMetadataRepository.java
@@ -20,11 +20,11 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.metadata.repository.Activator;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.AbstractMetadataRepository;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.osgi.util.NLS;
@@ -155,7 +155,7 @@ public class ProfileMetadataRepository extends AbstractMetadataRepository {
// nothing to do
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return profile.query(query, monitor);
}
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java
index 2d20e1850..2743bdf30 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/ProfileWriter.java
@@ -14,10 +14,10 @@ import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
import org.eclipse.equinox.internal.p2.metadata.repository.io.MetadataWriter;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
public class ProfileWriter extends MetadataWriter implements ProfileXMLConstants {
@@ -30,8 +30,8 @@ public class ProfileWriter extends MetadataWriter implements ProfileXMLConstants
attribute(ID_ATTRIBUTE, profile.getProfileId());
attribute(TIMESTAMP_ATTRIBUTE, Long.toString(profile.getTimestamp()));
writeProperties(profile.getProperties());
- Collector collector = profile.query(InstallableUnitQuery.ANY, null);
- ArrayList ius = new ArrayList(collector.toCollection());
+ IQueryResult queryResult = profile.query(InstallableUnitQuery.ANY, null);
+ ArrayList ius = new ArrayList(queryResult.toCollection());
Collections.sort(ius, new Comparator() {
public int compare(Object o1, Object o2) {
IInstallableUnit iu1 = (IInstallableUnit) o1;
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
index 0c99c88e4..af2ad0025 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
@@ -22,11 +22,11 @@ import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.core.IAgentLocation;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.BundleContext;
@@ -286,9 +286,9 @@ public class SimpleProfileRegistry implements IProfileRegistry {
current.clearInstallableUnits();
current.addProperties(profile.getLocalProperties());
- Collector collector = profile.query(InstallableUnitQuery.ANY, null);
- for (Iterator collectorIt = collector.iterator(); collectorIt.hasNext();) {
- IInstallableUnit iu = (IInstallableUnit) collectorIt.next();
+ IQueryResult queryResult = profile.query(InstallableUnitQuery.ANY, null);
+ for (Iterator queryResultIt = queryResult.iterator(); queryResultIt.hasNext();) {
+ IInstallableUnit iu = (IInstallableUnit) queryResultIt.next();
current.addInstallableUnit(iu);
Map iuProperties = profile.getInstallableUnitProperties(iu);
if (iuProperties != null)
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java
index 2c2c38c2f..5cd04823d 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java
@@ -24,6 +24,7 @@ import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.util.NLS;
@@ -56,7 +57,7 @@ public class SurrogateProfileHandler implements ISurrogateProfileHandler {
return false;
}
}}, false);
- Collector rootIUs = sharedProfile.query(rootIUQuery, null);
+ IQueryResult rootIUs = sharedProfile.query(rootIUQuery, null);
for (Iterator iterator = rootIUs.iterator(); iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
userProfile.addInstallableUnit(iu);
@@ -68,7 +69,7 @@ public class SurrogateProfileHandler implements ISurrogateProfileHandler {
private static void removeUserProfileBaseIUs(final Profile userProfile) {
IQuery rootIUQuery = new IUProfilePropertyQuery(PROP_BASE, Boolean.TRUE.toString());
- Collector rootIUs = userProfile.query(rootIUQuery, null);
+ IQueryResult rootIUs = userProfile.query(rootIUQuery, null);
for (Iterator iterator = rootIUs.iterator(); iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
userProfile.removeInstallableUnit(iu);
@@ -76,7 +77,7 @@ public class SurrogateProfileHandler implements ISurrogateProfileHandler {
}
private static void markRootsOptional(final Profile userProfile) {
- Collector rootIUs = userProfile.query(new UserVisibleRootQuery(), null);
+ IQueryResult rootIUs = userProfile.query(new UserVisibleRootQuery(), null);
for (Iterator iterator = rootIUs.iterator(); iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
userProfile.setInstallableUnitProperty(iu, PROP_INCLUSION_RULES, OPTIONAL);
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/IProfile.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/IProfile.java
index 93ac1ca14..b2d4dd0dc 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/IProfile.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/IProfile.java
@@ -12,10 +12,10 @@ package org.eclipse.equinox.p2.engine;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
/**
* @since 2.0
@@ -130,6 +130,6 @@ public interface IProfile extends IQueryable {
public long getTimestamp();
- public Collector available(IQuery query, IProgressMonitor monitor);
+ public IQueryResult available(IQuery query, IProgressMonitor monitor);
} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningPlan.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningPlan.java
index 29db1f13f..3e1cf6546 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningPlan.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/p2/engine/ProvisioningPlan.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.engine;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
@@ -51,7 +53,7 @@ public class ProvisioningPlan implements IProvisioningPlan {
this.profile = profile;
if (futureState == null) {
futureState = new IQueryable() {
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return new Collector();
}
};
@@ -126,7 +128,7 @@ public class ProvisioningPlan implements IProvisioningPlan {
this.addition = add;
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
if (operands == null || status.getSeverity() == IStatus.ERROR)
return collector;
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java
index 6e4d3783a..249385206 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/BundlePoolFilteredListener.java
@@ -13,8 +13,8 @@ package org.eclipse.equinox.internal.p2.extensionlocation;
import java.io.File;
import java.util.*;
import org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryChangeListener;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository;
@@ -27,7 +27,7 @@ public class BundlePoolFilteredListener extends DirectoryChangeListener {
delegate = listener;
IFileArtifactRepository bundlePool = Activator.getBundlePoolRepository();
if (bundlePool != null) {
- Collector keys = bundlePool.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = bundlePool.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
File artifactFile = bundlePool.getArtifactFile(key);
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java
index f29762a7e..7f6858502 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java
@@ -11,12 +11,13 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.extensionlocation;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.io.*;
import java.net.URI;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
@@ -231,7 +232,7 @@ public class ExtensionLocationArtifactRepository extends AbstractRepository impl
return artifactRepository.createArtifactDescriptor(key);
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
ensureInitialized();
return artifactRepository.query(query, monitor);
}
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java
index fd6a253cf..4e8cba048 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java
@@ -17,10 +17,10 @@ import java.net.URI;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.AbstractMetadataRepository;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.BundleContext;
@@ -103,7 +103,7 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit
/* (non-Javadoc)
* @see org.eclipse.equinox.internal.provisional.p2.query.IQueryable#query(org.eclipse.equinox.internal.provisional.p2.query.Query, org.eclipse.equinox.internal.provisional.p2.query.Collector, org.eclipse.core.runtime.IProgressMonitor)
*/
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
ensureInitialized();
return metadataRepository.query(query, monitor);
}
diff --git a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java
index 85e3c9210..8a99c6a5d 100644
--- a/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java
+++ b/bundles/org.eclipse.equinox.p2.garbagecollector/src/org/eclipse/equinox/internal/p2/garbagecollector/CoreGarbageCollector.java
@@ -12,8 +12,8 @@ package org.eclipse.equinox.internal.p2.garbagecollector;
import java.util.*;
import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
@@ -39,7 +39,7 @@ public class CoreGarbageCollector {
return !set.contains(candidate);
}
};
- Collector inactive = aRepository.query(query, null);
+ IQueryResult inactive = aRepository.query(query, null);
for (Iterator iterator = inactive.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
aRepository.removeDescriptor(key);
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java
index 6751d2940..0270bb7c1 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/provisional/p2/metadata/generator/Generator.java
@@ -33,6 +33,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.Inst
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
@@ -188,8 +189,8 @@ public class Generator {
ProductQuery productQuery = new ProductQuery(productFile, info.getFlavor(), result.configurationIUs, info.getVersionAdvice());
PipedQuery query = new PipedQuery(new IQuery[] {productQuery, new LatestIUVersionQuery()});
- Collector collector = info.getMetadataRepository().query(query, null);
- for (Iterator iterator = collector.iterator(); iterator.hasNext();) {
+ IQueryResult queryResult = info.getMetadataRepository().query(query, null);
+ for (Iterator iterator = queryResult.iterator(); iterator.hasNext();) {
productContents.rootIUs.add(iterator.next());
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
index b6188f9ea..586d8eeca 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/CompositeMetadataRepository.java
@@ -27,6 +27,7 @@ import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.Abstr
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.ICompositeRepository;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -124,19 +125,19 @@ public class CompositeMetadataRepository extends AbstractMetadataRepository impl
return result;
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
- Collector collector = new Collector();
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ IQueryResult queryResult = new Collector();
if (monitor == null)
monitor = new NullProgressMonitor();
try {
// Query all the all the repositories this composite repo contains
CompoundQueryable queryable = new CompoundQueryable((IQueryable[]) loadedRepos.toArray(new IQueryable[loadedRepos.size()]));
- collector = queryable.query(query, monitor);
+ queryResult = queryable.query(query, monitor);
} finally {
if (monitor != null)
monitor.done();
}
- return collector;
+ return queryResult;
}
private void addChild(URI childURI, boolean save) {
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java
index 777486590..629016f71 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java
@@ -27,6 +27,7 @@ import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.Abstr
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.RepositoryReference;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -143,9 +144,8 @@ public class LocalMetadataRepository extends AbstractMetadataRepository {
return true;
}
- public synchronized Collector query(IQuery query, IProgressMonitor monitor) {
- Collector collector = new Collector();
- return query.perform(units.iterator(), collector);
+ public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ return query.perform(units.iterator(), new Collector());
}
public synchronized void removeAll() {
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java
index 8270d193b..b70074172 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryIO.java
@@ -26,12 +26,12 @@ import org.eclipse.equinox.internal.p2.persistence.XMLWriter;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.AbstractMetadataRepository;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.RepositoryReference;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.AbstractMetadataRepository.RepositoryState;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.BundleContext;
@@ -133,7 +133,7 @@ public class MetadataRepositoryIO {
attributeOptional(DESCRIPTION_ATTRIBUTE, repository.getDescription()); // TODO: could be cdata?
writeProperties(repository.getProperties());
- Collector units = repository.query(InstallableUnitQuery.ANY, null);
+ IQueryResult units = repository.query(InstallableUnitQuery.ANY, null);
if (repository instanceof LocalMetadataRepository) {
Set references = ((LocalMetadataRepository) repository).repositories;
writeRepositoryReferences(references.iterator(), references.size());
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/URLMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/URLMetadataRepository.java
index 0fa2d9b2a..f7756012c 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/URLMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/URLMetadataRepository.java
@@ -18,6 +18,7 @@ import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.AbstractMetadataRepository;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
/**
* A metadata repository backed by an arbitrary URL.
@@ -77,8 +78,7 @@ public class URLMetadataRepository extends AbstractMetadataRepository {
return false;
}
- public synchronized Collector query(IQuery query, IProgressMonitor monitor) {
- Collector collector = new Collector();
- return query.perform(units.iterator(), collector);
+ public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ return query.perform(units.iterator(), new Collector());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java
index d8e8a54e5..ef622876e 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/Collector.java
@@ -16,7 +16,7 @@ import java.util.*;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.Messages;
-import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.*;
/**
* A collector is a generic visitor that collects objects passed to it,
@@ -27,7 +27,7 @@ import org.eclipse.equinox.p2.metadata.query.IQuery;
* This default collector just accepts all objects passed to it. Clients may subclass
* to perform different processing on the objects passed to it.
*/
-public class Collector implements IQueryable {
+public class Collector implements IQueryResult, IAcceptor {
private Set collected = null;
/**
@@ -56,11 +56,11 @@ public class Collector implements IQueryable {
/**
* Adds the elements from one collector to this collector
- * @param collector The collector from which the elements should be retrieved
+ * @param queryResult The collector from which the elements should be retrieved
*/
- public void addAll(Collector collector) {
+ public void addAll(IQueryResult queryResult) {
boolean keepGoing = true;
- for (Iterator iter = collector.iterator(); iter.hasNext() && keepGoing;) {
+ for (Iterator iter = queryResult.iterator(); iter.hasNext() && keepGoing;) {
keepGoing = accept(iter.next());
}
}
@@ -132,7 +132,7 @@ public class Collector implements IQueryable {
/**
* Performs a query on this results of this collector.
*/
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
Iterator iter = toCollection().iterator();
if (monitor == null)
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/CompoundQueryable.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/CompoundQueryable.java
index ba8e552e3..d87348acd 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/CompoundQueryable.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/CompoundQueryable.java
@@ -13,6 +13,7 @@ import java.lang.reflect.Array;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
/**
* A queryable that holds a number of other IQueryables and provides
@@ -26,9 +27,9 @@ public class CompoundQueryable implements IQueryable {
this.queryables = queryables;
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
- Collector results = new Collector();
- Collector subResults = null;
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ IQueryResult results = new Collector();
+ IQueryResult subResults = null;
if (monitor == null) {
monitor = new NullProgressMonitor();
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/IQueryable.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/IQueryable.java
index d86478367..8dd639c62 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/IQueryable.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/provisional/p2/metadata/query/IQueryable.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.provisional.p2.metadata.query;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.equinox.p2.metadata.query.IQuery;
@@ -32,5 +34,5 @@ public interface IQueryable {
* reporting is not desired
* @return The collector argument
*/
- public Collector query(IQuery query, IProgressMonitor monitor);
+ public IQueryResult query(IQuery query, IProgressMonitor monitor);
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IAcceptor.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IAcceptor.java
new file mode 100644
index 000000000..d8e1fccac
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IAcceptor.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+* Copyright (c) 2009 EclipseSource and others. All rights reserved. This
+* program and the accompanying materials are made available under the terms of
+* the Eclipse Public License v1.0 which accompanies this distribution, and is
+* available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* EclipseSource - initial API and implementation
+******************************************************************************/
+package org.eclipse.equinox.p2.metadata.query;
+
+/**
+ * @author irbull
+ *
+ */
+public interface IAcceptor {
+
+ /**
+ * Accepts an object.
+ * <p>
+ * This default implementation adds the objects to a list. Clients may
+ * override this method to perform additional filtering, add different objects
+ * to the list, short-circuit the traversal, or process the objects directly without
+ * collecting them.
+ *
+ * @param object the object to collect or visit
+ * @return <code>true</code> if the traversal should continue,
+ * or <code>false</code> to indicate the traversal should stop.
+ */
+ public boolean accept(Object object);
+}
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IQueryResult.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IQueryResult.java
new file mode 100644
index 000000000..fff8305dc
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/query/IQueryResult.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+* Copyright (c) 2009 EclipseSource and others. All rights reserved. This
+* program and the accompanying materials are made available under the terms of
+* the Eclipse Public License v1.0 which accompanies this distribution, and is
+* available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* EclipseSource - initial API and implementation
+******************************************************************************/
+package org.eclipse.equinox.p2.metadata.query;
+
+import java.util.Collection;
+import java.util.Iterator;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
+
+/**
+ * An IQueryResult represents the results of a query.
+ *
+ */
+public interface IQueryResult extends IQueryable {
+
+ /**
+ * Adds the elements from one QueryResult to this one
+ * @param queryResult A QueryResult from which the elements should be retrieved
+ */
+ public void addAll(IQueryResult queryResult);
+
+ /**
+ * Returns whether this QueryResult is empty.
+ * @return <code>true</code> if this QueryResult has accepted any results,
+ * and <code>false</code> otherwise.
+ */
+ public boolean isEmpty();
+
+ /**
+ * Returns an iterator on the collected objects.
+ *
+ * @return an iterator of the collected objects.
+ */
+ public Iterator iterator();
+
+ /**
+ * Returns the number of collected objects.
+ */
+ public int size();
+
+ /**
+ * Returns the collected objects as an array
+ *
+ * @param clazz The type of array to return
+ * @return The array of results
+ * @throws ArrayStoreException the runtime type of the specified array is
+ * not a supertype of the runtime type of every collected object
+ */
+ public Object[] toArray(Class clazz);
+
+ /**
+ * Returns the collected objects as an immutable collection.
+ *
+ * @return An unmodifiable collection of the collected objects
+ */
+ public Collection toCollection();
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java
index 54cd32280..11e3962ce 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/InstallOperation.java
@@ -15,11 +15,11 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.operations.*;
import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.metadata.query.PatchQuery;
/**
@@ -74,7 +74,7 @@ public class InstallOperation extends ProfileChangeOperation {
request.setInstallableUnitInclusionRules(toInstall[i], PlannerHelper.createOptionalInclusionRule(toInstall[i]));
// Check to see if it is already installed. This may alter the request.
- Collector alreadyInstalled = profile.query(new InstallableUnitQuery(toInstall[i].getId()), null);
+ IQueryResult alreadyInstalled = profile.query(new InstallableUnitQuery(toInstall[i].getId()), null);
// TODO ideally we should only do this check if the iu is a singleton, but in practice many iu's that should
// be singletons are not, so we don't check this (yet)
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=230878
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
index bc2644951..7d2ca9d08 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/ProvisioningSession.java
@@ -22,7 +22,6 @@ import org.eclipse.equinox.internal.p2.operations.Messages;
import org.eclipse.equinox.internal.provisional.configurator.Configurator;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus;
import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.core.IAgentLocation;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
@@ -30,6 +29,7 @@ import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -307,8 +307,8 @@ public class ProvisioningSession {
query = InstallableUnitQuery.ANY;
else
query = new UserVisibleRootQuery();
- Collector collector = profile.query(query, null);
- return (IInstallableUnit[]) collector.toArray(IInstallableUnit.class);
+ IQueryResult queryResult = profile.query(query, null);
+ return (IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java
index 873daed8d..96de15c13 100644
--- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java
+++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java
@@ -16,10 +16,10 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.operations.*;
import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.metadata.query.PatchQuery;
/**
@@ -141,7 +141,7 @@ public class UpdateOperation extends ProfileChangeOperation {
// In the case of patches, it's possible that a patch is returned as an available update
// even though it is already installed, because we are querying each IU for updates individually.
// For now, we ignore any proposed update that is already installed.
- Collector alreadyInstalled = profile.query(new InstallableUnitQuery(replacements[i]), null);
+ IQueryResult alreadyInstalled = profile.query(new InstallableUnitQuery(replacements[i]), null);
if (alreadyInstalled.isEmpty()) {
Update update = new Update(iu, replacements[i]);
updates.add(update);
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java
index 790527264..d41b319f4 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java
@@ -27,6 +27,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.Inst
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.actions.*;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
@@ -553,18 +554,18 @@ public abstract class AbstractPublisherAction implements IPublisherAction {
*/
protected IInstallableUnit[] queryForIUs(IPublisherResult publisherResult, String iuId, VersionRange versionRange) {
IQuery query = null;
- Collector collector = new Collector();
+ IQueryResult queryResult = new Collector();
query = new InstallableUnitQuery(iuId, versionRange);
NullProgressMonitor progress = new NullProgressMonitor();
if (publisherResult != null)
- collector = publisherResult.query(query, progress);
- if (collector.isEmpty() && info.getMetadataRepository() != null)
- collector = info.getMetadataRepository().query(query, progress);
- if (collector.isEmpty() && info.getContextMetadataRepository() != null)
- collector = info.getContextMetadataRepository().query(query, progress);
-
- if (!collector.isEmpty())
- return (IInstallableUnit[]) collector.toArray(IInstallableUnit.class);
+ queryResult = publisherResult.query(query, progress);
+ if (queryResult.isEmpty() && info.getMetadataRepository() != null)
+ queryResult = info.getMetadataRepository().query(query, progress);
+ if (queryResult.isEmpty() && info.getContextMetadataRepository() != null)
+ queryResult = info.getContextMetadataRepository().query(query, progress);
+
+ if (!queryResult.isEmpty())
+ return (IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class);
return new IInstallableUnit[0];
}
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/PublisherResult.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/PublisherResult.java
index 3e522828c..754f66b9c 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/PublisherResult.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/PublisherResult.java
@@ -16,6 +16,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
public class PublisherResult implements IPublisherResult {
@@ -130,16 +131,15 @@ public class PublisherResult implements IPublisherResult {
this.map = map;
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
- Collector collector = new Collector();
- return query.perform(flatten(this.map.values()).iterator(), collector);
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ return query.perform(flatten(this.map.values()).iterator(), new Collector());
}
}
/**
* Queries both the root and non root IUs
*/
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
IQueryable nonRootQueryable = new QueryableMap(nonRootIUs);
IQueryable rootQueryable = new QueryableMap(rootIUs);
return new CompoundQueryable(new IQueryable[] {nonRootQueryable, rootQueryable}).query(query, monitor);
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java
index 6c5aff872..cb8acab3c 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/actions/QueryableFilterAdvice.java
@@ -11,8 +11,10 @@ package org.eclipse.equinox.p2.publisher.actions;
import org.eclipse.equinox.internal.p2.metadata.LDAPQuery;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
/**
* An IFilterAdvice that looks up the desired IU in the publisher's input metadata
@@ -28,13 +30,13 @@ public class QueryableFilterAdvice implements IFilterAdvice {
public String getFilter(String id, Version version, boolean exact) {
InstallableUnitQuery query = new InstallableUnitQuery(id, version);
- Collector result = queryable.query(query, null);
+ IQueryResult result = queryable.query(query, null);
if (!result.isEmpty())
return ((LDAPQuery) ((IInstallableUnit) result.iterator().next()).getFilter()).getFilter();
if (exact)
return null;
query = new InstallableUnitQuery(id);
- result = queryable.query(query, null);
+ result.addAll(queryable.query(query, null));
if (!result.isEmpty())
return ((LDAPQuery) ((IInstallableUnit) result.iterator().next()).getFilter()).getFilter();
return null;
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
index 03bbe9034..a6e29e93f 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/ProfileSynchronizer.java
@@ -27,6 +27,7 @@ import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.GroupQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository;
@@ -339,7 +340,7 @@ public class ProfileSynchronizer {
}
// get all IUs from profile with marked property (existing)
- Collector dropinIUs = profile.query(new IUProfilePropertyQuery(PROP_FROM_DROPINS, Boolean.toString(true)), null);
+ IQueryResult dropinIUs = profile.query(new IUProfilePropertyQuery(PROP_FROM_DROPINS, Boolean.toString(true)), null);
Collection all = new HashSet(allIUs.toCollection());
for (Iterator iter = dropinIUs.iterator(); iter.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iter.next();
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java
index ba846b035..f88e609ae 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java
@@ -17,10 +17,10 @@ import org.eclipse.equinox.internal.p2.artifact.repository.RawMirrorRequest;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.ArtifactComparatorFactory;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactComparator;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.internal.repository.tools.Activator;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.osgi.util.NLS;
@@ -82,7 +82,7 @@ public class Mirroring {
if (keysToMirror != null)
keys = keysToMirror.iterator();
else {
- Collector result = source.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult result = source.query(ArtifactKeyQuery.ALL_KEYS, null);
keys = result.iterator();
}
while (keys.hasNext()) {
@@ -213,7 +213,7 @@ public class Mirroring {
if (keysToMirror != null) {
keys = keysToMirror.iterator();
} else {
- Collector result = source.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult result = source.query(ArtifactKeyQuery.ALL_KEYS, null);
keys = result.iterator();
}
while (keys.hasNext()) {
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java
index 9122919cb..5f69beb18 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/MirrorApplication.java
@@ -26,6 +26,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.internal.repository.mirroring.*;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.osgi.util.NLS;
@@ -195,7 +196,7 @@ public class MirrorApplication extends AbstractApplication implements IApplicati
private IStatus mirrorArtifacts(IQueryable slice, IProgressMonitor monitor) throws ProvisionException {
// Obtain ArtifactKeys from IUs
- Collector ius = slice.query(InstallableUnitQuery.ANY, monitor);
+ IQueryResult ius = slice.query(InstallableUnitQuery.ANY, monitor);
ArrayList keys = new ArrayList(ius.size());
for (Iterator iterator = ius.iterator(); iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
@@ -234,7 +235,7 @@ public class MirrorApplication extends AbstractApplication implements IApplicati
}
private void mirrorMetadata(IQueryable slice, IProgressMonitor monitor) {
- Collector allIUs = slice.query(InstallableUnitQuery.ANY, monitor);
+ IQueryResult allIUs = slice.query(InstallableUnitQuery.ANY, monitor);
destinationMetadataRepository.addInstallableUnits((IInstallableUnit[]) allIUs.toArray(IInstallableUnit.class));
}
@@ -264,13 +265,13 @@ public class MirrorApplication extends AbstractApplication implements IApplicati
for (int i = 0; i < rootIUs.length; i++) {
String[] segments = getArrayArgsFromString(rootIUs[i], "/"); //$NON-NLS-1$
VersionRange range = segments.length > 1 ? new VersionRange(segments[i]) : null;
- Collector collector = metadataRepo.query(new InstallableUnitQuery(segments[i], range), null);
- sourceIUs.addAll(collector.toCollection());
+ IQueryResult queryResult = metadataRepo.query(new InstallableUnitQuery(segments[i], range), null);
+ sourceIUs.addAll(queryResult.toCollection());
}
} else if (sourceIUs == null || sourceIUs.isEmpty()) {
sourceIUs = new ArrayList();
- Collector collector = metadataRepo.query(InstallableUnitQuery.ANY, null);
- sourceIUs.addAll(collector.toCollection());
+ IQueryResult queryResult = metadataRepo.query(InstallableUnitQuery.ANY, null);
+ sourceIUs.addAll(queryResult.toCollection());
/* old metadata mirroring app did not throw an exception here */
if (sourceIUs.size() == 0 && destinationMetadataRepository != null && metadataOrArtifacts == null)
throw new ProvisionException(Messages.MirrorApplication_no_IUs);
@@ -314,9 +315,8 @@ public class MirrorApplication extends AbstractApplication implements IApplicati
IQueryable slice = slicer.slice((IInstallableUnit[]) sourceIUs.toArray(new IInstallableUnit[sourceIUs.size()]), monitor);
if (slice != null && slicingOptions.latestVersionOnly()) {
- Collector collector = new Collector();
- collector = slice.query(new LatestIUVersionQuery(), monitor);
- slice = collector;
+ IQueryResult queryResult = slice.query(new LatestIUVersionQuery(), monitor);
+ slice = queryResult;
}
if (slicer.getStatus().getSeverity() != IStatus.OK && mirrorLog != null) {
mirrorLog.log(slicer.getStatus());
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java
index d27dd0845..e8da53e1b 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/RecreateRepositoryApplication.java
@@ -18,8 +18,8 @@ import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.artifact.*;
@@ -68,7 +68,7 @@ public class RecreateRepositoryApplication extends AbstractApplication {
repoProperties = repository.getProperties();
repoMap = new HashMap();
- Collector keys = repository.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = repository.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
IArtifactDescriptor[] descriptors = repository.getArtifactDescriptors(key);
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java
index d855c80f1..b432b2542 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/Repo2Runnable.java
@@ -19,13 +19,13 @@ import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.internal.p2.engine.phases.Collect;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -190,7 +190,7 @@ public class Repo2Runnable extends AbstractApplication implements IApplication {
/*
* Return a collector over all the IUs contained in the given repository.
*/
- private Collector getAllIUs(IMetadataRepository repository, IProgressMonitor monitor) {
+ private IQueryResult getAllIUs(IMetadataRepository repository, IProgressMonitor monitor) {
SubMonitor progress = SubMonitor.convert(monitor, 2);
try {
return repository.query(InstallableUnitQuery.ANY, progress.newChild(1));
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java
index b8460d1b7..e6f07588e 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/tools/analyzer/HostCheckAnalyzer.java
@@ -12,10 +12,10 @@ package org.eclipse.equinox.p2.internal.repository.tools.analyzer;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnitFragment;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.tools.analyzer.IUAnalyzer;
@@ -36,7 +36,7 @@ public class HostCheckAnalyzer extends IUAnalyzer {
if (hosts[i] instanceof IRequiredCapability)
theHost = (IRequiredCapability) hosts[i];
if (theHost.getNamespace().equals("osgi.bundle")) {
- Collector results = repository.query(new InstallableUnitQuery(theHost.getName(), theHost.getRange()), new NullProgressMonitor());
+ IQueryResult results = repository.query(new InstallableUnitQuery(theHost.getName(), theHost.getRange()), new NullProgressMonitor());
if (results.size() == 0) {
error(iu, "IU Fragment: " + iu.getId() + " cannot find host" + theHost.getName() + " : " + theHost.getRange());
return;
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java
index 33594ae29..c77f30b6b 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/repository/tools/analyzer/RepositoryAnalyzer.java
@@ -11,10 +11,10 @@ package org.eclipse.equinox.p2.repository.tools.analyzer;
import java.util.Iterator;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.internal.repository.tools.Activator;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
/**
@@ -35,7 +35,7 @@ public class RepositoryAnalyzer {
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(IIUAnalyzer.ID);
for (int i = 0; i < repositories.length; i++) {
- Collector queryResult = repositories[i].query(InstallableUnitQuery.ANY, sub);
+ IQueryResult queryResult = repositories[i].query(InstallableUnitQuery.ANY, sub);
SubMonitor repositoryMonitor = SubMonitor.convert(sub, queryResult.size());
for (int j = 0; j < config.length; j++) {
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
index 4f493f696..9912d0e53 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
@@ -18,9 +18,9 @@ import org.apache.tools.ant.*;
import org.apache.tools.ant.types.FileSet;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.URIUtil;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.internal.repository.tools.*;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.osgi.util.NLS;
@@ -167,11 +167,11 @@ public abstract class AbstractRepositoryTask extends Task {
IUDescription iu = (IUDescription) iter.next();
IQuery iuQuery = iu.createQuery();
- Collector collector = repository.query(iuQuery, null);
+ IQueryResult queryResult = repository.query(iuQuery, null);
- if (iu.isRequired() && collector.isEmpty())
+ if (iu.isRequired() && queryResult.isEmpty())
throw new BuildException(NLS.bind(Messages.AbstractRepositoryTask_unableToFind, iu.toString()));
- result.addAll(collector.toCollection());
+ result.addAll(queryResult.toCollection());
}
return result;
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java
index c6ff9e02c..7f3366de5 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RemoveIUTask.java
@@ -15,12 +15,12 @@ import org.apache.tools.ant.BuildException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.internal.repository.tools.AbstractApplication;
import org.eclipse.equinox.p2.internal.repository.tools.Messages;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -65,12 +65,12 @@ public class RemoveIUTask extends AbstractRepositoryTask {
IUDescription iu = (IUDescription) iter.next();
IQuery iuQuery = iu.createQuery();
- Collector collector = repository.query(iuQuery, null);
+ IQueryResult queryResult = repository.query(iuQuery, null);
- if (collector.isEmpty())
+ if (queryResult.isEmpty())
getProject().log(NLS.bind(Messages.AbstractRepositoryTask_unableToFind, iu.toString()));
else {
- for (Iterator iterator = collector.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = queryResult.iterator(); iterator.hasNext();) {
IInstallableUnit unit = (IInstallableUnit) iterator.next();
IArtifactKey[] keys = unit.getArtifacts();
Filter filter = null;
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
index 6e4d8c0fb..d88fcf971 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
@@ -25,6 +25,7 @@ import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
import org.eclipse.equinox.p2.core.IAgentLocation;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.security.storage.EncodingUtils;
@@ -1074,8 +1075,8 @@ public abstract class AbstractRepositoryManager implements IRepositoryManager, P
* reporting is not desired
* @return A collector containing the results of the query
*/
- public Collector query(IQuery query, IProgressMonitor monitor) {
- Collector collector = new Collector();
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ IQueryResult queryResult = new Collector();
URI[] locations = getKnownRepositories(REPOSITORIES_ALL);
List queryables = new ArrayList(locations.length); // use a list since we don't know exactly how many will load
SubMonitor sub = SubMonitor.convert(monitor, locations.length * 10);
@@ -1091,10 +1092,10 @@ public abstract class AbstractRepositoryManager implements IRepositoryManager, P
try {
IQueryable[] queryablesArray = (IQueryable[]) queryables.toArray(new IQueryable[queryables.size()]);
CompoundQueryable compoundQueryable = new CompoundQueryable(queryablesArray);
- collector = compoundQueryable.query(query, sub.newChild(locations.length * 1));
+ queryResult = compoundQueryable.query(query, sub.newChild(locations.length * 1));
} finally {
sub.done();
}
- return collector;
+ return queryResult;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java
index 3e7bdcf38..6efa9d747 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/AnyRequiredCapabilityTest.java
@@ -18,6 +18,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.TestData;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
@@ -49,7 +50,7 @@ public class AnyRequiredCapabilityTest extends AbstractQueryTest {
metadataRepositoryManager.addRepository(location);
QueryableMetadataRepositoryManager manager = new QueryableMetadataRepositoryManager(ProvisioningUI.getDefaultUI(), false);
IRequirement requires = MetadataFactory.createRequiredCapability("org.eclipse.equinox.p2.iu", "test.bundle", ANY_VERSION, null, false, false);
- Collector result = manager.query(requires.getMatches(), getMonitor());
+ IQueryResult result = manager.query(requires.getMatches(), getMonitor());
assertEquals("1.0", 1, result.size());
IInstallableUnit iu = (IInstallableUnit) result.iterator().next();
assertEquals("1.1", "test.bundle", iu.getId());
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java
index ccbdb2129..5e30b2c02 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryDescriptorTest.java
@@ -9,6 +9,8 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.query;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.util.*;
import junit.framework.TestCase;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -25,7 +27,7 @@ public class QueryDescriptorTest extends TestCase {
class SimpleQueryable implements IQueryable {
List elements = Arrays.asList(new String[] {"a", "b", "c", "d", "e"});
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
return query.perform(elements.iterator(), collector);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableArtifactRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableArtifactRepositoryManagerTest.java
index 377c7f195..0b789934f 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableArtifactRepositoryManagerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableArtifactRepositoryManagerTest.java
@@ -13,7 +13,7 @@ package org.eclipse.equinox.p2.tests.ui.query;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.internal.p2.ui.QueryableArtifactRepositoryManager;
import org.eclipse.equinox.internal.p2.ui.RepositoryLocationQuery;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
@@ -43,7 +43,7 @@ public class QueryableArtifactRepositoryManagerTest extends AbstractQueryTest {
public void testQuery() {
QueryableArtifactRepositoryManager manager = getQueryableManager();
- Collector result = manager.query(new RepositoryLocationQuery(), getMonitor());
+ IQueryResult result = manager.query(new RepositoryLocationQuery(), getMonitor());
assertTrue(result.size() == repoCount);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java
index 06b35a2d2..94f11bc77 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/QueryableMetadataRepositoryManagerTest.java
@@ -20,8 +20,10 @@ import org.eclipse.equinox.internal.p2.ui.model.MetadataRepositories;
import org.eclipse.equinox.internal.p2.ui.query.IUViewQueryContext;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IUPropertyQuery;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.operations.ProvisioningJob;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.repository.IRepository;
@@ -106,7 +108,7 @@ public class QueryableMetadataRepositoryManagerTest extends AbstractQueryTest {
metadataRepositoryManager.addRepository(broken);
QueryableMetadataRepositoryManager manager = getQueryableManager();
- Collector result = manager.query(new InstallableUnitQuery("test.bundle", Version.createOSGi(1, 0, 0)), new CancelingProgressMonitor());
+ IQueryResult result = manager.query(new InstallableUnitQuery("test.bundle", Version.createOSGi(1, 0, 0)), new CancelingProgressMonitor());
assertEquals("1.0", 0, result.size());
}
@@ -175,7 +177,7 @@ public class QueryableMetadataRepositoryManagerTest extends AbstractQueryTest {
metadataRepositoryManager.addRepository(broken);
QueryableMetadataRepositoryManager manager = getQueryableManager();
- Collector result = manager.query(new InstallableUnitQuery("test.bundle", Version.createOSGi(1, 0, 0)), getMonitor());
+ IQueryResult result = manager.query(new InstallableUnitQuery("test.bundle", Version.createOSGi(1, 0, 0)), getMonitor());
assertEquals("1.0", 1, result.size());
IInstallableUnit iu = (IInstallableUnit) result.iterator().next();
assertEquals("1.1", "test.bundle", iu.getId());
diff --git a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java
index 578ba3898..9798496fd 100644
--- a/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests.ui/src/org/eclipse/equinox/p2/tests/ui/query/TranslationSupportTests.java
@@ -11,8 +11,6 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests.ui.query;
-import org.eclipse.equinox.p2.metadata.ICopyright;
-
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
@@ -27,11 +25,12 @@ import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitFragmentDescription;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.common.TranslationSupport;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
+import org.eclipse.equinox.p2.metadata.ICopyright;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.IUPropertyUtils;
@@ -53,7 +52,7 @@ public class TranslationSupportTests extends AbstractQueryTest {
fail("1.99", e);
return;
}
- Collector result = repository.query(new InstallableUnitQuery("test.feature.feature.group"), getMonitor());
+ IQueryResult result = repository.query(new InstallableUnitQuery("test.feature.feature.group"), getMonitor());
assertTrue("1.0", !result.isEmpty());
IInstallableUnit unit = (IInstallableUnit) result.iterator().next();
diff --git a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java
index 53ae78ca4..088b9305e 100644
--- a/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java
+++ b/bundles/org.eclipse.equinox.p2.tests.verifier/src/org/eclipse/equinox/internal/p2/tests/verifier/VerifierApplication.java
@@ -19,10 +19,10 @@ import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.osgi.framework.internal.core.Constants;
import org.eclipse.osgi.service.resolver.*;
import org.eclipse.osgi.util.NLS;
@@ -296,7 +296,7 @@ public class VerifierApplication implements IApplication {
IProfile profile = registry.getProfile(IProfileRegistry.SELF);
if (profile == null)
return createError("SELF profile not available in profile registry."); //$NON-NLS-1$
- Collector results = profile.query(new InstallableUnitQuery(Activator.PLUGIN_ID), null);
+ IQueryResult results = profile.query(new InstallableUnitQuery(Activator.PLUGIN_ID), null);
if (results.isEmpty())
return createError(NLS.bind("IU for {0} not found in SELF profile.", Activator.PLUGIN_ID)); //$NON-NLS-1$
return Status.OK_STATUS;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractAntProvisioningTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractAntProvisioningTest.java
index f46ba1c3b..723e2a862 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractAntProvisioningTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractAntProvisioningTest.java
@@ -20,8 +20,10 @@ import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
import org.eclipse.equinox.internal.p2.persistence.XMLWriter;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
@@ -247,7 +249,7 @@ public class AbstractAntProvisioningTest extends AbstractProvisioningTest {
assertContains(message, destination, source);
}
- protected void assertArtifactKeyContentEquals(String message, Collector ius, URI artifactRepositoryLocation) {
+ protected void assertArtifactKeyContentEquals(String message, IQueryResult ius, URI artifactRepositoryLocation) {
try {
IArtifactRepository repo = getArtifactRepositoryManager().loadRepository(artifactRepositoryLocation, null);
List fromIUs = getArtifactKeys(ius);
@@ -261,12 +263,12 @@ public class AbstractAntProvisioningTest extends AbstractProvisioningTest {
}
protected static void assertContains(String message, IQueryable source, IQueryable destination) {
- Collector sourceCollector = source.query(InstallableUnitQuery.ANY, null);
+ IQueryResult sourceCollector = source.query(InstallableUnitQuery.ANY, null);
Iterator it = sourceCollector.iterator();
while (it.hasNext()) {
IInstallableUnit sourceIU = (IInstallableUnit) it.next();
- Collector destinationCollector = destination.query(new InstallableUnitQuery(sourceIU), null);
+ IQueryResult destinationCollector = destination.query(new InstallableUnitQuery(sourceIU), null);
assertEquals(message, 1, destinationCollector.size());
assertTrue(message, sourceIU.equals(destinationCollector.iterator().next()));
}
@@ -277,7 +279,7 @@ public class AbstractAntProvisioningTest extends AbstractProvisioningTest {
assertTrue(message, fromRepo.contains(iter.next()));
}
- protected static List getArtifactKeys(Collector ius) {
+ protected static List getArtifactKeys(IQueryResult ius) {
List keys = new ArrayList(ius.size());
for (Iterator iter = ius.iterator(); iter.hasNext();)
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
index def49c8c9..c4df72a39 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractProvisioningTest.java
@@ -8,8 +8,6 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests;
-import org.eclipse.equinox.p2.metadata.ICopyright;
-
import java.io.*;
import java.lang.reflect.Field;
import java.net.URI;
@@ -29,13 +27,13 @@ import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEv
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.core.IAgentLocation;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.PublisherInfo;
import org.eclipse.equinox.p2.publisher.eclipse.*;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
@@ -800,11 +798,11 @@ public abstract class AbstractProvisioningTest extends TestCase {
}
protected IInstallableUnit getIU(IMetadataRepository repository, String name) {
- Collector collector = repository.query(new InstallableUnitQuery(name), null);
+ IQueryResult queryResult = repository.query(new InstallableUnitQuery(name), null);
IInstallableUnit unit = null;
- if (collector.size() > 0)
- unit = (IInstallableUnit) collector.iterator().next();
+ if (queryResult.size() > 0)
+ unit = (IInstallableUnit) queryResult.iterator().next();
return unit;
}
@@ -1171,7 +1169,7 @@ public abstract class AbstractProvisioningTest extends TestCase {
* Note: NOT BICONDITIONAL! assertContains(A, B) is NOT the same as assertContains(B, A)
*/
protected static void assertContains(String message, IArtifactRepository sourceRepo, IArtifactRepository destinationRepo) {
- Collector sourceKeys = sourceRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult sourceKeys = sourceRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = sourceKeys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
IArtifactDescriptor[] destinationDescriptors = destinationRepo.getArtifactDescriptors(key);
@@ -1199,12 +1197,12 @@ public abstract class AbstractProvisioningTest extends TestCase {
* Note: NOT BICONDITIONAL! assertContains(A, B) is NOT the same as assertContains(B, A)
*/
protected static void assertContains(String message, IMetadataRepository sourceRepo, IMetadataRepository destinationRepo) {
- Collector sourceCollector = sourceRepo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult sourceCollector = sourceRepo.query(InstallableUnitQuery.ANY, null);
Iterator it = sourceCollector.iterator();
while (it.hasNext()) {
IInstallableUnit sourceIU = (IInstallableUnit) it.next();
- Collector destinationCollector = destinationRepo.query(new InstallableUnitQuery(sourceIU), null);
+ IQueryResult destinationCollector = destinationRepo.query(new InstallableUnitQuery(sourceIU), null);
assertEquals(message, 1, destinationCollector.size());
assertEquals(message, sourceIU, (IInstallableUnit) destinationCollector.iterator().next());
}
@@ -1380,7 +1378,7 @@ public abstract class AbstractProvisioningTest extends TestCase {
int count = 0;
try {
IArtifactRepository repo = getArtifactRepositoryManager().loadRepository(location, null);
- Collector descriptors = repo.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
+ IQueryResult descriptors = repo.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
return descriptors.size();
} catch (ProvisionException e) {
fail("Failed to load repository " + URIUtil.toUnencodedString(location) + " for ArtifactDescriptor count");
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java
index 95b2d9903..ba05fd0c3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java
@@ -10,13 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.io.OutputStream;
import java.net.URI;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
import org.eclipse.equinox.p2.repository.artifact.*;
@@ -133,7 +134,7 @@ public class AbstractWrappedArtifactRepository implements IArtifactRepository {
return delegate.createArtifactDescriptor(key);
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return delegate.query(query, monitor);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/IUPropertyUtils.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/IUPropertyUtils.java
index 22bf0d93d..402cffd28 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/IUPropertyUtils.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/IUPropertyUtils.java
@@ -11,17 +11,13 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests;
-import org.eclipse.equinox.p2.metadata.ICopyright;
-
import java.lang.ref.SoftReference;
import java.util.*;
import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.IRequirement;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
-import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.query.*;
public class IUPropertyUtils {
@@ -39,7 +35,7 @@ public class IUPropertyUtils {
final String NAMESPACE_IU_LOCALIZATION = "org.eclipse.equinox.p2.localization"; //$NON-NLS-1$
// Cache the IU fragments that provide localizations for a given locale.
- // map: locale => soft reference to a collector
+ // map: locale => soft reference to a QueryResult
private Map LocaleCollectorCache = new HashMap(2);
// Get the license in the default locale.
@@ -110,7 +106,7 @@ public class IUPropertyUtils {
final List locales = buildLocaleVariants(locale);
final IInstallableUnit theUnit = iu;
- Collector localizationFragments = getLocalizationFragments(locale, locales);
+ IQueryResult localizationFragments = getLocalizationFragments(locale, locales);
MatchQuery hostLocalizationQuery = new MatchQuery() {
public boolean isMatch(Object object) {
@@ -171,10 +167,10 @@ public class IUPropertyUtils {
/**
* Collects the installable unit fragments that contain locale data for the given locales.
*/
- private synchronized Collector getLocalizationFragments(Locale locale, List localeVariants) {
- SoftReference collectorRef = (SoftReference) LocaleCollectorCache.get(locale);
- if (collectorRef != null) {
- Collector cached = (Collector) collectorRef.get();
+ private synchronized IQueryResult getLocalizationFragments(Locale locale, List localeVariants) {
+ SoftReference queryResultRef = (SoftReference) LocaleCollectorCache.get(locale);
+ if (queryResultRef != null) {
+ Collector cached = (Collector) queryResultRef.get();
if (cached != null)
return cached;
}
@@ -207,7 +203,7 @@ public class IUPropertyUtils {
};
IQuery iuQuery = new PipedQuery(new IQuery[] {new FragmentQuery(), localeFragmentQuery});
- Collector collected = queryable.query(iuQuery, null);
+ IQueryResult collected = queryable.query(iuQuery, null);
LocaleCollectorCache.put(locale, new SoftReference(collected));
return collected;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/MockQueryable.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/MockQueryable.java
index 2b3f9555a..898f5aa63 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/MockQueryable.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/MockQueryable.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
/**
* A test queryable that contains a simple collection of objects.
@@ -37,9 +38,8 @@ public class MockQueryable implements IQueryable {
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
- Collector collector = new Collector();
- return query.perform(items.iterator(), collector);
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
+ return query.perform(items.iterator(), new Collector());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java
index 5d69a2c6f..b16387019 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/TestArtifactRepository.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.p2.tests;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.io.*;
import java.lang.reflect.Method;
import java.net.URI;
@@ -21,7 +23,6 @@ import org.eclipse.equinox.internal.p2.artifact.repository.ArtifactRequest;
import org.eclipse.equinox.internal.p2.repository.Transport;
import org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryCreationException;
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
@@ -195,7 +196,7 @@ public class TestArtifactRepository extends AbstractArtifactRepository {
throw new UnsupportedOperationException("Method is not implemented by this repository");
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
// TODO Auto-generated method stub
return null;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
index 52e40fc3f..f5831eee2 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java
@@ -24,6 +24,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -300,7 +301,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -330,7 +331,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -358,7 +359,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -387,7 +388,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -418,7 +419,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
AntTaskElement mirror = createMirrorTask(TYPE_METADATA);
@@ -450,7 +451,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
// Create task
@@ -482,7 +483,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("test.feature.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("test.feature.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
// Create task
@@ -518,7 +519,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("test.feature.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("test.feature.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
// Create task
@@ -547,7 +548,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("test.feature.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("test.feature.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
c = repo.query(new InstallableUnitQuery("RCP_Browser_Example.feature.group"), new NullProgressMonitor());
@@ -580,7 +581,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Loading repository failed", e);
}
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.ui.examples.readmetool"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.ui.examples.readmetool"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
// Create task
@@ -749,7 +750,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
/*
* Get the number of ArtifactKeys in a repository
*/
- protected int getArtifactKeyCount(Collector ius) {
+ protected int getArtifactKeyCount(IQueryResult ius) {
int count = 0;
for (Iterator iter = ius.iterator(); iter.hasNext();)
count += ((InstallableUnit) iter.next()).getArtifacts().length;
@@ -772,9 +773,9 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest {
* Add all IUs to the parent element
*/
protected void addAllIUs(AntTaskElement parent, IMetadataRepository repo) {
- Collector collector = repo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult queryResult = repo.query(InstallableUnitQuery.ANY, null);
- for (Iterator iter = collector.iterator(); iter.hasNext();) {
+ for (Iterator iter = queryResult.iterator(); iter.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iter.next();
parent.addElement(createIUElement(iu));
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java
index 88ad541c4..b7f4e2e93 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/Repo2RunnableTaskTests.java
@@ -16,10 +16,10 @@ import java.util.Collection;
import java.util.Iterator;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractAntProvisioningTest;
@@ -117,7 +117,7 @@ public class Repo2RunnableTaskTests extends AbstractAntProvisioningTest {
} catch (ProvisionException e) {
fail("Failed to load repository", e);
}
- Collector keys = repo.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = repo.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
IArtifactDescriptor[] descriptors = repo.getArtifactDescriptors(key);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/RepoTasksTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/RepoTasksTests.java
index c0914509a..5388e0b9f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/RepoTasksTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/RepoTasksTests.java
@@ -12,8 +12,8 @@ package org.eclipse.equinox.p2.tests.ant;
import java.io.File;
import java.net.URI;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -64,7 +64,7 @@ public class RepoTasksTests extends AbstractAntProvisioningTest {
assertNull(iu);
IArtifactRepository artifacts = getArtifactRepositoryManager().loadRepository(destinationRepo, null);
- Collector keys = artifacts.query(new ArtifactKeyQuery(null, "anotherplugin", null), null);
+ IQueryResult keys = artifacts.query(new ArtifactKeyQuery(null, "anotherplugin", null), null);
assertEquals(keys.size(), 0);
assertFalse(new File(getTestFolder(getName()), "plugins/anotherplugin_1.0.0.jar").exists());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java
index 6efd4ed80..a0d591d47 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/Bug265577.java
@@ -15,11 +15,11 @@ import java.net.URI;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -61,8 +61,8 @@ public class Bug265577 extends AbstractProvisioningTest {
// Tests the response to a feature folder inside a jar
public void testZippedRepoWithFolderFeature() {
- Collector collector = metadataRepo.query(new InstallableUnitQuery("Field_Assist_Example.feature.jar"), null);
- IInstallableUnit[] ius = (IInstallableUnit[]) collector.toArray(IInstallableUnit.class);
+ IQueryResult queryResult = metadataRepo.query(new InstallableUnitQuery("Field_Assist_Example.feature.jar"), null);
+ IInstallableUnit[] ius = (IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class);
IArtifactKey key = (ius[0].getArtifacts())[0];
IArtifactDescriptor[] descriptors = artifactRepo.getArtifactDescriptors(key);
@@ -85,8 +85,8 @@ public class Bug265577 extends AbstractProvisioningTest {
// Test to retrieve a file from a zipped metadata & artifact repository
public void testZippedRepo() {
- Collector collector = metadataRepo.query(new InstallableUnitQuery("valid.feature.jar"), null);
- IInstallableUnit[] ius = (IInstallableUnit[]) collector.toArray(IInstallableUnit.class);
+ IQueryResult queryResult = metadataRepo.query(new InstallableUnitQuery("valid.feature.jar"), null);
+ IInstallableUnit[] ius = (IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class);
IArtifactKey key = (ius[0].getArtifacts())[0];
IArtifactDescriptor[] descriptors = artifactRepo.getArtifactDescriptors(key);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
index d11156adb..f475176fa 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/CompositeArtifactRepositoryTest.java
@@ -24,8 +24,8 @@ import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.p2.persistence.CompositeRepositoryState;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
@@ -362,7 +362,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
}
//get the keys
- Collector keys = repo.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = repo.query(ArtifactKeyQuery.ALL_KEYS, null);
assertTrue("Error retreaiving artifact keys", keys.size() > 0);
//test for existing key
@@ -390,7 +390,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
}
//get the descriptors
- Collector keys = repo.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = repo.query(ArtifactKeyQuery.ALL_KEYS, null);
assertTrue("Error retreaiving artifact keys", keys.size() > 0);
IArtifactDescriptor[] descriptors = repo.getArtifactDescriptors((IArtifactKey) keys.iterator().next());
assertTrue("Error retreaiving artifact descriptors", descriptors.length > 0);
@@ -421,7 +421,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
fail("Error creating destination", e1);
}
- Collector keys = compRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = compRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
assertTrue("Error retreaiving artifact keys", keys.size() > 0);
IArtifactKey key = (IArtifactKey) keys.iterator().next();
IArtifactDescriptor[] descriptors = compRepo.getArtifactDescriptors(key);
@@ -505,7 +505,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
}
//create a request for a descriptor from repo1
- Collector keys1 = repo1.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys1 = repo1.query(ArtifactKeyQuery.ALL_KEYS, null);
IArtifactKey key1 = (IArtifactKey) keys1.iterator().next();
assertTrue("Error retreaiving artifact keys", keys1.size() > 0);
IArtifactDescriptor[] descriptors1 = repo1.getArtifactDescriptors(key1);
@@ -520,7 +520,7 @@ public class CompositeArtifactRepositoryTest extends AbstractProvisioningTest {
IArtifactRequest request1 = ((ArtifactRepositoryManager) getArtifactRepositoryManager()).createMirrorRequest(key1, destinationRepo, null, null);
//create a request for a descriptor from repo2
- Collector keys2 = repo2.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys2 = repo2.query(ArtifactKeyQuery.ALL_KEYS, null);
IArtifactKey key2 = (IArtifactKey) keys2.iterator().next();
assertTrue("Error retreaiving artifact keys", keys2.size() > 0);
IArtifactDescriptor[] descriptors2 = repo2.getArtifactDescriptors(key2);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java
index c5620b8a5..0c53e9c5d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java
@@ -18,8 +18,8 @@ import junit.framework.TestCase;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -90,7 +90,7 @@ public class FoldersRepositoryTest extends TestCase {
repo.addDescriptor(descriptor);
}
- Collector keys = repo.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = repo.query(ArtifactKeyQuery.ALL_KEYS, null);
assertEquals(2, keys.size());
for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MD5Tests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MD5Tests.java
index 2f42cdfc2..22f89b277 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MD5Tests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MD5Tests.java
@@ -18,7 +18,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -35,7 +35,7 @@ public class MD5Tests extends AbstractProvisioningTest {
}
public void testCheckMD5() {
- Collector descriptors = repo.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
+ IQueryResult descriptors = repo.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
for (Iterator iterator = descriptors.iterator(); iterator.hasNext();) {
IArtifactDescriptor desc = (IArtifactDescriptor) iterator.next();
IStatus status = repo.getArtifact(desc, new ByteArrayOutputStream(500), new NullProgressMonitor());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java
index f5c9f56d1..4e7f208b3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/MirrorRequestTest.java
@@ -24,11 +24,11 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifact
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository;
import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -135,7 +135,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
// Set status sequence, actual Statuses added later
source.setSequence(seq);
// Grab an ArtifactKey to mirror, doesn't matter which
- Collector keys = source.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = source.query(ArtifactKeyQuery.ALL_KEYS, null);
assertTrue("Unable to obtain artifact keys", keys != null && keys.size() > 0);
IArtifactKey key = (IArtifactKey) keys.iterator().next();
@@ -303,7 +303,7 @@ public class MirrorRequestTest extends AbstractProvisioningTest {
return delegate.getRawArtifact(descriptor, destination, monitor);
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return delegate.query(query, monitor);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
index 8afcfe8bf..62ab04276 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/SimpleArtifactRepositoryTest.java
@@ -24,10 +24,10 @@ import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processin
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.MappedCollectionIterator;
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.SimpleArtifactRepositoryFactory;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.artifact.*;
@@ -364,7 +364,7 @@ public class SimpleArtifactRepositoryTest extends AbstractProvisioningTest {
repo.addDescriptor(d2);
repo.addDescriptor(d3);
- Collector result = repo.query(new ArtifactDescriptorQuery("a", null, null), null);
+ IQueryResult result = repo.query(new ArtifactDescriptorQuery("a", null, null), null);
assertEquals(3, result.size());
result = repo.query(new ArtifactDescriptorQuery(null, new VersionRange("[2.0.0, 3.0.0)"), null), null);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
index 8a1c96523..fd2aa834e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CollectorTest.java
@@ -15,6 +15,7 @@ import java.util.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
/**
@@ -67,11 +68,11 @@ public class CollectorTest extends AbstractProvisioningTest {
return false;
}
};
- Collector collector = numeric.perform(list.iterator(), new Collector());
- assertEquals("1.0", 7, collector.toCollection().size());
+ IQueryResult queryResult = numeric.perform(list.iterator(), new Collector());
+ assertEquals("1.0", 7, queryResult.toCollection().size());
- collector = collector.query(fourOrFiveOrABC, null);
- Collection collection = collector.toCollection();
+ queryResult = queryResult.query(fourOrFiveOrABC, null);
+ Collection collection = queryResult.toCollection();
assertEquals("2.0", 2, collection.size());
assertTrue("2.1", collection.contains("4"));
assertTrue("2.2", collection.contains("5"));
@@ -130,11 +131,11 @@ public class CollectorTest extends AbstractProvisioningTest {
return false;
}
};
- Collector collector = eightOrNine.perform(list.iterator(), new Collector());
- assertEquals("1.0", 0, collector.toCollection().size());
+ IQueryResult queryResult = eightOrNine.perform(list.iterator(), new Collector());
+ assertEquals("1.0", 0, queryResult.toCollection().size());
- collector = collector.query(fourOrFiveOrABC, null);
- Collection collection = collector.toCollection();
+ queryResult = queryResult.query(fourOrFiveOrABC, null);
+ Collection collection = queryResult.toCollection();
assertEquals("2.0", 0, collection.size());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
index 062422372..5f437f0ec 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/core/CompoundQueryableTest.java
@@ -15,6 +15,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.tests.harness.TestProgressMonitor;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
/**
* Tests the compound queryable
@@ -57,7 +58,7 @@ public class CompoundQueryableTest extends TestCase {
IQueryable queryable1 = new IQueryable() {
Integer[] elements = new Integer[] {1, 2, 3, 4, 5};
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
try {
monitor.beginTask("", 10);
@@ -73,7 +74,7 @@ public class CompoundQueryableTest extends TestCase {
IQueryable queryable2 = new IQueryable() {
Integer[] elements = new Integer[] {4, 6, 8, 10, 12};
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
try {
monitor.beginTask("", 10);
@@ -89,7 +90,7 @@ public class CompoundQueryableTest extends TestCase {
IQueryable queryable3 = new IQueryable() {
Integer[] elements = new Integer[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
try {
monitor.beginTask("", 10);
@@ -157,9 +158,9 @@ public class CompoundQueryableTest extends TestCase {
public void testMatchQuery() {
CompoundQueryable cQueryable = new CompoundQueryable(new IQueryable[] {queryable1, queryable2});
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- Collector collector = cQueryable.query(matchQuery, monitor);
- assertEquals("1.0", 6, collector.size());
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = cQueryable.query(matchQuery, monitor);
+ assertEquals("1.0", 6, queryResult.size());
+ Collection collection = queryResult.toCollection();
assertTrue("1.1", collection.contains(2));
assertTrue("1.2", collection.contains(4));
assertTrue("1.3", collection.contains(6));
@@ -171,9 +172,9 @@ public class CompoundQueryableTest extends TestCase {
public void testSingleQueryable() {
CompoundQueryable cQueryable = new CompoundQueryable(new IQueryable[] {queryable1});
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- Collector collector = cQueryable.query(matchQuery, monitor);
- assertEquals("1.0", 2, collector.size());
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = cQueryable.query(matchQuery, monitor);
+ assertEquals("1.0", 2, queryResult.size());
+ Collection collection = queryResult.toCollection();
assertTrue("1.1", collection.contains(2));
assertTrue("1.2", collection.contains(4));
}
@@ -181,27 +182,27 @@ public class CompoundQueryableTest extends TestCase {
public void testSingleContextQuery() {
CompoundQueryable cQueryable = new CompoundQueryable(new IQueryable[] {queryable1});
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- Collector collector = cQueryable.query(greatestNumberQuery, monitor);
- assertEquals("1.0", 1, collector.size());
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = cQueryable.query(greatestNumberQuery, monitor);
+ assertEquals("1.0", 1, queryResult.size());
+ Collection collection = queryResult.toCollection();
assertTrue("1.1", collection.contains(5));
}
public void testMultipleContextQueries() {
CompoundQueryable cQueryable = new CompoundQueryable(new IQueryable[] {queryable1, queryable2});
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- Collector collector = cQueryable.query(greatestNumberQuery, monitor);
- assertEquals("1.0", 1, collector.size());
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = cQueryable.query(greatestNumberQuery, monitor);
+ assertEquals("1.0", 1, queryResult.size());
+ Collection collection = queryResult.toCollection();
assertTrue("1.1", collection.contains(12));
}
public void testCompoundMatchAndQuery() {
CompoundQueryable cQueryable = new CompoundQueryable(new IQueryable[] {queryable1, queryable2});
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- Collector collector = cQueryable.query(CompoundQuery.createCompoundQuery(new IQuery[] {matchQuery, matchMod4query}, true), monitor);
- assertEquals("1.0", 3, collector.size());
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = cQueryable.query(CompoundQuery.createCompoundQuery(new IQuery[] {matchQuery, matchMod4query}, true), monitor);
+ assertEquals("1.0", 3, queryResult.size());
+ Collection collection = queryResult.toCollection();
assertTrue("1.2", collection.contains(4));
assertTrue("1.4", collection.contains(8));
assertTrue("1.6", collection.contains(12));
@@ -210,9 +211,9 @@ public class CompoundQueryableTest extends TestCase {
public void testCompoundMatchOrQuery() {
CompoundQueryable cQueryable = new CompoundQueryable(new IQueryable[] {queryable1, queryable2});
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- Collector collector = cQueryable.query(CompoundQuery.createCompoundQuery(new IQuery[] {matchQuery, matchMod4query}, false), monitor);
- assertEquals("1.0", 6, collector.size());
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = cQueryable.query(CompoundQuery.createCompoundQuery(new IQuery[] {matchQuery, matchMod4query}, false), monitor);
+ assertEquals("1.0", 6, queryResult.size());
+ Collection collection = queryResult.toCollection();
assertTrue("1.2", collection.contains(2));
assertTrue("1.2", collection.contains(4));
assertTrue("1.2", collection.contains(6));
@@ -264,9 +265,9 @@ public class CompoundQueryableTest extends TestCase {
CompoundQueryable cQueryable1 = new CompoundQueryable(new IQueryable[] {queryable3, queryable2});
CompoundQueryable cQueryable = new CompoundQueryable(new IQueryable[] {cQueryable1, queryable1});
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- Collector collector = cQueryable.query(CompoundQuery.createCompoundQuery(new IQuery[] {contextQuery, greatestNumberQuery}, false), monitor);
- assertEquals("1.0", 7, collector.size());
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = cQueryable.query(CompoundQuery.createCompoundQuery(new IQuery[] {contextQuery, greatestNumberQuery}, false), monitor);
+ assertEquals("1.0", 7, queryResult.size());
+ Collection collection = queryResult.toCollection();
assertTrue("1.2", collection.contains(2));
assertTrue("1.2", collection.contains(4));
assertTrue("1.2", collection.contains(6));
@@ -282,9 +283,9 @@ public class CompoundQueryableTest extends TestCase {
CompoundQueryable cQueryable1 = new CompoundQueryable(new IQueryable[] {queryable3, queryable2});
CompoundQueryable cQueryable = new CompoundQueryable(new IQueryable[] {cQueryable1, queryable1});
CompoundQueryTestProgressMonitor monitor = new CompoundQueryTestProgressMonitor();
- Collector collector = cQueryable.query(new PipedQuery(new IQuery[] {contextQuery, greatestNumberQuery}), monitor);
- assertEquals("1.0", 1, collector.size());
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = cQueryable.query(new PipedQuery(new IQuery[] {contextQuery, greatestNumberQuery}), monitor);
+ assertEquals("1.0", 1, queryResult.size());
+ Collection collection = queryResult.toCollection();
assertTrue("1.2", collection.contains(12));
assertTrue("1.0", monitor.isDone());
assertTrue("1.1", monitor.isWorkDone());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java
index dc8f721a1..0249e4884 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/directorywatcher/TestRepositoryWatcher.java
@@ -15,10 +15,10 @@ import java.util.Dictionary;
import java.util.Hashtable;
import org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher;
import org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
@@ -70,7 +70,7 @@ class TestRepositoryWatcher extends DirectoryWatcher {
* Return the list of artifact keys known to this listener's repository.
*/
public IArtifactKey[] getArtifactKeys() {
- Collector keys = listener.getArtifactRepository().query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = listener.getArtifactRepository().query(ArtifactKeyQuery.ALL_KEYS, null);
return (IArtifactKey[]) keys.toArray(IArtifactKey.class);
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java
index a2db9c96b..c03947502 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfileMetadataRepositoryTest.java
@@ -14,10 +14,10 @@ import java.io.File;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.SimpleArtifactRepositoryFactory;
import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -71,7 +71,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
IProfile profile = registry.getProfile("SDKPatchingTest");
assertNotNull("0.3", profile);
- Collector profileCollector = profile.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult profileCollector = profile.query(InstallableUnitQuery.ANY, getMonitor());
assertFalse("0.4", profileCollector.isEmpty());
File simpleProfileFolder = new File(tempFolder, "SDKPatchingTest.profile");
@@ -85,7 +85,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
fail("0.99", e1);
}
- Collector repoCollector = repo.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult repoCollector = repo.query(InstallableUnitQuery.ANY, getMonitor());
assertFalse("1.0", repoCollector.isEmpty());
assertTrue("1.1", repoCollector.toCollection().containsAll(profileCollector.toCollection()));
}
@@ -99,7 +99,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
IProfile profile = registry.getProfile("SDKPatchingTest");
assertNotNull("0.3", profile);
- Collector profileCollector = profile.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult profileCollector = profile.query(InstallableUnitQuery.ANY, getMonitor());
assertFalse("0.4", profileCollector.isEmpty());
File simpleProfileFolder = new File(tempFolder, "SDKPatchingTest.profile");
@@ -116,7 +116,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
fail("0.99", e1);
}
- Collector repoCollector = repo.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult repoCollector = repo.query(InstallableUnitQuery.ANY, getMonitor());
assertFalse("1.0", repoCollector.isEmpty());
assertTrue("1.1", repoCollector.toCollection().containsAll(profileCollector.toCollection()));
}
@@ -138,7 +138,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
IProfile profile = registry.getProfile("SDKPatchingTest");
assertNotNull("1.0", profile);
- Collector profileCollector = profile.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult profileCollector = profile.query(InstallableUnitQuery.ANY, getMonitor());
assertFalse("1.1", profileCollector.isEmpty());
File simpleProfileFolder = new File(profileRegistryFolder, "SDKPatchingTest.profile");
@@ -159,7 +159,7 @@ public class ProfileMetadataRepositoryTest extends AbstractProvisioningTest {
fail("2.99", e1);
}
- Collector repoCollector = repo.query(InstallableUnitQuery.ANY, getMonitor());
+ IQueryResult repoCollector = repo.query(InstallableUnitQuery.ANY, getMonitor());
assertFalse("3.0", repoCollector.isEmpty());
assertTrue("3.1", repoCollector.toCollection().containsAll(profileCollector.toCollection()));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java
index 5c15564cf..16ba00812 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/DirectorTest.java
@@ -19,11 +19,11 @@ import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.director.IDirector;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
@@ -53,7 +53,7 @@ public class DirectorTest extends AbstractProvisioningTest {
}
String autoInstall = System.getProperty("eclipse.p2.autoInstall");
- Collector allJobs = mgr.query(new InstallableUnitQuery(autoInstall, VersionRange.emptyRange), null);
+ IQueryResult allJobs = mgr.query(new InstallableUnitQuery(autoInstall, VersionRange.emptyRange), null);
String installFolder = System.getProperty(IProfile.PROP_INSTALL_FOLDER);
IProfileRegistry profileRegistry = getProfileRegistry();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java
index 46d990f9c..c00469494 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/End2EndTest.java
@@ -24,12 +24,12 @@ import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.IProvisioningAgentProvider;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -111,7 +111,7 @@ public class End2EndTest extends AbstractProvisioningTest {
}
private void attemptToUninstallRCP35(IProfile profile2, File installFolder) {
- Collector collect = profile2.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult collect = profile2.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
assertEquals(1, collect.size());
ProfileChangeRequest request = new ProfileChangeRequest(profile2);
request.removeInstallableUnits(new IInstallableUnit[] {(IInstallableUnit) collect.iterator().next()});
@@ -122,7 +122,7 @@ public class End2EndTest extends AbstractProvisioningTest {
protected void uninstallPlatform(IProfile profile2, File installFolder) {
System.out.println("Uninstall the platform");
- Collector collect = profile2.query(new InstallableUnitQuery("org.eclipse.platform.ide"), new NullProgressMonitor());
+ IQueryResult collect = profile2.query(new InstallableUnitQuery("org.eclipse.platform.ide"), new NullProgressMonitor());
assertEquals(1, collect.size());
// Collector collect2 = profile2.query(new InstallableUnitQuery("org.eclipse.platform.source.feature.group"), new Collector(), new NullProgressMonitor());
ProfileChangeRequest request = new ProfileChangeRequest(profile2);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java
index d69246827..4a1fe7d44 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/full/RepoValidator.java
@@ -17,12 +17,12 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.ProvisioningContext;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -59,7 +59,7 @@ public class RepoValidator extends AbstractProvisioningTest {
q = new InstallableUnitQuery("org.eclipse.rcp.feature.group");
// q = InstallableUnitQuery.ANY;
- Collector iusToTest = validatedRepo.query(q, null);
+ IQueryResult iusToTest = validatedRepo.query(q, null);
ProvisioningContext pc = new ProvisioningContext(new URI[] {repoLoc});
for (Iterator iterator = iusToTest.iterator(); iterator.hasNext();) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java
index e4fdc09da..270952581 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/LatestIUTest.java
@@ -12,9 +12,9 @@ package org.eclipse.equinox.p2.tests.metadata;
import java.net.URI;
import java.util.Collection;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.LatestIUVersionQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestData;
@@ -35,7 +35,7 @@ public class LatestIUTest extends AbstractProvisioningTest {
IMetadataRepositoryManager metadataRepositoryManager = getMetadataRepositoryManager();
metadataRepositoryManager.addRepository(location);
- Collector query = metadataRepositoryManager.query(new LatestIUVersionQuery(), null);
+ IQueryResult query = metadataRepositoryManager.query(new LatestIUVersionQuery(), null);
Collection collection = query.toCollection();
assertEquals("1.0", 1, collection.size());
assertEquals("1.1", Version.createOSGi(2, 1, 0), ((IInstallableUnit) collection.iterator().next()).getVersion());
@@ -52,7 +52,7 @@ public class LatestIUTest extends AbstractProvisioningTest {
IMetadataRepositoryManager metadataRepositoryManager = getMetadataRepositoryManager();
metadataRepositoryManager.addRepository(location);
- Collector query = metadataRepositoryManager.query(new LatestIUVersionQuery(), null);
+ IQueryResult query = metadataRepositoryManager.query(new LatestIUVersionQuery(), null);
Collection collection = query.toCollection();
assertEquals("1.0", 1, collection.size());
assertEquals("1.1", Version.createOSGi(3, 0, 0), ((IInstallableUnit) collection.iterator().next()).getVersion());
@@ -72,8 +72,8 @@ public class LatestIUTest extends AbstractProvisioningTest {
metadataRepositoryManager.addRepository(location1);
metadataRepositoryManager.addRepository(location2);
- Collector collector = metadataRepositoryManager.query(new LatestIUVersionQuery(), null);
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = metadataRepositoryManager.query(new LatestIUVersionQuery(), null);
+ Collection collection = queryResult.toCollection();
assertEquals("1.0", 1, collection.size());
assertEquals("1.1", Version.createOSGi(3, 0, 0), ((IInstallableUnit) collection.iterator().next()).getVersion());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java
index 96680471a..d776df72c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/CompositeMetadataRepositoryTest.java
@@ -27,6 +27,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.Inst
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -116,8 +117,8 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
//Try to remove an InstallableUnit.
try {
- Collector collector = compRepo.query(InstallableUnitQuery.ANY, null);
- compRepo.removeInstallableUnits((IInstallableUnit[]) collector.toArray(IInstallableUnit.class), null);
+ IQueryResult queryResult = compRepo.query(InstallableUnitQuery.ANY, null);
+ compRepo.removeInstallableUnits((IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class), null);
fail("Should not be able to remove InstallableUnit");
} catch (UnsupportedOperationException e) {
//expected. fall through
@@ -457,8 +458,8 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
CompositeMetadataRepository compositeRepo = createRepo(false);
compositeRepo.addChild(location1);
compositeRepo.addChild(location2);
- Collector collector = compositeRepo.query(new LatestIUVersionQuery(), monitor);
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = compositeRepo.query(new LatestIUVersionQuery(), monitor);
+ Collection collection = queryResult.toCollection();
assertEquals("1.0", 1, collection.size());
assertEquals("1.1", Version.createOSGi(3, 0, 0), ((IInstallableUnit) collection.iterator().next()).getVersion());
assertTrue("1.2", monitor.isDone());
@@ -489,8 +490,8 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
return false;
}
}, new LatestIUVersionQuery()});
- Collector collector = compositeRepo.query(cQuery, monitor);
- Collection collection = collector.toCollection();
+ IQueryResult queryResult = compositeRepo.query(cQuery, monitor);
+ Collection collection = queryResult.toCollection();
assertEquals("1.0", 1, collection.size());
assertEquals("1.1", Version.createOSGi(2, 2, 0), ((IInstallableUnit) collection.iterator().next()).getVersion());
assertTrue("1.2", monitor.isDone());
@@ -561,7 +562,7 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
* Takes 2 collectors, compares them, and returns the number of unique keys
* Needed to verify that only the appropriate number of files have been transfered by the mirror application
*/
- private int getNumUnique(Collector c1, Collector c2) {
+ private int getNumUnique(IQueryResult c1, IQueryResult c2) {
Object[] repo1 = c1.toCollection().toArray();
Object[] repo2 = c2.toCollection().toArray();
@@ -634,8 +635,8 @@ public class CompositeMetadataRepositoryTest extends AbstractProvisioningTest {
// query the number of IUs
List children = repository.getChildren();
assertEquals("2.0", 2, children.size());
- Collector collector = repository.query(InstallableUnitQuery.ANY, getMonitor());
- assertEquals("2.1", 2, collector.size());
+ IQueryResult queryResult = repository.query(InstallableUnitQuery.ANY, getMonitor());
+ assertEquals("2.1", 2, queryResult.size());
// ensure the child URIs are stored as relative
CompositeRepositoryState state = repository.toState();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java
index ff0a08d40..a62073108 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java
@@ -20,10 +20,10 @@ import org.eclipse.equinox.internal.provisional.p2.core.eventbus.SynchronousProv
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -124,7 +124,7 @@ public class LocalMetadataRepositoryTest extends AbstractProvisioningTest {
IMetadataRepository repo = manager.createRepository(repoLocation.toURI(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
IInstallableUnit iu = createIU("foo");
repo.addInstallableUnits(new IInstallableUnit[] {iu});
- Collector result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
+ IQueryResult result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
assertTrue("1.0", result.size() == 1);
repo.removeAll();
result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
@@ -137,7 +137,7 @@ public class LocalMetadataRepositoryTest extends AbstractProvisioningTest {
IInstallableUnit iu = createIU("foo");
IInstallableUnit iu2 = createIU("bar");
repo.addInstallableUnits(new IInstallableUnit[] {iu, iu2});
- Collector result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
+ IQueryResult result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
assertTrue("1.0", result.size() == 2);
repo.removeInstallableUnits(new IInstallableUnit[] {iu}, getMonitor());
result = repo.query(new InstallableUnitQuery((String) null), getMonitor());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
index f4d51223c..cf25a469c 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
@@ -26,12 +26,12 @@ import org.eclipse.equinox.internal.p2.updatesite.metadata.UpdateSiteMetadataRep
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.ProvisioningListener;
import org.eclipse.equinox.internal.provisional.p2.core.eventbus.SynchronousProvisioningListener;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.internal.provisional.p2.repository.RepositoryEvent;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.MetadataRepositoryFactory;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.SimpleMetadataRepositoryFactory;
import org.eclipse.equinox.p2.core.IAgentLocation;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -409,7 +409,7 @@ public class MetadataRepositoryManagerTest extends AbstractProvisioningTest {
URI location = site.toURI();
try {
IMetadataRepository repository = manager.loadRepository(location, getMonitor());
- Collector result = repository.query(new InstallableUnitQuery("test.bundle"), getMonitor());
+ IQueryResult result = repository.query(new InstallableUnitQuery("test.bundle"), getMonitor());
assertEquals("1.0", 1, result.size());
} catch (ProvisionException e) {
fail("=.99", e);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java
index b3106436b..fdff1e13e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java
@@ -23,10 +23,10 @@ import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitPatchDescription;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -635,17 +635,17 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
repo.addInstallableUnits(new IInstallableUnit[] {new SPIInstallableUnit("foo", Version.createOSGi(1, 1, 1))});
- Collector collector = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
+ IQueryResult queryResult = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
- Collection collection = collector.toCollection();
+ Collection collection = queryResult.toCollection();
assertEquals(1, collection.size());
assertTrue("Repo contains SPI IU)", collection.iterator().next() instanceof SPIInstallableUnit);
repo = manager.refreshRepository(repoLocation.toURI(), null);
- collector = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
+ queryResult = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
- collection = collector.toCollection();
+ collection = queryResult.toCollection();
assertEquals(1, collection.size());
assertTrue("Refreshed repo contains default IU", collection.iterator().next() instanceof InstallableUnit);
@@ -670,9 +670,9 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
spiInstallableUnit.addProvidedCapability(providedCapability);
repo.addInstallableUnits(new IInstallableUnit[] {spiInstallableUnit});
- Collector collector = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
+ IQueryResult queryResult = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
- Collection collection = collector.toCollection();
+ Collection collection = queryResult.toCollection();
assertEquals(1, collection.size());
IInstallableUnit spiUnit = (IInstallableUnit) collection.iterator().next();
@@ -681,9 +681,9 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
assertTrue(spiUnit.getProvidedCapabilities()[0] instanceof ProvidedCapability);
repo = manager.refreshRepository(repoLocation.toURI(), null);
- collector = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
+ queryResult = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
- collection = collector.toCollection();
+ collection = queryResult.toCollection();
assertEquals(1, collection.size());
IInstallableUnit defaultUnit = (IInstallableUnit) collection.iterator().next();
@@ -715,9 +715,9 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
repo.addInstallableUnits(new IInstallableUnit[] {MetadataFactory.createInstallableUnit(iuDescription)});
- Collector collector = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
+ IQueryResult queryResult = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
- Collection collection = collector.toCollection();
+ Collection collection = queryResult.toCollection();
assertEquals(1, collection.size());
IInstallableUnit unit = (IInstallableUnit) collection.iterator().next();
@@ -725,9 +725,9 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
assertTrue(unit.getRequiredCapabilities()[0] instanceof SPIRequiredCapability);
repo = manager.refreshRepository(repoLocation.toURI(), null);
- collector = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
+ queryResult = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
- collection = collector.toCollection();
+ collection = queryResult.toCollection();
assertEquals(1, collection.size());
unit = (IInstallableUnit) collection.iterator().next();
@@ -783,9 +783,9 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest {
repo.addInstallableUnits(new IInstallableUnit[] {MetadataFactory.createInstallableUnit(iuDescription), MetadataFactory.createInstallableUnitPatch(iuPatchDescription)});
repo = manager.refreshRepository(repoLocation.toURI(), null);
- Collector collector = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
+ IQueryResult queryResult = repo.query(new AllAcceptingQuery(), new NullProgressMonitor());
- Collection collection = collector.toCollection();
+ Collection collection = queryResult.toCollection();
assertEquals(2, collection.size());
Iterator iterator = collection.iterator();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
index 2e0bb6b5b..a6c8d88d5 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/ArtifactMirrorApplicationTest.java
@@ -21,10 +21,10 @@ import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
@@ -287,7 +287,7 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
* Not Biconditional.
*/
private void assertFileSizes(String message, SimpleArtifactRepository expected, SimpleArtifactRepository actual) {
- Collector expectedKeys = expected.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult expectedKeys = expected.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = expectedKeys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
IArtifactDescriptor[] expectedDescriptors = expected.getArtifactDescriptors(key);
@@ -894,7 +894,7 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
fail("");
}
- Collector keys = packedRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = packedRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
IArtifactDescriptor[] srcDescriptors = packedRepo.getArtifactDescriptors(key);
@@ -1275,7 +1275,7 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
return source.contains(descriptor);
}
- public synchronized Collector query(IQuery query, IProgressMonitor monitor) {
+ public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
return source.query(query, monitor);
}
}
@@ -1349,7 +1349,7 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
try {
//Mirroring full duplicate, so any key will do.
- Collector descriptors = sourceRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
+ IQueryResult descriptors = sourceRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
IArtifactDescriptor descriptor = (IArtifactDescriptor) descriptors.iterator().next();
//Mirroring full duplicate, so any descriptor will do.
String message = NLS.bind(org.eclipse.equinox.internal.p2.artifact.repository.Messages.mirror_alreadyExists, descriptor, destRepoLocation.toURI());
@@ -1421,7 +1421,7 @@ public class ArtifactMirrorApplicationTest extends AbstractProvisioningTest {
try {
//Mirroring full duplicate, so any key will do.
- Collector descriptors = sourceRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
+ IQueryResult descriptors = sourceRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
IArtifactDescriptor descriptor = (IArtifactDescriptor) descriptors.iterator().next();
//Mirroring full duplicate, so any descriptor will do.
String message = NLS.bind(org.eclipse.equinox.internal.p2.artifact.repository.Messages.mirror_alreadyExists, descriptor, destRepoLocation.toURI());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java
index 0f9d265d2..ec1a2083b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/MetadataMirrorApplicationTest.java
@@ -16,10 +16,10 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -105,14 +105,14 @@ public class MetadataMirrorApplicationTest extends AbstractProvisioningTest {
}
/**
- * Takes 2 collectors, compares them, and returns the number of unique keys
+ * Takes 2 QueryResults, compares them, and returns the number of unique keys
* Needed to verify that only the appropriate number of files have been transfered by the mirror application
*/
- private int getNumUnique(Collector c1, Collector c2) {
+ private int getNumUnique(IQueryResult c1, IQueryResult c2) {
Object[] repo1 = c1.toCollection().toArray();
Object[] repo2 = c2.toCollection().toArray();
- //initialize to the size of both collectors
+ //initialize to the size of both query results
int numKeys = repo1.length + repo2.length;
for (int i = 0; i < repo1.length; i++) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
index f8bfa42d9..ebabef00a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationArtifactTest.java
@@ -22,11 +22,11 @@ import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
@@ -313,7 +313,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
* Not Biconditional.
*/
private void assertFileSizes(String message, SimpleArtifactRepository expected, SimpleArtifactRepository actual) {
- Collector expectedKeys = expected.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult expectedKeys = expected.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = expectedKeys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
IArtifactDescriptor[] expectedDescriptors = expected.getArtifactDescriptors(key);
@@ -909,7 +909,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
fail("");
}
- Collector keys = packedRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
+ IQueryResult keys = packedRepo.query(ArtifactKeyQuery.ALL_KEYS, null);
for (Iterator iterator = keys.iterator(); iterator.hasNext();) {
IArtifactKey key = (IArtifactKey) iterator.next();
IArtifactDescriptor[] srcDescriptors = packedRepo.getArtifactDescriptors(key);
@@ -1316,7 +1316,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
return source.contains(descriptor);
}
- public synchronized Collector query(IQuery query, IProgressMonitor monitor) {
+ public synchronized IQueryResult query(IQuery query, IProgressMonitor monitor) {
return source.query(query, monitor);
}
}
@@ -1390,7 +1390,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
try {
//Mirroring full duplicate, so any key will do.
- Collector descriptors = sourceRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
+ IQueryResult descriptors = sourceRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
IArtifactDescriptor descriptor = (IArtifactDescriptor) descriptors.iterator().next();
//Mirroring full duplicate, so any descriptor will do.
String message = NLS.bind(org.eclipse.equinox.internal.p2.artifact.repository.Messages.mirror_alreadyExists, descriptor, destRepoLocation.toURI());
@@ -1468,7 +1468,7 @@ public class NewMirrorApplicationArtifactTest extends AbstractProvisioningTest {
try {
//Mirroring full duplicate, so any key will do.
- Collector descriptors = sourceRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
+ IQueryResult descriptors = sourceRepository.query(ArtifactDescriptorQuery.ALL_DESCRIPTORS, null);
IArtifactDescriptor descriptor = (IArtifactDescriptor) descriptors.iterator().next();
//Mirroring full duplicate, so any descriptor will do.
String message = NLS.bind(org.eclipse.equinox.internal.p2.artifact.repository.Messages.mirror_alreadyExists, descriptor, destRepoLocation.toURI());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java
index 8e76002dd..22a584da8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/mirror/NewMirrorApplicationMetadataTest.java
@@ -16,12 +16,12 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.internal.simpleconfigurator.utils.URIUtil;
import org.eclipse.equinox.p2.internal.repository.tools.MirrorApplication;
import org.eclipse.equinox.p2.internal.repository.tools.RepositoryDescriptor;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -132,14 +132,14 @@ public class NewMirrorApplicationMetadataTest extends AbstractProvisioningTest {
}
/**
- * Takes 2 collectors, compares them, and returns the number of unique keys
+ * Takes 2 QueryResults, compares them, and returns the number of unique keys
* Needed to verify that only the appropriate number of files have been transfered by the mirror application
*/
- private int getNumUnique(Collector c1, Collector c2) {
+ private int getNumUnique(IQueryResult c1, IQueryResult c2) {
Object[] repo1 = c1.toCollection().toArray();
Object[] repo2 = c2.toCollection().toArray();
- //initialize to the size of both collectors
+ //initialize to the size of both QueryResults
int numKeys = repo1.length + repo2.length;
for (int i = 0; i < repo1.length; i++) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java
index 77199777d..e91a03b72 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AddIUProperty.java
@@ -12,11 +12,11 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.director.SimplePlanner;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class AddIUProperty extends AbstractProvisioningTest {
@@ -64,7 +64,7 @@ public class AddIUProperty extends AbstractProvisioningTest {
assertEquals(IStatus.OK, plan.getStatus().getSeverity());
engine.perform(plan, null);
assertProfileContainsAll("A1 is missing", profile, new IInstallableUnit[] {a1});
- Collector allProfileIUs = profile.query(InstallableUnitQuery.ANY, null);
+ IQueryResult allProfileIUs = profile.query(InstallableUnitQuery.ANY, null);
assertEquals(allProfileIUs.size(), 1);
//Add a2 with a1. This is an error
@@ -87,7 +87,7 @@ public class AddIUProperty extends AbstractProvisioningTest {
allProfileIUs = profile.query(InstallableUnitQuery.ANY, null);
assertEquals(allProfileIUs.size(), 1);
- Collector iuProfileProperties = profile.query(new IUProfilePropertyQuery(SimplePlanner.INCLUSION_RULES, null), null);
+ IQueryResult iuProfileProperties = profile.query(new IUProfilePropertyQuery(SimplePlanner.INCLUSION_RULES, null), null);
assertEquals(iuProfileProperties.size(), 1);
//Remove a1 optionality - should be a no-op
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java
index 69f034085..95731154d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/AllOrbit.java
@@ -15,10 +15,10 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager;
import org.eclipse.equinox.internal.provisional.p2.director.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -42,7 +42,7 @@ public class AllOrbit extends AbstractProvisioningTest {
public void testInstallTwoVersionsOptionaly() {
ProfileChangeRequest req1 = new ProfileChangeRequest(profile1);
- Collector allIUs = repo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult allIUs = repo.query(InstallableUnitQuery.ANY, null);
req1.addInstallableUnits((IInstallableUnit[]) allIUs.toArray(IInstallableUnit.class));
for (Iterator iterator = allIUs.iterator(); iterator.hasNext();) {
IInstallableUnit iu = (IInstallableUnit) iterator.next();
@@ -63,7 +63,7 @@ public class AllOrbit extends AbstractProvisioningTest {
public void test2() {
//Install everything except com.ibm.icu
ProfileChangeRequest req1 = new ProfileChangeRequest(profile1);
- Collector allIUs = repo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult allIUs = repo.query(InstallableUnitQuery.ANY, null);
ArrayList toInstall = new ArrayList(allIUs.size());
int removed = 0;
for (Iterator iterator = allIUs.iterator(); iterator.hasNext();) {
@@ -90,7 +90,7 @@ public class AllOrbit extends AbstractProvisioningTest {
public void test3() {
//Install everything optionaly (except com.ibm.icu that we don't install at all)
ProfileChangeRequest req1 = new ProfileChangeRequest(profile1);
- Collector allIUs = repo.query(InstallableUnitQuery.ANY, null);
+ IQueryResult allIUs = repo.query(InstallableUnitQuery.ANY, null);
ArrayList toInstall = new ArrayList(allIUs.size());
int removed = 0;
for (Iterator iterator = allIUs.iterator(); iterator.hasNext();) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java
index a41ac498c..3c2005fff 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug252682.java
@@ -17,10 +17,10 @@ import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug252682 extends AbstractProvisioningTest {
@@ -45,7 +45,7 @@ public class Bug252682 extends AbstractProvisioningTest {
public void testInstallFeaturePatch() {
IInstallableUnit p2Feature = (IInstallableUnit) profile.query(new InstallableUnitQuery("org.eclipse.equinox.p2.user.ui.feature.group"), new NullProgressMonitor()).iterator().next();
System.out.println(p2Feature);
- Collector c = profile.query(new InstallableUnitQuery("org.eclipse.equinox.p2.core.patch"), new NullProgressMonitor());
+ IQueryResult c = profile.query(new InstallableUnitQuery("org.eclipse.equinox.p2.core.patch"), new NullProgressMonitor());
assertEquals(1, c.size());
ProvisioningContext ctx = new ProvisioningContext();
ctx.setExtraIUs(newIUs);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java
index b2acd91d7..75a3aa51f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet1.java
@@ -14,11 +14,11 @@ import java.io.File;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.provisional.p2.director.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -44,7 +44,7 @@ public class Bug254481dataSet1 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- Collector c = repo.query(new InstallableUnitQuery("RPT_ARM_TEST.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("RPT_ARM_TEST.feature.group"), new NullProgressMonitor());
assertEquals(1, c.size());
IInstallableUnit patch = (IInstallableUnit) c.iterator().next();
ProfileChangeRequest request = new ProfileChangeRequest(profile);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java
index 97f850060..e06022516 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug254481dataSet2.java
@@ -14,11 +14,11 @@ import java.io.File;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.provisional.p2.director.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -44,7 +44,7 @@ public class Bug254481dataSet2 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.jdt.feature.patch.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.jdt.feature.patch.feature.group"), new NullProgressMonitor());
assertEquals(1, c.size());
IInstallableUnit patch = (IInstallableUnit) c.iterator().next();
ProfileChangeRequest request = new ProfileChangeRequest(profile);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java
index 446ac235b..fd31d8b5d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271067.java
@@ -17,10 +17,10 @@ import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.provisional.p2.director.PlannerHelper;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -67,7 +67,7 @@ public class Bug271067 extends AbstractProvisioningTest {
}
IInstallableUnit getIU(IMetadataRepository source, String id, String version) {
- Collector c = repo.query(new InstallableUnitQuery(id, Version.create(version)), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery(id, Version.create(version)), new NullProgressMonitor());
assertEquals(1, c.size());
return (IInstallableUnit) c.iterator().next();
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java
index 00910c848..f0d8d1007 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug271954.java
@@ -17,10 +17,10 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class Bug271954 extends AbstractProvisioningTest {
@@ -74,7 +74,7 @@ public class Bug271954 extends AbstractProvisioningTest {
}
public void testUninstallMyBundle() {
- Collector c = profile.available(new InstallableUnitQuery("A"), new NullProgressMonitor());
+ IQueryResult c = profile.available(new InstallableUnitQuery("A"), new NullProgressMonitor());
assertEquals(1, c.size());
ProfileChangeRequest req = new ProfileChangeRequest(profile);
req.removeInstallableUnits((IInstallableUnit[]) c.toArray(IInstallableUnit.class));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java
index 735329a0b..beec0fbf1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug272251.java
@@ -15,11 +15,11 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -45,9 +45,9 @@ public class Bug272251 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.wst.jsdt.feature.patch.feature.group", Version.create("3.0.4.v200904020304-1-8d7w311_15131415")), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.wst.jsdt.feature.patch.feature.group", Version.create("3.0.4.v200904020304-1-8d7w311_15131415")), new NullProgressMonitor());
assertEquals(1, c.size());
- Collector expectedIU = repo.query(new InstallableUnitQuery("org.eclipse.wst.jsdt.web.ui", Version.create("1.0.105.v200904020304")), new NullProgressMonitor());
+ IQueryResult expectedIU = repo.query(new InstallableUnitQuery("org.eclipse.wst.jsdt.web.ui", Version.create("1.0.105.v200904020304")), new NullProgressMonitor());
assertEquals(1, expectedIU.size());
IInstallableUnit patch = (IInstallableUnit) c.iterator().next();
ProfileChangeRequest request = new ProfileChangeRequest(profile);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java
index 0f546a6f8..034f85805 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/Bug278668.java
@@ -6,10 +6,10 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -64,9 +64,9 @@ public class Bug278668 extends AbstractProvisioningTest {
}
public void testInstallFeaturePatch() {
- Collector c = repo.query(new InstallableUnitQuery("com.borland.tg.modeling.8.2.0.hotfixexp.patch.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("com.borland.tg.modeling.8.2.0.hotfixexp.patch.feature.group"), new NullProgressMonitor());
assertEquals(1, c.size());
- Collector c2 = repo.query(new InstallableUnitQuery("com.borland.tg.modeling.8.2.0.nl.patch.feature.group"), new NullProgressMonitor());
+ IQueryResult c2 = repo.query(new InstallableUnitQuery("com.borland.tg.modeling.8.2.0.nl.patch.feature.group"), new NullProgressMonitor());
assertEquals(1, c2.size());
ProfileChangeRequest request = new ProfileChangeRequest(profile);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java
index 8853df22e..dacec8dfc 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ExplanationLargeConflict.java
@@ -18,11 +18,11 @@ import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -51,11 +51,11 @@ public class ExplanationLargeConflict extends AbstractProvisioningTest {
long sTime = System.currentTimeMillis();
//Here we verify that two version of JDT can't be installed together. The SDKProfile is not used
IProfile profile = createProfile("TestProfile." + getName());
- Collector c = repo1.query(new InstallableUnitQuery("org.eclipse.jdt.feature.group"), null);
+ IQueryResult c = repo1.query(new InstallableUnitQuery("org.eclipse.jdt.feature.group"), null);
assertEquals(1, c.size());
IInstallableUnit jdt1 = (IInstallableUnit) c.iterator().next();
- Collector c2 = repo2.query(new InstallableUnitQuery("org.eclipse.jdt.feature.group"), null);
+ IQueryResult c2 = repo2.query(new InstallableUnitQuery("org.eclipse.jdt.feature.group"), null);
assertEquals(1, c2.size());
IInstallableUnit jdt2 = (IInstallableUnit) c2.iterator().next();
@@ -103,7 +103,7 @@ public class ExplanationLargeConflict extends AbstractProvisioningTest {
public void testExplanationLargeConflictInSDK() {
long sTime = System.currentTimeMillis();
//Test large conflict. We are trying to install an inappropriate version of CVS over the already installed SDK
- Collector c = repo2.query(new InstallableUnitQuery("org.eclipse.cvs.feature.group"), null);
+ IQueryResult c = repo2.query(new InstallableUnitQuery("org.eclipse.cvs.feature.group"), null);
assertEquals(1, c.size());
IInstallableUnit cvs = (IInstallableUnit) c.iterator().next();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUProperties.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUProperties.java
index 2b87b84a5..a26a0a75d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUProperties.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUProperties.java
@@ -14,10 +14,10 @@ import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class IUProperties extends AbstractProvisioningTest {
@@ -59,8 +59,8 @@ public class IUProperties extends AbstractProvisioningTest {
IStatus s = engine.perform(pp1, null);
if (!s.isOK())
LogHelper.log(s);
- Collector collector = getProfile(profileId).query(new IUProfilePropertyQuery("FOO", null), null);
- assertEquals(1, collector.size());
+ IQueryResult queryResult = getProfile(profileId).query(new IUProfilePropertyQuery("FOO", null), null);
+ assertEquals(1, queryResult.size());
ProfileChangeRequest req2 = new ProfileChangeRequest(profile);
req2.removeInstallableUnitProfileProperty(b1, "FOO");
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUPropertyRemoval.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUPropertyRemoval.java
index 99a4f36e9..a410a42bf 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUPropertyRemoval.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/IUPropertyRemoval.java
@@ -13,10 +13,10 @@ import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class IUPropertyRemoval extends AbstractProvisioningTest {
@@ -50,7 +50,7 @@ public class IUPropertyRemoval extends AbstractProvisioningTest {
IProvisioningPlan pp1 = planner.getProvisioningPlan(req1, null, null);
assertEquals(IStatus.OK, pp1.getStatus().getSeverity());
engine.perform(pp1, null);
- Collector res = getProfile(profileId).query(new IUProfilePropertyQuery("FOO", null), null);
+ IQueryResult res = getProfile(profileId).query(new IUProfilePropertyQuery("FOO", null), null);
assertEquals(2, res.size());
ProfileChangeRequest req2 = new ProfileChangeRequest(profile);
@@ -58,7 +58,7 @@ public class IUPropertyRemoval extends AbstractProvisioningTest {
IProvisioningPlan pp2 = planner.getProvisioningPlan(req2, null, null);
assertEquals(1, pp2.getOperands().length);
engine.perform(pp2, null);
- Collector res2 = getProfile(profileId).query(new IUProfilePropertyQuery("FOO", null), null);
+ IQueryResult res2 = getProfile(profileId).query(new IUProfilePropertyQuery("FOO", null), null);
assertEquals(1, res2.size());
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java
index 93752228a..48aa67cc2 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/InclusionRuleTest2.java
@@ -14,10 +14,10 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class InclusionRuleTest2 extends AbstractProvisioningTest {
@@ -53,7 +53,7 @@ public class InclusionRuleTest2 extends AbstractProvisioningTest {
IProfileRegistry profileRegistry = getProfileRegistry();
profile = profileRegistry.getProfile(profile.getProfileId());
- Collector c = profile.query(new UserVisibleRootQuery(), null);
+ IQueryResult c = profile.query(new UserVisibleRootQuery(), null);
assertEquals(c.size(), 1);
System.gc();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java
index 6cfb5955b..295e6bf4a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NonMinimalState.java
@@ -18,12 +18,12 @@ import org.eclipse.equinox.internal.p2.engine.SimpleProfileRegistry;
import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnitFragment;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -68,7 +68,7 @@ public class NonMinimalState extends AbstractProvisioningTest {
private void why(String id) {
System.out.println("=-=-=" + id + "=-=-=");
visited = new HashSet();
- Collector roots = profile.query(new IUProfilePropertyQuery("org.eclipse.equinox.p2.type.root", "true"), null);
+ IQueryResult roots = profile.query(new IUProfilePropertyQuery("org.eclipse.equinox.p2.type.root", "true"), null);
searchedId = id;
for (Iterator iterator = roots.iterator(); iterator.hasNext();) {
IInstallableUnit type = (IInstallableUnit) iterator.next();
@@ -99,7 +99,7 @@ public class NonMinimalState extends AbstractProvisioningTest {
}
private boolean expandRequirement(IInstallableUnit iu, IRequirement req) {
- Collector matches = profile.query(req.getMatches(), null);
+ IQueryResult matches = profile.query(req.getMatches(), null);
for (Iterator iterator = matches.iterator(); iterator.hasNext();) {
IInstallableUnit match = (IInstallableUnit) iterator.next();
if (match.getId().equals(searchedId))
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java
index 47ba283b1..0c43c8de9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java
@@ -16,8 +16,10 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.director.PermissiveSlicer;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -33,7 +35,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
public void testSliceRCPOut() {
PermissiveSlicer slicer = new PermissiveSlicer(repo, new Properties(), true, false, true, false, false);
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
@@ -46,7 +48,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
//Test with and without optional pieces
public void testSliceRCPWithOptionalPieces() {
PermissiveSlicer slicer = new PermissiveSlicer(repo, new Properties(), false, false, true, false, false);
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
@@ -57,7 +59,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
public void testSliceRCPWithIgnoringGreed() {
PermissiveSlicer slicer = new PermissiveSlicer(repo, new Properties(), false, true, true, false, false);
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
@@ -72,7 +74,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
p.setProperty("osgi.ws", "win32");
p.setProperty("osgi.arch", "x86");
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, true, false, false, false);
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
@@ -88,7 +90,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
p.setProperty("osgi.ws", "win32");
p.setProperty("osgi.arch", "x86");
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, false, false, true, false);
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
@@ -100,7 +102,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
public void testExtractPlatformIndependentPieces() {
PermissiveSlicer slicer = new PermissiveSlicer(repo, new Properties(), true, false, false, false, false);
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor());
assertNotNull(result);
@@ -128,7 +130,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
p.setProperty("osgi.ws", "win32");
p.setProperty("osgi.arch", "x86");
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, false, false, true, false);
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.swt.cocoa.macosx"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.swt.cocoa.macosx"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
assertNull(slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()));
assertNotOK(slicer.getStatus());
@@ -149,18 +151,18 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest {
p.setProperty("osgi.ws", "win32");
p.setProperty("osgi.arch", "x86");
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, false, false, false, true);
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
- Collector resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(InstallableUnitQuery.ANY, new NullProgressMonitor());
assertEquals(3, resultCollector.size());
}
public void testExtractOnlyPlatformSpecific() {
Properties p = new Properties();
PermissiveSlicer slicer = new PermissiveSlicer(repo, p, true, false, true, false, true);
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
+ IQueryResult c = repo.query(new InstallableUnitQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor());
IInstallableUnit iu = (IInstallableUnit) c.iterator().next();
- Collector resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(InstallableUnitQuery.ANY, new NullProgressMonitor());
assertEquals(35, resultCollector.size());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java
index df44120f8..359ac9a48 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/ProvisioningPlanQueryTest.java
@@ -12,34 +12,34 @@ package org.eclipse.equinox.p2.tests.planner;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.*;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class ProvisioningPlanQueryTest extends AbstractProvisioningTest {
public void testNull() {
- Collector c = new ProvisioningPlan(Status.OK_STATUS, null, null, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult c = new ProvisioningPlan(Status.OK_STATUS, null, null, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
assertTrue(c.isEmpty());
}
public void testAddition() {
Operand[] ops = new Operand[] {new InstallableUnitOperand(null, createIU("A"))};
- Collector c = new ProvisioningPlan(null, ops, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult c = new ProvisioningPlan(null, ops, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
assertEquals(1, c.size());
assertEquals(0, new ProvisioningPlan(null, ops, null).getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor()).size());
}
public void testRemoval() {
Operand[] ops = new Operand[] {new InstallableUnitOperand(createIU("A"), null)};
- Collector c = new ProvisioningPlan(null, ops, null).getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult c = new ProvisioningPlan(null, ops, null).getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
assertEquals(1, c.size());
assertEquals(0, new ProvisioningPlan(null, ops, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor()).size());
}
public void testUpdate() {
Operand[] ops = new Operand[] {new InstallableUnitOperand(createIU("A"), createIU("B"))};
- Collector c = new ProvisioningPlan(null, ops, null).getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
+ IQueryResult c = new ProvisioningPlan(null, ops, null).getRemovals().query(InstallableUnitQuery.ANY, new NullProgressMonitor());
assertEquals(1, c.size());
assertEquals(1, new ProvisioningPlan(null, ops, null).getAdditions().query(InstallableUnitQuery.ANY, new NullProgressMonitor()).size());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java
index cc8365eb7..f854d2dce 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SWTFragment.java
@@ -14,11 +14,11 @@ import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.director.IPlanner;
import org.eclipse.equinox.internal.provisional.p2.director.ProfileChangeRequest;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SWTFragment extends AbstractProvisioningTest {
@@ -49,7 +49,7 @@ public class SWTFragment extends AbstractProvisioningTest {
req.addInstallableUnits(new IInstallableUnit[] {swt});
IProvisioningPlan plan = planner.getProvisioningPlan(req, null, null);
assertOK("plan", plan.getStatus());
- Collector c = plan.getAdditions().query(new InstallableUnitQuery("SWT"), null);
+ IQueryResult c = plan.getAdditions().query(new InstallableUnitQuery("SWT"), null);
c.addAll(plan.getAdditions().query(new InstallableUnitQuery("SWT.WIN32"), null));
assertEquals(2, c.size());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java
index e96b2e867..595140efe 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/SimulatedSharedInstallTest.java
@@ -21,6 +21,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUni
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
public class SimulatedSharedInstallTest extends AbstractProvisioningTest {
@@ -66,7 +67,9 @@ public class SimulatedSharedInstallTest extends AbstractProvisioningTest {
IProfile availableWrapper = new IProfile() {
public Collector available(IQuery query, IProgressMonitor monitor) {
- Collector collector = profile.query(query, monitor);
+ IQueryResult queryResult = profile.query(query, monitor);
+ Collector collector = new Collector();
+ collector.addAll(queryResult);
Collection ius = new ArrayList();
ius.add(b1);
@@ -98,7 +101,7 @@ public class SimulatedSharedInstallTest extends AbstractProvisioningTest {
return profile.getTimestamp();
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return profile.query(query, monitor);
}
};
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UpdateQueryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UpdateQueryTest.java
index d4bf57522..7c7499760 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UpdateQueryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/UpdateQueryTest.java
@@ -1,9 +1,9 @@
package org.eclipse.equinox.p2.tests.planner;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.UpdateQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -24,14 +24,14 @@ public class UpdateQueryTest extends AbstractProvisioningTest {
public void testUpdateWithDifferentId() {
IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {a1, updateOfA});
- Collector c = repo.query(new UpdateQuery(a1), null);
+ IQueryResult c = repo.query(new UpdateQuery(a1), null);
assertEquals(1, c.size());
assertEquals(updateOfA, c.iterator().next());
}
public void testWithSuperiorVersion() {
IMetadataRepository repo2 = createTestMetdataRepository(new IInstallableUnit[] {a11, a1});
- Collector c2 = repo2.query(new UpdateQuery(a1), null);
+ IQueryResult c2 = repo2.query(new UpdateQuery(a1), null);
assertEquals(1, c2.size());
assertEquals(a11, c2.iterator().next());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java
index aa9c7d794..3246c0a25 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java
@@ -9,6 +9,8 @@
******************************************************************************/
package org.eclipse.equinox.p2.tests.publisher;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.io.*;
import java.net.URI;
import java.util.*;
@@ -291,7 +293,7 @@ public class TestArtifactRepository implements IArtifactRepository {
return new ArtifactDescriptor(key);
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector collector = new Collector();
if (monitor != null && monitor.isCanceled())
return collector;
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java
index 90dca78a7..ba08abed7 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/BundlesActionTest.java
@@ -21,9 +21,9 @@ import org.eclipse.equinox.internal.p2.director.QueryableArray;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.actions.*;
import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction;
@@ -117,7 +117,7 @@ public class BundlesActionTest extends ActionTest {
ius = results.getIUs(null, null);
assertEquals("2.0", 1, ius.size());
QueryableArray queryableArray = new QueryableArray((IInstallableUnit[]) ius.toArray(new IInstallableUnit[ius.size()]));
- Collector result = queryableArray.query(new InstallableUnitQuery("foo"), null);
+ IQueryResult result = queryableArray.query(new InstallableUnitQuery("foo"), null);
assertEquals("3.1", 1, result.size());
IInstallableUnit iu = (IInstallableUnit) result.iterator().next();
IUPropertyUtils iuPropertyUtils = new IUPropertyUtils(queryableArray);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java
index 2def6875b..46a994748 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/LocalizationTests.java
@@ -17,9 +17,9 @@ import junit.framework.TestCase;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.updatesite.SiteXMLAction;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.PublisherInfo;
import org.eclipse.equinox.p2.publisher.PublisherResult;
import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction;
@@ -51,8 +51,8 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("fooFeature.feature.group"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.group"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME));
assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER));
assertEquals("1.3", "Foo English Description", utils.getIUProperty(iu, IInstallableUnit.PROP_DESCRIPTION));
@@ -65,8 +65,8 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("fooFeature.feature.group"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.group"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH));
assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH));
assertEquals("1.3", "Foo English Description", utils.getIUProperty(iu, IInstallableUnit.PROP_DESCRIPTION, Locale.ENGLISH));
@@ -79,8 +79,8 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("fooFeature.feature.group"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.group"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo German Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN));
assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN));
assertEquals("1.3", "Foo German Description", utils.getIUProperty(iu, IInstallableUnit.PROP_DESCRIPTION, Locale.GERMAN));
@@ -93,8 +93,8 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("fooFeature.feature.jar"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.jar"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME));
assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER));
assertEquals("1.3", "Foo English Description", utils.getIUProperty(iu, IInstallableUnit.PROP_DESCRIPTION));
@@ -107,8 +107,8 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("fooFeature.feature.jar"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.jar"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH));
assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH));
assertEquals("1.3", "Foo English Description", utils.getIUProperty(iu, IInstallableUnit.PROP_DESCRIPTION, Locale.ENGLISH));
@@ -121,8 +121,8 @@ public class LocalizationTests extends TestCase {
FeaturesAction featuresAction = new FeaturesAction(new File[] {file});
featuresAction.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("fooFeature.feature.jar"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("fooFeature.feature.jar"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo German Feature", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN));
assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN));
assertEquals("1.3", "Foo German Description", utils.getIUProperty(iu, IInstallableUnit.PROP_DESCRIPTION, Locale.GERMAN));
@@ -135,8 +135,8 @@ public class LocalizationTests extends TestCase {
BundlesAction action = new BundlesAction(new File[] {file});
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("foobundle"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("foobundle"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH));
assertEquals("1.1", "Foo English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH));
}
@@ -146,8 +146,8 @@ public class LocalizationTests extends TestCase {
BundlesAction action = new BundlesAction(new File[] {file});
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("foobundle"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("foobundle"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo German Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN));
assertEquals("1.1", "Foo German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN));
}
@@ -157,8 +157,8 @@ public class LocalizationTests extends TestCase {
BundlesAction action = new BundlesAction(new File[] {file});
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("barbundle"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("barbundle"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Bar English Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH));
assertEquals("1.1", "Bar English Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH));
}
@@ -168,8 +168,8 @@ public class LocalizationTests extends TestCase {
BundlesAction action = new BundlesAction(new File[] {file});
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("barbundle"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("barbundle"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Bar German Bundle", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN));
assertEquals("1.1", "Bar German Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN));
}
@@ -181,8 +181,8 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("foobundle2"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("foobundle2"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo English Bundle - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH));
assertEquals("1.1", "Foo English Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH));
}
@@ -194,8 +194,8 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("foobundle2"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("foobundle2"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Foo German Bundle - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN));
assertEquals("1.1", "Foo German Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN));
}
@@ -207,8 +207,8 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("barbundle2"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("barbundle2"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Bar English Bundle - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH));
assertEquals("1.1", "Bar English Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH));
}
@@ -220,8 +220,8 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("barbundle2"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("barbundle2"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "Bar German Bundle - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN));
assertEquals("1.1", "Bar German Provider - Translated in the Fragment", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN));
}
@@ -233,8 +233,8 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("barfragment2"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("barfragment2"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "English Fragment Name", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH));
assertEquals("1.1", "English Fragment Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.ENGLISH));
}
@@ -246,8 +246,8 @@ public class LocalizationTests extends TestCase {
action.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("barfragment2"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("barfragment2"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "German Fragment Name", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN));
assertEquals("1.1", "German Fragment Provider", utils.getIUProperty(iu, IInstallableUnit.PROP_PROVIDER, Locale.GERMAN));
}
@@ -262,8 +262,8 @@ public class LocalizationTests extends TestCase {
siteAction.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("foo.new_category_1"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("foo.new_category_1"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "English Category Name", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.ENGLISH));
assertEquals("1.1", "English Category Description", utils.getIUProperty(iu, IInstallableUnit.PROP_DESCRIPTION, Locale.ENGLISH));
@@ -279,8 +279,8 @@ public class LocalizationTests extends TestCase {
siteAction.perform(info, results, monitor);
IUPropertyUtils utils = new IUPropertyUtils(results.query(new InstallableUnitQuery((String) null), monitor));
- Collector collector = results.query(new InstallableUnitQuery("foo.new_category_1"), monitor);
- IInstallableUnit iu = (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery("foo.new_category_1"), monitor);
+ IInstallableUnit iu = (IInstallableUnit) queryResult.iterator().next();
assertEquals("1.0", "German Category Name", utils.getIUProperty(iu, IInstallableUnit.PROP_NAME, Locale.GERMAN));
assertEquals("1.1", "German Category Description", utils.getIUProperty(iu, IInstallableUnit.PROP_DESCRIPTION, Locale.GERMAN));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTest.java
index 110aa3e52..19b28db0d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionTest.java
@@ -24,9 +24,9 @@ import org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile;
import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.actions.RootIUAdvice;
import org.eclipse.equinox.p2.publisher.eclipse.*;
@@ -178,8 +178,8 @@ public class ProductActionTest extends ActionTest {
results.addIU(iu, IPublisherResult.NON_ROOT);
action2.perform(info, results, new NullProgressMonitor());
- Collector collector = results.query(new InstallableUnitQuery(flavorArg + configSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("1.0", 1, collector.size());
+ IQueryResult queryResult = results.query(new InstallableUnitQuery(flavorArg + configSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("1.0", 1, queryResult.size());
}
public void testMultiPlatformCUs_DifferentPlatforms() throws Exception {
@@ -201,11 +201,11 @@ public class ProductActionTest extends ActionTest {
action.perform(info, results, new NullProgressMonitor());
- Collector collector = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("1.0", 0, collector.size());
+ IQueryResult queryResult = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("1.0", 0, queryResult.size());
- collector = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("2.0", 0, collector.size());
+ queryResult = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("2.0", 0, queryResult.size());
}
public void testMultiPlatformCUs_SamePlatforms() throws Exception {
@@ -227,11 +227,11 @@ public class ProductActionTest extends ActionTest {
action.perform(info, results, new NullProgressMonitor());
- Collector collector = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("1.0", 1, collector.size());
+ IQueryResult queryResult = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("1.0", 1, queryResult.size());
- collector = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("2.0", 0, collector.size());
+ queryResult = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("2.0", 0, queryResult.size());
}
public void testMultiPlatformCUs_SamePlatforms_NoVersion() throws Exception {
@@ -252,11 +252,11 @@ public class ProductActionTest extends ActionTest {
action.perform(info, results, new NullProgressMonitor());
- Collector collector = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("1.0", 1, collector.size());
+ IQueryResult queryResult = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("1.0", 1, queryResult.size());
- collector = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("2.0", 0, collector.size());
+ queryResult = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("2.0", 0, queryResult.size());
}
public void testMultiPlatformCUs_SamePlatforms_BoundedVersions() throws Exception {
@@ -278,11 +278,11 @@ public class ProductActionTest extends ActionTest {
action.perform(info, results, new NullProgressMonitor());
- Collector collector = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("1.0", 1, collector.size());
+ IQueryResult queryResult = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("1.0", 1, queryResult.size());
- collector = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("2.0", 0, collector.size());
+ queryResult = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("2.0", 0, queryResult.size());
}
public void testCUsHost() throws Exception {
@@ -303,9 +303,9 @@ public class ProductActionTest extends ActionTest {
action.perform(info, results, new NullProgressMonitor());
- Collector collector = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("1.0", 1, collector.size());
- IInstallableUnitFragment fragment = (IInstallableUnitFragment) collector.iterator().next();
+ IQueryResult queryResult = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("1.0", 1, queryResult.size());
+ IInstallableUnitFragment fragment = (IInstallableUnitFragment) queryResult.iterator().next();
assertEquals("1.1", "org.eclipse.core.runtime", ((IRequiredCapability) fragment.getHost()[0].getMatches()).getName());
assertEquals("1.2", Version.create("4.0.0"), ((IRequiredCapability) fragment.getHost()[0].getMatches()).getRange().getMinimum());
assertEquals("1.3", Version.create("1.0.0"), fragment.getVersion());
@@ -324,11 +324,11 @@ public class ProductActionTest extends ActionTest {
action.perform(info, results, new NullProgressMonitor());
- Collector collector = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("1.0", 0, collector.size());
+ IQueryResult queryResult = results.query(new InstallableUnitQuery(flavorArg + linuxConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("1.0", 0, queryResult.size());
- collector = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
- assertEquals("2.0", 0, collector.size());
+ queryResult = results.query(new InstallableUnitQuery(flavorArg + windowsConfigSpec + "org.eclipse.core.runtime"), new NullProgressMonitor());
+ assertEquals("2.0", 0, queryResult.size());
}
public void testMultiConfigspecProductPublishing() throws IOException, Exception {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java
index 7f92c5e4b..457138013 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductActionWithAdviceFileTest.java
@@ -19,10 +19,10 @@ import org.eclipse.equinox.internal.p2.metadata.LDAPQuery;
import org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IRequirement;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.IPublisherResult;
import org.eclipse.equinox.p2.publisher.PublisherInfo;
import org.eclipse.equinox.p2.publisher.actions.QueryableFilterAdvice;
@@ -80,7 +80,7 @@ public class ProductActionWithAdviceFileTest extends ActionTest {
info.addAdvice(new QueryableFilterAdvice(info.getContextMetadataRepository()));
testAction.perform(info, publisherResult, null);
- Collector results = publisherResult.query(new IUQuery("org.eclipse.platform.ide", Version.create("3.5.0.I20081118")), null);
+ IQueryResult results = publisherResult.query(new IUQuery("org.eclipse.platform.ide", Version.create("3.5.0.I20081118")), null);
assertEquals("1.0", 1, results.size());
IInstallableUnit unit = (IInstallableUnit) results.iterator().next();
IRequirement[] requiredCapabilities = unit.getRequiredCapabilities();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java
index e4430d133..ed34f880a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/EvaluatorTest.java
@@ -19,9 +19,11 @@ import org.eclipse.equinox.internal.p2.director.QueryableArray;
import org.eclipse.equinox.internal.p2.director.app.Activator;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.MatchQuery;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.PublisherInfo;
import org.eclipse.equinox.p2.publisher.PublisherResult;
import org.eclipse.equinox.p2.publisher.eclipse.BundlesAction;
@@ -69,20 +71,20 @@ public class EvaluatorTest extends AbstractProvisioningTest {
public void testLatest() throws Exception {
IMetadataRepository repo = getMDR("/testData/metadataRepo/multipleversions1");
- Collector result = repo.query(new QLContextQuery("latest(x | x.id == $0)", "test.bundle"), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLContextQuery("latest(x | x.id == $0)", "test.bundle"), new NullProgressMonitor());
assertTrue(result.size() == 1);
}
public void testRange() throws Exception {
IMetadataRepository repo = getMDR("/testData/metadataRepo/multipleversions1");
- Collector result = repo.query(new QLMatchQuery("version ~= $0", new VersionRange("2.0.0")), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLMatchQuery("version ~= $0", new VersionRange("2.0.0")), new NullProgressMonitor());
assertEquals(result.size(), 2);
}
public void testProperty() throws Exception {
IMetadataRepository repo = getMDR("/testData/metadataRepo/multipleversions1");
- Collector result = repo.query(new QLMatchQuery("properties.exists(p | boolean(p.value))"), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLMatchQuery("properties.exists(p | boolean(p.value))"), new NullProgressMonitor());
assertEquals(result.size(), 3);
result = repo.query(new QLMatchQuery("boolean(properties['org.eclipse.equinox.p2.type.group'])"), new NullProgressMonitor());
@@ -125,14 +127,14 @@ public class EvaluatorTest extends AbstractProvisioningTest {
// Create the query
IMetadataRepository repo = getMDR("/testData/metadataRepo/multipleversions1");
- Collector result = repo.query(new QLContextQuery(IInstallableUnit.class, e3, new Object[] {args}), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLContextQuery(IInstallableUnit.class, e3, new Object[] {args}), new NullProgressMonitor());
assertEquals(result.size(), 1);
}
public void testMember() throws Exception {
IMetadataRepository repo = getMDR("/testData/metadataRepo/wsdlTestRepo");
IProvidedCapability pc = MetadataFactory.createProvidedCapability("org.eclipse.equinox.p2.eclipse.type", "source", null);
- Collector result = repo.query(new QLMatchQuery(IInstallableUnitFragment.class, "host.exists(h | $0 ~= h)", new Object[] {pc}), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLMatchQuery(IInstallableUnitFragment.class, "host.exists(h | $0 ~= h)", new Object[] {pc}), new NullProgressMonitor());
assertEquals(result.size(), 1);
}
@@ -144,20 +146,20 @@ public class EvaluatorTest extends AbstractProvisioningTest {
applicability[1][1] = MetadataFactory.createRequiredCapability("org.eclipse.equinox.p2.flavor", "tooling", null, null, false, false);
IMetadataRepository repo = getMDR("/testData/metadataRepo/wsdlTestRepo");
- Collector result = repo.query(new QLMatchQuery("$0.exists(rcs | rcs.all(rc | item ~= rc))", applicability), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLMatchQuery("$0.exists(rcs | rcs.all(rc | item ~= rc))", applicability), new NullProgressMonitor());
assertEquals(result.size(), 3);
}
public void testPattern() throws Exception {
IProvidedCapability pc = MetadataFactory.createProvidedCapability("org.eclipse.equinox.p2.eclipse.type", "source", null);
IMetadataRepository repo = getMDR("/testData/metadataRepo/wsdlTestRepo");
- Collector result = repo.query(new QLMatchQuery("id ~= /tooling.*.default/", pc), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLMatchQuery("id ~= /tooling.*.default/", pc), new NullProgressMonitor());
assertEquals(result.size(), 3);
}
public void testLimit() throws Exception {
IMetadataRepository repo = getMDR("/testData/metadataRepo/wsdlTestRepo");
- Collector result = repo.query(new QLContextQuery("select(x | x.id ~= /tooling.*/).limit(1)"), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLContextQuery("select(x | x.id ~= /tooling.*/).limit(1)"), new NullProgressMonitor());
assertEquals(result.size(), 1);
result = repo.query(new QLContextQuery("select(x | x.id ~= /tooling.*/).limit($0)", new Integer(2)), new NullProgressMonitor());
@@ -166,7 +168,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
public void testNot() throws Exception {
IMetadataRepository repo = getMDR("/testData/metadataRepo/wsdlTestRepo");
- Collector result = repo.query(new QLMatchQuery("!(id ~= /tooling.*/)"), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLMatchQuery("!(id ~= /tooling.*/)"), new NullProgressMonitor());
assertEquals(result.size(), 4);
}
@@ -177,7 +179,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
assertNotNull(artifactManager);
IArtifactRepository repo = artifactManager.loadRepository(artifactRepo, new NullProgressMonitor());
- Collector result = repo.query(new QLMatchQuery(IArtifactKey.class, "classifier ~= /*/", null), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLMatchQuery(IArtifactKey.class, "classifier ~= /*/", null), new NullProgressMonitor());
assertTrue(result.size() > 1);
Iterator itor = result.iterator();
while (itor.hasNext())
@@ -192,7 +194,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
public void testClassConstructor() throws Exception {
IMetadataRepository repo = getMDR("/testData/metadataRepo/wsdlTestRepo");
- Collector result = repo.query(new QLContextQuery(//
+ IQueryResult result = repo.query(new QLContextQuery(//
"select(x | x ~= class('org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnitFragment'))"), new NullProgressMonitor());
assertEquals(result.size(), 4);
repo = getMDR("/testData/galileoM7");
@@ -200,7 +202,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
public void testTraverseWithoutIndex() throws Exception {
IMetadataRepository repo = getMDR("/testData/galileoM7");
- Collector result = repo.query(new QLContextQuery( //
+ IQueryResult result = repo.query(new QLContextQuery( //
"select(x | x.id == $0 && x.version == $1).traverse(parent | select(" + //
"child | parent.requiredCapabilities.exists(rc | child ~= rc)))", //
"org.eclipse.sdk.feature.group", Version.create("3.5.0.v20090423-7Q7bA7DPR-wM38__Q4iRsmx9z0KOjbpx3AbyvXd-Uq7J2")), new NullProgressMonitor());
@@ -209,7 +211,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
public void testTraverseWithIndex() throws Exception {
IMetadataRepository repo = getMDR("/testData/galileoM7");
- Collector result = repo.query(//
+ IQueryResult result = repo.query(//
new QLContextQuery("" + //
"select(x | x.id == $0 && x.version == $1).traverse(capabilityIndex(everything), _, { index, parent |" + //
"index.satisfiesAny(parent.requiredCapabilities)})", //
@@ -232,7 +234,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
QLContextQuery query = new QLContextQuery(IInstallableUnit.class, expr, new Object[] {"org.eclipse.sdk.feature.group", Version.create("3.5.0.v20090423-7Q7bA7DPR-wM38__Q4iRsmx9z0KOjbpx3AbyvXd-Uq7J2"), env});
IMetadataRepository repo = getMDR("/testData/galileoM7");
- Collector result = repo.query(query, new NullProgressMonitor());
+ IQueryResult result = repo.query(query, new NullProgressMonitor());
assertEquals(result.size(), 411);
}
@@ -262,7 +264,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
env,//
index});
- Collector result = repo.query(query, new NullProgressMonitor());
+ IQueryResult result = repo.query(query, new NullProgressMonitor());
assertEquals(result.size(), 184);
}
@@ -281,7 +283,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
return "true".equals(((IInstallableUnit) candidate).getProperty("org.eclipse.equinox.p2.type.group"));
}
};
- Collector result = repo.query(new QLMatchQuery(IInstallableUnit.class, expr, new Object[] {q1, q2}), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLMatchQuery(IInstallableUnit.class, expr, new Object[] {q1, q2}), new NullProgressMonitor());
assertEquals(result.size(), 497);
}
@@ -300,7 +302,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
return "true".equals(((IInstallableUnit) candidate).getProperty("org.eclipse.equinox.p2.type.group"));
}
};
- Collector result = repo.query(new QLContextQuery(IInstallableUnit.class, expr, new Object[] {q1, q2}), new NullProgressMonitor());
+ IQueryResult result = repo.query(new QLContextQuery(IInstallableUnit.class, expr, new Object[] {q1, q2}), new NullProgressMonitor());
assertEquals(result.size(), 497);
}
@@ -325,7 +327,7 @@ public class EvaluatorTest extends AbstractProvisioningTest {
ius = results.getIUs(null, null);
assertEquals("2.0", 3, ius.size());
QueryableArray queryableArray = new QueryableArray((IInstallableUnit[]) ius.toArray(new IInstallableUnit[ius.size()]));
- Collector result = queryableArray.query(new InstallableUnitQuery("foo"), null);
+ IQueryResult result = queryableArray.query(new InstallableUnitQuery("foo"), null);
assertEquals("2.1", 1, result.size());
QLMatchQuery lq = new QLMatchQuery("translations['org.eclipse.equinox.p2.name'] ~= /German*/");
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java
index 3455c2624..f0122a381 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/PerformanceTest.java
@@ -22,6 +22,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.ql.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
@@ -34,7 +35,7 @@ public class PerformanceTest extends AbstractProvisioningTest {
IRequiredCapability capability = MetadataFactory.createRequiredCapability("org.eclipse.equinox.p2.eclipse.type", "feature", new VersionRange("[1.0.0,2.0.0)"), null, false, false);
QLMatchQuery predicateQuery = new QLMatchQuery("item ~= $0", capability);
- Collector result;
+ IQueryResult result;
long tradQueryMS = 0;
long exprQueryMS = 0;
@@ -66,7 +67,7 @@ public class PerformanceTest extends AbstractProvisioningTest {
IRequiredCapability capability = MetadataFactory.createRequiredCapability("org.eclipse.equinox.p2.eclipse.type", "feature", new VersionRange("[1.0.0,2.0.0)"), null, false, false);
QLContextQuery exprQuery = new QLContextQuery("capabilityIndex(everything)");
exprQuery = new QLContextQuery("$0.satisfiesAny([$1])", exprQuery.query(QL.newQueryContext(qaRepo)), capability);
- Collector result;
+ IQueryResult result;
long tradQueryMS = 0;
long exprQueryMS = 0;
@@ -96,7 +97,7 @@ public class PerformanceTest extends AbstractProvisioningTest {
IUPropertyQuery propertyQuery = new IUPropertyQuery("df_LT.providerName", "Eclipse.org");
QLMatchQuery predicateQuery = new QLMatchQuery("properties[$0] == $1", "df_LT.providerName", "Eclipse.org");
- Collector result;
+ IQueryResult result;
long tradQueryMS = 0;
long exprQueryMS = 0;
@@ -127,8 +128,8 @@ public class PerformanceTest extends AbstractProvisioningTest {
env.put("osgi.arch", "x86");
IMetadataRepository repo = getMDR("/testData/galileoM7");
- Collector c = repo.query(new InstallableUnitQuery("org.eclipse.sdk.feature.group", Version.create("3.5.0.v20090423-7Q7bA7DPR-wM38__Q4iRsmx9z0KOjbpx3AbyvXd-Uq7J2")), new NullProgressMonitor());
- Iterator itor = c.iterator();
+ IQueryResult r = repo.query(new InstallableUnitQuery("org.eclipse.sdk.feature.group", Version.create("3.5.0.v20090423-7Q7bA7DPR-wM38__Q4iRsmx9z0KOjbpx3AbyvXd-Uq7J2")), new NullProgressMonitor());
+ Iterator itor = r.iterator();
assertTrue(itor.hasNext());
IInstallableUnit[] roots = new IInstallableUnit[] {(IInstallableUnit) itor.next()};
@@ -141,9 +142,9 @@ public class PerformanceTest extends AbstractProvisioningTest {
IQueryable slice = null;
for (int idx = 0; idx < 100; ++idx) {
long startTime = System.currentTimeMillis();
- c = repo.query(query, new NullProgressMonitor());
+ r = repo.query(query, new NullProgressMonitor());
traverseTime += (System.currentTimeMillis() - startTime);
- assertEquals(c.size(), 411);
+ assertEquals(r.size(), 411);
startTime = System.currentTimeMillis();
Slicer slicer = new Slicer(new QueryableArray(gatherAvailableInstallableUnits(repo)), env, false);
@@ -151,12 +152,12 @@ public class PerformanceTest extends AbstractProvisioningTest {
sliceTime += (System.currentTimeMillis() - startTime);
}
// Check the size of the last slice to verify that it's the same as the traverse size
- c = slice.query(new MatchQuery() {
+ r = slice.query(new MatchQuery() {
public boolean isMatch(Object value) {
return true;
}
}, new NullProgressMonitor());
- assertEquals(c.size(), 411);
+ assertEquals(r.size(), 411);
System.out.print("100 * Slicing took: ");
System.out.println(sliceTime);
@@ -176,7 +177,7 @@ public class PerformanceTest extends AbstractProvisioningTest {
private IInstallableUnit[] gatherAvailableInstallableUnits(IQueryable queryable) {
ArrayList list = new ArrayList();
- Collector matches = queryable.query(InstallableUnitQuery.ANY, null);
+ IQueryResult matches = queryable.query(InstallableUnitQuery.ANY, null);
for (Iterator it = matches.iterator(); it.hasNext();)
list.add(it.next());
return (IInstallableUnit[]) list.toArray(new IInstallableUnit[list.size()]);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java
index d0102aec2..ecf4a30b0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ql/TestQueryReimplementation.java
@@ -11,9 +11,9 @@
package org.eclipse.equinox.p2.tests.ql;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IVersionedId;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.ql.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
@@ -127,14 +127,14 @@ public class TestQueryReimplementation extends AbstractProvisioningTest {
public void testUpdateWithDifferentId() {
IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {a1, updateOfA});
- Collector c = repo.query(new UpdateQuery(a1), null);
+ IQueryResult c = repo.query(new UpdateQuery(a1), null);
assertEquals(1, c.size());
assertEquals(updateOfA, c.iterator().next());
}
public void testWithSuperiorVersion() {
IMetadataRepository repo2 = createTestMetdataRepository(new IInstallableUnit[] {a11, a1});
- Collector c2 = repo2.query(new UpdateQuery(a1), null);
+ IQueryResult c2 = repo2.query(new UpdateQuery(a1), null);
assertEquals(1, c2.size());
assertEquals(a11, c2.iterator().next());
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java
index 35ee2b3d8..80e52cde1 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractReconcilerTest.java
@@ -22,10 +22,10 @@ import org.eclipse.equinox.internal.p2.update.*;
import org.eclipse.equinox.internal.p2.updatesite.Activator;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestActivator;
import org.eclipse.osgi.service.datalocation.Location;
@@ -528,8 +528,8 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
SimpleProfileRegistry registry = new SimpleProfileRegistry(location, new SurrogateProfileHandler(), false);
IProfile[] profiles = registry.getProfiles();
assertEquals("1.0 Should only be one profile in registry.", 1, profiles.length);
- Collector collector = profiles[0].query(new InstallableUnitQuery(id, Version.create(version)), null);
- return !collector.isEmpty();
+ IQueryResult queryResult = profiles[0].query(new InstallableUnitQuery(id, Version.create(version)), null);
+ return !queryResult.isEmpty();
}
public IInstallableUnit getRemoteIU(String id, String version) {
@@ -537,9 +537,9 @@ public class AbstractReconcilerTest extends AbstractProvisioningTest {
SimpleProfileRegistry registry = new SimpleProfileRegistry(location, new SurrogateProfileHandler(), false);
IProfile[] profiles = registry.getProfiles();
assertEquals("1.0 Should only be one profile in registry.", 1, profiles.length);
- Collector collector = profiles[0].query(new InstallableUnitQuery(id, Version.create(version)), null);
- assertEquals("1.1 Should not have more than one IU wth the same ID and version.", 1, collector.size());
- return (IInstallableUnit) collector.iterator().next();
+ IQueryResult queryResult = profiles[0].query(new InstallableUnitQuery(id, Version.create(version)), null);
+ assertEquals("1.1 Should not have more than one IU wth the same ID and version.", 1, queryResult.size());
+ return (IInstallableUnit) queryResult.iterator().next();
}
public int runInitialize(String message) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/LocalUpdatesiteTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/LocalUpdatesiteTest.java
index 28793a6bb..7540b483f 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/LocalUpdatesiteTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/LocalUpdatesiteTest.java
@@ -15,9 +15,9 @@ import java.util.Iterator;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.updatesite.UpdateSitePublisherApplication;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.CategoryQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
import org.eclipse.equinox.p2.tests.TestData;
@@ -48,7 +48,7 @@ public class LocalUpdatesiteTest extends AbstractProvisioningTest {
fail("0.99");
}
IMetadataRepository repository = getMetadataRepositoryManager().loadRepository(repoLocation.toURI(), new NullProgressMonitor());
- Collector results = repository.query(new CategoryQuery(), new NullProgressMonitor());
+ IQueryResult results = repository.query(new CategoryQuery(), new NullProgressMonitor());
assertEquals("1.0", 1, results.size());
Iterator iter = results.iterator();
while (iter.hasNext()) {
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java
index b655fb030..484f3a7e8 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/SiteXMLActionTest.java
@@ -18,10 +18,10 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.internal.p2.updatesite.SiteXMLAction;
import org.eclipse.equinox.internal.provisional.p2.metadata.IProvidedCapability;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.RepositoryReference;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.CategoryQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction;
import org.eclipse.equinox.p2.repository.IRepository;
@@ -51,7 +51,7 @@ public class SiteXMLActionTest extends AbstractProvisioningTest {
}
public void testQualifier() {
- Collector results = actionResult.query(new CategoryQuery(), new NullProgressMonitor());
+ IQueryResult results = actionResult.query(new CategoryQuery(), new NullProgressMonitor());
Iterator iter = results.iterator();
while (iter.hasNext()) {
IInstallableUnit unit = (IInstallableUnit) iter.next();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
index d1e856c44..38aaaffff 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/updatesite/UpdateSiteTest.java
@@ -31,10 +31,10 @@ import org.eclipse.equinox.internal.p2.updatesite.UpdateSite;
import org.eclipse.equinox.internal.p2.updatesite.artifact.UpdateSiteArtifactRepository;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository;
import org.eclipse.equinox.p2.metadata.*;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.artifact.*;
@@ -585,7 +585,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
fail("Can't load repository missingUpdateURLFeature");
}
InstallableUnitQuery query = new InstallableUnitQuery("test.featurewithmissingupdateurl.feature.group", Version.create("1.0.0"));
- Collector result = metadataRepo.query(query, null);
+ IQueryResult result = metadataRepo.query(query, null);
assertEquals("1.0", 1, result.size());
}
@@ -603,7 +603,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
fail("Can't load repository UpdateSite243422");
}
InstallableUnitQuery query = new InstallableUnitQuery("org.eclipse.jdt.astview.feature.feature.group", Version.create("1.0.1"));
- Collector result = metadataRepo.query(query, null);
+ IQueryResult result = metadataRepo.query(query, null);
assertEquals("1.0", 1, result.size());
IInstallableUnit featureIU = (IInstallableUnit) result.iterator().next();
IRequirement[] required = featureIU.getRequiredCapabilities();
@@ -624,7 +624,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
} catch (ProvisionException e) {
fail("Can't load repository UpdateSite240121");
}
- Collector keys = artifactRepo.query(new ArtifactKeyQuery(null, "Plugin240121", null), null);
+ IQueryResult keys = artifactRepo.query(new ArtifactKeyQuery(null, "Plugin240121", null), null);
assertEquals(1, keys.size());
IArtifactKey key = (IArtifactKey) keys.iterator().next();
IStatus status = artifactRepo.getArtifact(artifactRepo.getArtifactDescriptors(key)[0], new ByteArrayOutputStream(500), new NullProgressMonitor());
@@ -648,7 +648,7 @@ public class UpdateSiteTest extends AbstractProvisioningTest {
fail("1.99", e);
return;
}
- Collector result = repository.query(new InstallableUnitQuery("test.feature.feature.jar"), getMonitor());
+ IQueryResult result = repository.query(new InstallableUnitQuery("test.feature.feature.jar"), getMonitor());
assertTrue("1.0", !result.isEmpty());
IInstallableUnit unit = (IInstallableUnit) result.iterator().next();
ITouchpointData[] data = unit.getTouchpointData();
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java
index 08c3b8e7b..9388d821e 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.io.File;
import java.io.OutputStream;
import java.util.*;
@@ -104,7 +106,7 @@ public class AggregatedBundleRepository extends AbstractArtifactRepository imple
return bundleRepositories;
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
// Query all the all the repositories
CompoundQueryable queryable = new CompoundQueryable((IQueryable[]) bundleRepositories.toArray(new IQueryable[bundleRepositories.size()]));
return queryable.query(query, monitor);
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java
index 2cc00a320..63e9a1e4b 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java
@@ -19,13 +19,13 @@ import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.osgi.framework.ServiceReference;
@@ -118,7 +118,7 @@ public class EclipseMarkSetProvider extends MarkSetProvider {
VersionRange range = searchedVersion != null ? new VersionRange(searchedVersion, true, searchedVersion, true) : null;
ArtifactKeyQuery query = new ArtifactKeyQuery(classifier, searchedId, range);
//TODO short-circuit the query when we find one?
- Collector keys = repo.query(query, null);
+ IQueryResult keys = repo.query(query, null);
if (!keys.isEmpty())
return (IArtifactKey) keys.iterator().next();
return null;
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 faad3fedb..c984f7ad7 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
@@ -138,8 +138,8 @@ public class QueryProvider {
if (profile == null)
return null;
if (toUpdate == null) {
- Collector collector = profile.query(policy.getVisibleInstalledIUQuery(), null);
- toUpdate = (IInstallableUnit[]) collector.toArray(IInstallableUnit.class);
+ IQueryResult queryResult = profile.query(policy.getVisibleInstalledIUQuery(), null);
+ toUpdate = (IInstallableUnit[]) queryResult.toArray(IInstallableUnit.class);
}
QueryableUpdates updateQueryable = new QueryableUpdates(ui, toUpdate);
return new ElementQueryDescriptor(updateQueryable, context.getShowLatestVersionsOnly() ? new LatestIUVersionQuery() : allQuery, new Collector());
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java
index 8786c944e..ae418ea85 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/QueryableRepositoryManager.java
@@ -16,6 +16,7 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
import org.eclipse.equinox.p2.operations.RepositoryTracker;
import org.eclipse.equinox.p2.repository.IRepository;
@@ -53,7 +54,7 @@ public abstract class QueryableRepositoryManager implements IQueryable {
/**
* Iterates over the repositories configured in this queryable.
* For most queries, the query is run on each repository, passing any objects that satisfy the
- * query to the provided collector. If the query is a {@link RepositoryLocationQuery}, the query
+ * query. If the query is a {@link RepositoryLocationQuery}, the query
* is run on the repository locations instead.
* <p>
* This method is long-running; progress and cancellation are provided
@@ -63,9 +64,9 @@ public abstract class QueryableRepositoryManager implements IQueryable {
* @param query The query to perform..
* @param monitor a progress monitor, or <code>null</code> if progress
* reporting is not desired
- * @return The collector argument
+ * @return The QueryResult argument
*/
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
IRepositoryManager manager = getRepositoryManager();
if (monitor == null)
monitor = new NullProgressMonitor();
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java
index 3500f671b..d7337dcfc 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/AvailableIUWrapper.java
@@ -16,10 +16,12 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
import org.eclipse.equinox.internal.p2.ui.model.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
+import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.CategoryQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
/**
* A wrapper that examines available IU's and wraps them in an
@@ -81,8 +83,8 @@ public class AvailableIUWrapper extends QueriedElementWrapper {
boolean isUpdate = false;
boolean isInstalled = false;
if (profile != null && iu != null) {
- Collector collector = profile.query(new InstallableUnitQuery(iu.getId()), null);
- Iterator iter = collector.iterator();
+ IQueryResult queryResult = profile.query(new InstallableUnitQuery(iu.getId()), null);
+ Iterator iter = queryResult.iterator();
// We are typically iterating over only one IU unless it's a non-singleton.
while (iter.hasNext()) {
IInstallableUnit installed = (IInstallableUnit) iter.next();
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableProfileRegistry.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableProfileRegistry.java
index f341850e6..fc07c3d0a 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableProfileRegistry.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableProfileRegistry.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.query;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.util.Arrays;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;
@@ -32,7 +34,7 @@ public class QueryableProfileRegistry implements IQueryable {
this.ui = ui;
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector result = new Collector();
IProfile[] profiles = ui.getSession().getProfileRegistry().getProfiles();
SubMonitor sub = SubMonitor.convert(monitor, ProvUIMessages.QueryableProfileRegistry_QueryProfileProgress, profiles.length);
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java
index 2951a383e..07c96124d 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/query/QueryableUpdates.java
@@ -11,6 +11,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.query;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.util.ArrayList;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
@@ -35,7 +37,7 @@ public class QueryableUpdates implements IQueryable {
this.iusToUpdate = iusToUpdate;
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
Collector result = new Collector();
if (monitor == null)
monitor = new NullProgressMonitor();
diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java
index b52e23827..f9d38f784 100644
--- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java
+++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java
@@ -23,6 +23,7 @@ import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.Inst
import org.eclipse.equinox.internal.provisional.p2.metadata.query.*;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.query.IQuery;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
import org.eclipse.equinox.p2.publisher.*;
import org.eclipse.equinox.p2.publisher.eclipse.URLEntry;
import org.eclipse.equinox.p2.repository.IRepository;
@@ -152,14 +153,14 @@ public class SiteXMLAction extends AbstractPublisherAction {
}
}
- Collector collector = results.query(query, null);
- if (collector.size() == 0)
- collector.addAll(publisherInfo.getMetadataRepository().query(query, null));
- if (collector.size() == 0 && publisherInfo.getContextMetadataRepository() != null)
- collector.addAll(publisherInfo.getContextMetadataRepository().query(query, null));
+ IQueryResult queryResult = results.query(query, null);
+ if (queryResult.size() == 0)
+ queryResult.addAll(publisherInfo.getMetadataRepository().query(query, null));
+ if (queryResult.size() == 0 && publisherInfo.getContextMetadataRepository() != null)
+ queryResult.addAll(publisherInfo.getContextMetadataRepository().query(query, null));
- if (collector.size() == 1)
- return (IInstallableUnit) collector.iterator().next();
+ if (queryResult.size() == 1)
+ return (IInstallableUnit) queryResult.iterator().next();
return null;
}
diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepository.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepository.java
index 92a884236..eb48caa6d 100644
--- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepository.java
@@ -10,13 +10,14 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.updatesite.artifact;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.io.OutputStream;
import java.net.URI;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.query.IQuery;
import org.eclipse.equinox.p2.repository.artifact.*;
@@ -139,7 +140,7 @@ public class UpdateSiteArtifactRepository implements IArtifactRepository {
return delegate.createArtifactDescriptor(key);
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return delegate.query(query, monitor);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java
index 6a613fdc8..4b6786e1f 100644
--- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepository.java
@@ -10,10 +10,11 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.updatesite.metadata;
+import org.eclipse.equinox.p2.metadata.query.IQueryResult;
+
import java.net.URI;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.query.IQuery;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
@@ -99,7 +100,7 @@ public class UpdateSiteMetadataRepository implements IMetadataRepository {
return delegate.getAdapter(adapter);
}
- public Collector query(IQuery query, IProgressMonitor monitor) {
+ public IQueryResult query(IQuery query, IProgressMonitor monitor) {
return delegate.query(query, monitor);
}
} \ No newline at end of file

Back to the top