Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 292691 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/build/publisher/compatibility/RootFileParentAction.java (-6 / +6 lines)
Lines 10-23 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.pde.internal.build.publisher.compatibility;
11
package org.eclipse.pde.internal.build.publisher.compatibility;
12
12
13
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
14
15
import org.eclipse.core.runtime.*;
13
import org.eclipse.core.runtime.*;
16
import org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile;
14
import org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile;
17
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
15
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory;
16
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
18
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
17
import org.eclipse.equinox.internal.provisional.p2.metadata.MetadataFactory.InstallableUnitDescription;
19
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.query.MatchQuery;
18
import org.eclipse.equinox.internal.provisional.p2.metadata.query.MatchQuery;
19
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
20
import org.eclipse.equinox.p2.metadata.query.IQueryResult;
21
import org.eclipse.equinox.p2.publisher.*;
21
import org.eclipse.equinox.p2.publisher.*;
22
import org.eclipse.equinox.p2.publisher.actions.RootFilesAction;
22
import org.eclipse.equinox.p2.publisher.actions.RootFilesAction;
23
import org.eclipse.pde.internal.build.IPDEBuildConstants;
23
import org.eclipse.pde.internal.build.IPDEBuildConstants;
Lines 54-61 Link Here
54
			}
54
			}
55
		};
55
		};
56
56
57
		Collector collector = query.perform(results.getIUs(null, IPublisherResult.NON_ROOT).iterator(), new Collector());
57
		IQueryResult collector = query.perform(results.getIUs(null, IPublisherResult.NON_ROOT).iterator());
58
		InstallableUnitDescription descriptor = createParentIU(collector.toCollection(), RootFilesAction.computeIUId(baseId, flavor), Version.parseVersion(version));
58
		InstallableUnitDescription descriptor = createParentIU(collector.unmodifiableSet(), RootFilesAction.computeIUId(baseId, flavor), Version.parseVersion(version));
59
		descriptor.setSingleton(true);
59
		descriptor.setSingleton(true);
60
		IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor);
60
		IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor);
61
		results.addIU(rootIU, IPublisherResult.ROOT);
61
		results.addIU(rootIU, IPublisherResult.ROOT);
(-)src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java (-2 / +2 lines)
Lines 156-165 Link Here
156
		IQueryResult queryResult = repository.query(new InstallableUnitQuery(name), null);
156
		IQueryResult queryResult = repository.query(new InstallableUnitQuery(name), null);
157
157
158
		IInstallableUnit unit = null;
158
		IInstallableUnit unit = null;
159
		if (queryResult.size() > 0)
159
		if (!queryResult.isEmpty())
160
			unit = (IInstallableUnit) queryResult.iterator().next();
160
			unit = (IInstallableUnit) queryResult.iterator().next();
161
		if (assertNotNull) {
161
		if (assertNotNull) {
162
			assertEquals(queryResult.size(), 1);
162
			assertEquals(queryResult.unmodifiableSet().size(), 1);
163
			assertNotNull(unit);
163
			assertNotNull(unit);
164
		}
164
		}
165
		return unit;
165
		return unit;
(-)src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java (-1 / +1 lines)
Lines 1322-1328 Link Here
1322
		URI repoURI = URIUtil.fromString("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
1322
		URI repoURI = URIUtil.fromString("file:" + buildFolder.getFolder("buildRepo").getLocation().toOSString());
1323
		IMetadataRepository metadata = loadMetadataRepository(repoURI);
1323
		IMetadataRepository metadata = loadMetadataRepository(repoURI);
1324
		IQueryResult queryResult = metadata.query(new InstallableUnitQuery("a"), null);
1324
		IQueryResult queryResult = metadata.query(new InstallableUnitQuery("a"), null);
1325
		assertTrue(queryResult.size() == 0);
1325
		assertTrue(queryResult.isEmpty());
1326
		getIU(metadata, "b");
1326
		getIU(metadata, "b");
1327
	}
1327
	}
1328
1328
(-)src/org/eclipse/pde/internal/core/target/IUBundleContainer.java (-2 / +3 lines)
Lines 369-376 Link Here
369
			return new IResolvedBundle[0];
369
			return new IResolvedBundle[0];
370
		}
370
		}
371
371
372
		ArrayList operands = new ArrayList(queryResult.size());
372
		Set querySet = queryResult.unmodifiableSet();
373
		Iterator itor = queryResult.iterator();
373
		ArrayList operands = new ArrayList(querySet.size());
374
		Iterator itor = querySet.iterator();
374
		while (itor.hasNext()) {
375
		while (itor.hasNext()) {
375
			operands.add(new InstallableUnitOperand(null, (IInstallableUnit) itor.next()));
376
			operands.add(new InstallableUnitOperand(null, (IInstallableUnit) itor.next()));
376
		}
377
		}
(-)src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java (-2 / +2 lines)
Lines 126-132 Link Here
126
				// Check if the right version exists in the new meta repo
126
				// Check if the right version exists in the new meta repo
127
				Version newVersion = Version.parseVersion(version);
127
				Version newVersion = Version.parseVersion(version);
128
				IQueryResult queryMatches = metaRepo.query(new InstallableUnitQuery(id, newVersion), monitor);
128
				IQueryResult queryMatches = metaRepo.query(new InstallableUnitQuery(id, newVersion), monitor);
129
				if (queryMatches.size() == 0) {
129
				if (queryMatches.isEmpty()) {
130
					return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), NLS.bind(PDEUIMessages.RuntimeInstallJob_ErrorCouldNotFindUnitInRepo, new String[] {id, version}));
130
					return new Status(IStatus.ERROR, PDEPlugin.getPluginId(), NLS.bind(PDEUIMessages.RuntimeInstallJob_ErrorCouldNotFindUnitInRepo, new String[] {id, version}));
131
				}
131
				}
132
132
Lines 134-140 Link Here
134
134
135
				// Find out if the profile already has that iu installed												
135
				// Find out if the profile already has that iu installed												
136
				queryMatches = profile.query(new InstallableUnitQuery(id), new SubProgressMonitor(monitor, 0));
136
				queryMatches = profile.query(new InstallableUnitQuery(id), new SubProgressMonitor(monitor, 0));
137
				if (queryMatches.size() == 0) {
137
				if (queryMatches.isEmpty()) {
138
					// Just install the new iu into the profile
138
					// Just install the new iu into the profile
139
					toInstall.add(iuToInstall);
139
					toInstall.add(iuToInstall);
140
				} else {
140
				} else {

Return to bug 292691