Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 154883 Details for
Bug 292691
PDE's use of p2 API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch covering API changes when simplifying IQuery/IQueryResult
queryresult-pde.patch (text/plain), 6.65 KB, created by
Thomas Hallgren
on 2009-12-21 11:45:22 EST
(
hide
)
Description:
Patch covering API changes when simplifying IQuery/IQueryResult
Filename:
MIME Type:
Creator:
Thomas Hallgren
Created:
2009-12-21 11:45:22 EST
Size:
6.65 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.build >Index: src/org/eclipse/pde/internal/build/publisher/compatibility/RootFileParentAction.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/publisher/compatibility/Attic/RootFileParentAction.java,v >retrieving revision 1.1.2.3 >diff -u -r1.1.2.3 RootFileParentAction.java >--- src/org/eclipse/pde/internal/build/publisher/compatibility/RootFileParentAction.java 7 Dec 2009 04:36:01 -0000 1.1.2.3 >+++ src/org/eclipse/pde/internal/build/publisher/compatibility/RootFileParentAction.java 21 Dec 2009 16:44:59 -0000 >@@ -10,14 +10,14 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.build.publisher.compatibility; > >-import org.eclipse.equinox.p2.metadata.IInstallableUnit; >- > import org.eclipse.core.runtime.*; > 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; >+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.MatchQuery; >+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.RootFilesAction; > import org.eclipse.pde.internal.build.IPDEBuildConstants; >@@ -54,8 +54,8 @@ > } > }; > >- Collector collector = query.perform(results.getIUs(null, IPublisherResult.NON_ROOT).iterator(), new Collector()); >- InstallableUnitDescription descriptor = createParentIU(collector.toCollection(), RootFilesAction.computeIUId(baseId, flavor), Version.parseVersion(version)); >+ IQueryResult collector = query.perform(results.getIUs(null, IPublisherResult.NON_ROOT).iterator()); >+ InstallableUnitDescription descriptor = createParentIU(collector.unmodifiableSet(), RootFilesAction.computeIUId(baseId, flavor), Version.parseVersion(version)); > descriptor.setSingleton(true); > IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); > results.addIU(rootIU, IPublisherResult.ROOT); >#P org.eclipse.pde.build.tests >Index: src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java,v >retrieving revision 1.15.2.5 >diff -u -r1.15.2.5 P2TestCase.java >--- src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java 16 Dec 2009 19:12:05 -0000 1.15.2.5 >+++ src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java 21 Dec 2009 16:45:01 -0000 >@@ -156,10 +156,10 @@ > IQueryResult queryResult = repository.query(new InstallableUnitQuery(name), null); > > IInstallableUnit unit = null; >- if (queryResult.size() > 0) >+ if (!queryResult.isEmpty()) > unit = (IInstallableUnit) queryResult.iterator().next(); > if (assertNotNull) { >- assertEquals(queryResult.size(), 1); >+ assertEquals(queryResult.unmodifiableSet().size(), 1); > assertNotNull(unit); > } > return unit; >Index: src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java,v >retrieving revision 1.83.2.7 >diff -u -r1.83.2.7 PublishingTests.java >--- src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java 16 Dec 2009 19:12:05 -0000 1.83.2.7 >+++ src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java 21 Dec 2009 16:45:02 -0000 >@@ -1322,7 +1322,7 @@ > URI repoURI = URIUtil.fromString("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString()); > IMetadataRepository metadata = loadMetadataRepository(repoURI); > IQueryResult queryResult = metadata.query(new InstallableUnitQuery("a"), null); >- assertTrue(queryResult.size() == 0); >+ assertTrue(queryResult.isEmpty()); > getIU(metadata, "b"); > } > >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/target/IUBundleContainer.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/target/IUBundleContainer.java,v >retrieving revision 1.5.2.8 >diff -u -r1.5.2.8 IUBundleContainer.java >--- src/org/eclipse/pde/internal/core/target/IUBundleContainer.java 16 Dec 2009 15:56:59 -0000 1.5.2.8 >+++ src/org/eclipse/pde/internal/core/target/IUBundleContainer.java 21 Dec 2009 16:45:04 -0000 >@@ -369,8 +369,9 @@ > return new IResolvedBundle[0]; > } > >- ArrayList operands = new ArrayList(queryResult.size()); >- Iterator itor = queryResult.iterator(); >+ Set querySet = queryResult.unmodifiableSet(); >+ ArrayList operands = new ArrayList(querySet.size()); >+ Iterator itor = querySet.iterator(); > while (itor.hasNext()) { > operands.add(new InstallableUnitOperand(null, (IInstallableUnit) itor.next())); > } >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java,v >retrieving revision 1.16.2.10 >diff -u -r1.16.2.10 RuntimeInstallJob.java >--- src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java 16 Dec 2009 15:56:59 -0000 1.16.2.10 >+++ src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java 21 Dec 2009 16:45:05 -0000 >@@ -126,7 +126,7 @@ > // Check if the right version exists in the new meta repo > Version newVersion = Version.parseVersion(version); > IQueryResult queryMatches = metaRepo.query(new InstallableUnitQuery(id, newVersion), monitor); >- if (queryMatches.size() == 0) { >+ if (queryMatches.isEmpty()) { > return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), NLS.bind(PDEUIMessages.RuntimeInstallJob_ErrorCouldNotFindUnitInRepo, new String[] {id, version})); > } > >@@ -134,7 +134,7 @@ > > // Find out if the profile already has that iu installed > queryMatches = profile.query(new InstallableUnitQuery(id), new SubProgressMonitor(monitor, 0)); >- if (queryMatches.size() == 0) { >+ if (queryMatches.isEmpty()) { > // Just install the new iu into the profile > toInstall.add(iuToInstall); > } else {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 292691
:
152095
|
152205
|
152362
|
152365
|
152504
|
152544
|
152984
|
152986
|
153141
|
153282
|
153349
|
153895
|
153988
|
154541
|
154542
|
154883
|
155120
|
155154
|
155466
|
155547
|
155813
|
155814
|
155879
|
155912
|
155913
|
155979