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/GatherFeatureAction.java (-8 / +7 lines)
Lines 8-20 Link Here
8
 ******************************************************************************/
8
 ******************************************************************************/
9
package org.eclipse.pde.internal.build.publisher;
9
package org.eclipse.pde.internal.build.publisher;
10
10
11
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
12
13
import org.eclipse.equinox.p2.metadata.IArtifactKey;
14
15
import java.io.File;
11
import java.io.File;
12
import java.util.List;
16
import org.eclipse.equinox.internal.p2.publisher.eclipse.FeatureParser;
13
import org.eclipse.equinox.internal.p2.publisher.eclipse.FeatureParser;
17
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
14
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
15
import org.eclipse.equinox.p2.metadata.IArtifactKey;
16
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
18
import org.eclipse.equinox.p2.publisher.IPublisherInfo;
17
import org.eclipse.equinox.p2.publisher.IPublisherInfo;
19
import org.eclipse.equinox.p2.publisher.eclipse.Feature;
18
import org.eclipse.equinox.p2.publisher.eclipse.Feature;
20
import org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction;
19
import org.eclipse.equinox.p2.publisher.eclipse.FeaturesAction;
Lines 99-110 Link Here
99
			return;
98
			return;
100
99
101
		// add all the artifacts associated with the feature
100
		// add all the artifacts associated with the feature
102
		IArtifactKey[] artifacts = featureIU.getArtifacts();
101
		List artifacts = featureIU.getArtifacts();
103
		if (artifacts.length > 1) {
102
		if (artifacts.size() > 1) {
104
			//boo!
103
			//boo!
105
		}
104
		}
106
105
107
		ArtifactDescriptor ad = (ArtifactDescriptor) PublisherHelper.createArtifactDescriptor(publisherInfo.getArtifactRepository(), artifacts[0], null);
106
		ArtifactDescriptor ad = (ArtifactDescriptor) PublisherHelper.createArtifactDescriptor(publisherInfo.getArtifactRepository(), (IArtifactKey) artifacts.get(0), null);
108
		processArtifactPropertiesAdvice(featureIU, ad, publisherInfo);
107
		processArtifactPropertiesAdvice(featureIU, ad, publisherInfo);
109
		ad.setProperty(IArtifactDescriptor.DOWNLOAD_CONTENTTYPE, IArtifactDescriptor.TYPE_ZIP);
108
		ad.setProperty(IArtifactDescriptor.DOWNLOAD_CONTENTTYPE, IArtifactDescriptor.TYPE_ZIP);
110
109
(-)src/org/eclipse/pde/internal/build/publisher/compatibility/AssembledConfigAdvice.java (-5 / +8 lines)
Lines 11-17 Link Here
11
package org.eclipse.pde.internal.build.publisher.compatibility;
11
package org.eclipse.pde.internal.build.publisher.compatibility;
12
12
13
import java.io.File;
13
import java.io.File;
14
import java.util.Properties;
14
import java.util.*;
15
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
15
import org.eclipse.equinox.internal.p2.publisher.eclipse.DataLoader;
16
import org.eclipse.equinox.internal.p2.publisher.eclipse.DataLoader;
16
import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
17
import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
17
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
18
import org.eclipse.equinox.internal.provisional.p2.metadata.Version;
Lines 35-46 Link Here
35
		return configData.getBundles();
36
		return configData.getBundles();
36
	}
37
	}
37
38
38
	public Properties getProperties() {
39
	public Map getProperties() {
39
		Properties properties = configData.getProperties();
40
		Properties configProps = configData.getProperties();
41
		Map props = new HashMap(configProps.size() + 1);
42
		CollectionUtils.putAll(configProps, props);
40
		int startLevel = configData.getInitialBundleStartLevel();
43
		int startLevel = configData.getInitialBundleStartLevel();
41
		if (startLevel != BundleInfo.NO_LEVEL)
44
		if (startLevel != BundleInfo.NO_LEVEL)
42
			properties.put("osgi.bundles.defaultStartLevel", String.valueOf(startLevel)); //$NON-NLS-1$
45
			props.put("osgi.bundles.defaultStartLevel", String.valueOf(startLevel)); //$NON-NLS-1$
43
		return properties;
46
		return props;
44
	}
47
	}
45
48
46
	public boolean isApplicable(String spec, boolean includeDefault, String id, Version version) {
49
	public boolean isApplicable(String spec, boolean includeDefault, String id, Version version) {
(-)src_ant/org/eclipse/pde/internal/build/publisher/BrandP2Task.java (-11 / +12 lines)
Lines 212-220 Link Here
212
		newIUDescription.setTouchpointType(originalIU.getTouchpointType());
212
		newIUDescription.setTouchpointType(originalIU.getTouchpointType());
213
		newIUDescription.setFilter(originalIU.getFilter() == null ? null : ((LDAPQuery) originalIU.getFilter()).getFilter());
213
		newIUDescription.setFilter(originalIU.getFilter() == null ? null : ((LDAPQuery) originalIU.getFilter()).getFilter());
214
214
215
		ITouchpointData[] data = brandTouchpointData(originalIU.getTouchpointData());
215
		List data = brandTouchpointData(originalIU.getTouchpointData());
216
		for (int i = 0; i < data.length; i++) {
216
		for (int i = 0; i < data.size(); i++) {
217
			newIUDescription.addTouchpointData(data[i]);
217
			newIUDescription.addTouchpointData((ITouchpointData) data.get(i));
218
		}
218
		}
219
219
220
		IArtifactKey key = new ArtifactKey(PublisherHelper.BINARY_ARTIFACT_CLASSIFIER, newIUDescription.getId(), newIUDescription.getVersion());
220
		IArtifactKey key = new ArtifactKey(PublisherHelper.BINARY_ARTIFACT_CLASSIFIER, newIUDescription.getId(), newIUDescription.getVersion());
Lines 250-256 Link Here
250
	private static final String INSTALL = "install"; //$NON-NLS-1$
250
	private static final String INSTALL = "install"; //$NON-NLS-1$
251
	private static final String CONFIGURE = "configure"; //$NON-NLS-1$
251
	private static final String CONFIGURE = "configure"; //$NON-NLS-1$
252
252
253
	private ITouchpointData[] brandTouchpointData(ITouchpointData[] data) {
253
	private List/*<ITouchpointData>*/brandTouchpointData(List/*<ITouchpointData>*/data) {
254
		boolean haveChmod = false;
254
		boolean haveChmod = false;
255
255
256
		String brandedLauncher = null;
256
		String brandedLauncher = null;
Lines 261-272 Link Here
261
		else
261
		else
262
			brandedLauncher = launcherName;
262
			brandedLauncher = launcherName;
263
263
264
		for (int i = 0; i < data.length; i++) {
264
		for (int i = 0; i < data.size(); i++) {
265
			Map instructions = new HashMap(data[i].getInstructions());
265
			ITouchpointData td = (ITouchpointData) data.get(i);
266
			Map instructions = new HashMap(td.getInstructions());
266
267
267
			String[] phases = new String[] {INSTALL, CONFIGURE};
268
			String[] phases = new String[] {INSTALL, CONFIGURE};
268
			for (int phase = 0; phase < phases.length; phase++) {
269
			for (int phase = 0; phase < phases.length; phase++) {
269
				ITouchpointInstruction instruction = data[i].getInstruction(phases[phase]);
270
				ITouchpointInstruction instruction = td.getInstruction(phases[phase]);
270
				if (instruction == null)
271
				if (instruction == null)
271
					continue;
272
					continue;
272
273
Lines 310-316 Link Here
310
				}
311
				}
311
			}
312
			}
312
313
313
			data[i] = new TouchpointData(instructions);
314
			data.set(i, new TouchpointData(instructions));
314
		}
315
		}
315
316
316
		//add a chmod if there wasn't one before
317
		//add a chmod if there wasn't one before
Lines 319-328 Link Here
319
			TouchpointInstruction newInstruction = new TouchpointInstruction(body, null);
320
			TouchpointInstruction newInstruction = new TouchpointInstruction(body, null);
320
			Map instructions = new HashMap();
321
			Map instructions = new HashMap();
321
			instructions.put(INSTALL, newInstruction);
322
			instructions.put(INSTALL, newInstruction);
322
			ArrayList newData = new ArrayList(data.length + 1);
323
			ArrayList newData = new ArrayList(data.size() + 1);
323
			newData.addAll(Arrays.asList(data));
324
			newData.addAll(data);
324
			newData.add(new TouchpointData(instructions));
325
			newData.add(new TouchpointData(instructions));
325
			data = (ITouchpointData[]) newData.toArray(new ITouchpointData[newData.size()]);
326
			data = newData;
326
		}
327
		}
327
		return data;
328
		return data;
328
	}
329
	}
(-)src/org/eclipse/pde/build/internal/tests/p2/P2TestCase.java (-13 / +15 lines)
Lines 21-27 Link Here
21
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.*;
22
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
22
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
23
import org.eclipse.equinox.p2.internal.repository.tools.RepositoryUtilities;
23
import org.eclipse.equinox.p2.internal.repository.tools.RepositoryUtilities;
24
import org.eclipse.equinox.p2.metadata.*;
24
import org.eclipse.equinox.p2.metadata.IArtifactKey;
25
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
25
import org.eclipse.equinox.p2.metadata.query.IQueryResult;
26
import org.eclipse.equinox.p2.metadata.query.IQueryResult;
26
import org.eclipse.equinox.p2.repository.artifact.*;
27
import org.eclipse.equinox.p2.repository.artifact.*;
27
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
28
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
Lines 176-184 Link Here
176
	}
177
	}
177
178
178
	public void assertTouchpoint(IInstallableUnit iu, String phase, String action) {
179
	public void assertTouchpoint(IInstallableUnit iu, String phase, String action) {
179
		ITouchpointData[] data = iu.getTouchpointData();
180
		List/*<ITouchpointData>*/data = iu.getTouchpointData();
180
		for (int i = 0; i < data.length; i++) {
181
		for (int i = 0; i < data.size(); i++) {
181
			ITouchpointInstruction instruction = data[i].getInstruction(phase);
182
			ITouchpointInstruction instruction = ((ITouchpointData) data.get(i)).getInstruction(phase);
182
			if (instruction != null && instruction.getBody().indexOf(action) > -1)
183
			if (instruction != null && instruction.getBody().indexOf(action) > -1)
183
				return;
184
				return;
184
		}
185
		}
Lines 186-194 Link Here
186
	}
187
	}
187
188
188
	public void assertProvides(IInstallableUnit iu, String namespace, String name) {
189
	public void assertProvides(IInstallableUnit iu, String namespace, String name) {
189
		IProvidedCapability[] caps = iu.getProvidedCapabilities();
190
		List/*<IProvidedCapability>*/caps = iu.getProvidedCapabilities();
190
		for (int i = 0; i < caps.length; i++) {
191
		for (int i = 0; i < caps.size(); i++) {
191
			if (caps[i].getNamespace().equals(namespace) && caps[i].getName().equals(name))
192
			IProvidedCapability cap = (IProvidedCapability) caps.get(i);
193
			if (cap.getNamespace().equals(namespace) && cap.getName().equals(name))
192
				return;
194
				return;
193
195
194
		}
196
		}
Lines 196-204 Link Here
196
	}
198
	}
197
199
198
	public void assertRequires(IInstallableUnit iu, String namespace, String name) {
200
	public void assertRequires(IInstallableUnit iu, String namespace, String name) {
199
		IRequirement[] reqs = iu.getRequiredCapabilities();
201
		List/*<IRequirement>*/reqs = iu.getRequiredCapabilities();
200
		for (int i = 0; i < reqs.length; i++) {
202
		for (int i = 0; i < reqs.size(); i++) {
201
			IRequiredCapability reqCap = (IRequiredCapability) reqs[i];
203
			IRequiredCapability reqCap = (IRequiredCapability) reqs.get(i);
202
			if (reqCap.getNamespace().equals(namespace) && reqCap.getName().equals(name))
204
			if (reqCap.getNamespace().equals(namespace) && reqCap.getName().equals(name))
203
				return;
205
				return;
204
206
Lines 210-218 Link Here
210
		outer: for (Iterator iterator = requiredIUs.iterator(); iterator.hasNext();) {
212
		outer: for (Iterator iterator = requiredIUs.iterator(); iterator.hasNext();) {
211
			IInstallableUnit reqIU = (IInstallableUnit) iterator.next();
213
			IInstallableUnit reqIU = (IInstallableUnit) iterator.next();
212
214
213
			IRequirement[] reqs = iu.getRequiredCapabilities();
215
			List/*<IRequirement>*/reqs = iu.getRequiredCapabilities();
214
			for (int i = 0; i < reqs.length; i++) {
216
			for (int i = 0; i < reqs.size(); i++) {
215
				IRequiredCapability reqCap = (IRequiredCapability) reqs[i];
217
				IRequiredCapability reqCap = (IRequiredCapability) reqs.get(i);
216
				if (reqCap.getNamespace().equals(IU_NAMESPACE) && reqCap.getName().equals(reqIU.getId()) && reqCap.getRange().isIncluded(reqIU.getVersion())) {
218
				if (reqCap.getNamespace().equals(IU_NAMESPACE) && reqCap.getName().equals(reqIU.getId()) && reqCap.getRange().isIncluded(reqIU.getVersion())) {
217
					iterator.remove();
219
					iterator.remove();
218
					continue outer;
220
					continue outer;
(-)src/org/eclipse/pde/build/internal/tests/p2/PublishingTests.java (-9 / +8 lines)
Lines 26-32 Link Here
26
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
26
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
27
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
27
import org.eclipse.equinox.internal.provisional.p2.metadata.query.InstallableUnitQuery;
28
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
28
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
29
import org.eclipse.equinox.p2.metadata.IRequirement;
30
import org.eclipse.equinox.p2.metadata.query.IQueryResult;
29
import org.eclipse.equinox.p2.metadata.query.IQueryResult;
31
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
30
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
32
import org.eclipse.osgi.util.ManifestElement;
31
import org.eclipse.osgi.util.ManifestElement;
Lines 1586-1597 Link Here
1586
		assertEquals(iu.getVersion().toString(), "1.0.0");
1585
		assertEquals(iu.getVersion().toString(), "1.0.0");
1587
1586
1588
		IInstallableUnit common = getIU(repo, EQUINOX_COMMON);
1587
		IInstallableUnit common = getIU(repo, EQUINOX_COMMON);
1589
		IRequirement[] required = iu.getRequiredCapabilities();
1588
		List/*<IRequirement>*/required = iu.getRequiredCapabilities();
1590
		assertEquals(required.length, 2);
1589
		assertEquals(required.size(), 2);
1591
		if (((IRequiredCapability) required[0]).getName().equals(EQUINOX_COMMON))
1590
		if (((IRequiredCapability) required.get(0)).getName().equals(EQUINOX_COMMON))
1592
			assertEquals(((IRequiredCapability) required[0]).getRange(), new VersionRange(common.getVersion(), true, Version.MAX_VERSION, true));
1591
			assertEquals(((IRequiredCapability) required.get(0)).getRange(), new VersionRange(common.getVersion(), true, Version.MAX_VERSION, true));
1593
		else
1592
		else
1594
			assertEquals(((IRequiredCapability) required[1]).getRange(), new VersionRange(common.getVersion(), true, Version.MAX_VERSION, true));
1593
			assertEquals(((IRequiredCapability) required.get(1)).getRange(), new VersionRange(common.getVersion(), true, Version.MAX_VERSION, true));
1595
	}
1594
	}
1596
1595
1597
	public void testPublish_P2InfConfigProperty() throws Exception {
1596
	public void testPublish_P2InfConfigProperty() throws Exception {
Lines 1802-1810 Link Here
1802
1801
1803
		IMetadataRepository repo = loadMetadataRepository(buildFolder.getFolder("buildRepo").getLocationURI());
1802
		IMetadataRepository repo = loadMetadataRepository(buildFolder.getFolder("buildRepo").getLocationURI());
1804
		IInstallableUnit iu = getIU(repo, "foo");
1803
		IInstallableUnit iu = getIU(repo, "foo");
1805
		IRequirement[] required = iu.getRequiredCapabilities();
1804
		List/*<IRequirement>*/required = iu.getRequiredCapabilities();
1806
		for (int i = 0; i < required.length; i++) {
1805
		for (int i = 0; i < required.size(); i++) {
1807
			IRequiredCapability reqCap = (IRequiredCapability) required[i];
1806
			IRequiredCapability reqCap = (IRequiredCapability) required.get(i);
1808
			if (reqCap.getName().equals("a")) {
1807
			if (reqCap.getName().equals("a")) {
1809
				VersionRange range = reqCap.getRange();
1808
				VersionRange range = reqCap.getRange();
1810
				assertTrue(Version.toOSGiVersion(range.getMinimum()).getQualifier().startsWith("20"));
1809
				assertTrue(Version.toOSGiVersion(range.getMinimum()).getQualifier().startsWith("20"));
(-)src/org/eclipse/pde/internal/core/target/IUBundleContainer.java (-11 / +12 lines)
Lines 259-267 Link Here
259
		Iterator iterator = queryResult.iterator();
259
		Iterator iterator = queryResult.iterator();
260
		while (iterator.hasNext()) {
260
		while (iterator.hasNext()) {
261
			IInstallableUnit unit = (IInstallableUnit) iterator.next();
261
			IInstallableUnit unit = (IInstallableUnit) iterator.next();
262
			IArtifactKey[] artifacts = unit.getArtifacts();
262
			List/*<IArtifactKey*/artifacts = unit.getArtifacts();
263
			for (int i = 0; i < artifacts.length; i++) {
263
			for (int i = 0; i < artifacts.size(); i++) {
264
				IArtifactKey key = artifacts[i];
264
				IArtifactKey key = (IArtifactKey) artifacts.get(i);
265
				File file = repo.getArtifactFile(key);
265
				File file = repo.getArtifactFile(key);
266
				if (file == null) {
266
				if (file == null) {
267
					// TODO: missing bundle
267
					// TODO: missing bundle
Lines 337-351 Link Here
337
337
338
		IProgressMonitor loadMonitor = new SubProgressMonitor(subMonitor, 10);
338
		IProgressMonitor loadMonitor = new SubProgressMonitor(subMonitor, 10);
339
		loadMonitor.beginTask(null, repoCount * 10);
339
		loadMonitor.beginTask(null, repoCount * 10);
340
		IMetadataRepository[] metadataRepos = new IMetadataRepository[repoCount];
340
		List metadataRepos = new ArrayList(repoCount);
341
		IMetadataRepositoryManager manager = getRepoManager();
341
		IMetadataRepositoryManager manager = getRepoManager();
342
		for (int i = 0; i < repoCount; ++i)
342
		for (int i = 0; i < repoCount; ++i)
343
			metadataRepos[i] = manager.loadRepository(repositories[i], new SubProgressMonitor(loadMonitor, 10));
343
			metadataRepos.add(manager.loadRepository(repositories[i], new SubProgressMonitor(loadMonitor, 10)));
344
		loadMonitor.done();
344
		loadMonitor.done();
345
345
346
		IQueryable allMetadata;
346
		IQueryable allMetadata;
347
		if (repoCount == 1) {
347
		if (repoCount == 1) {
348
			allMetadata = metadataRepos[0];
348
			allMetadata = (IQueryable) metadataRepos.get(0);
349
		} else {
349
		} else {
350
			allMetadata = new CompoundQueryable(metadataRepos);
350
			allMetadata = new CompoundQueryable(metadataRepos);
351
		}
351
		}
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
		}
Lines 416-424 Link Here
416
		Iterator iterator = queryResult.iterator();
417
		Iterator iterator = queryResult.iterator();
417
		while (iterator.hasNext()) {
418
		while (iterator.hasNext()) {
418
			IInstallableUnit unit = (IInstallableUnit) iterator.next();
419
			IInstallableUnit unit = (IInstallableUnit) iterator.next();
419
			IArtifactKey[] artifacts = unit.getArtifacts();
420
			List/*<IArtifactKey>*/artifacts = unit.getArtifacts();
420
			for (int i = 0; i < artifacts.length; i++) {
421
			for (int i = 0; i < artifacts.size(); i++) {
421
				IArtifactKey key = artifacts[i];
422
				IArtifactKey key = (IArtifactKey) artifacts.get(i);
422
				File file = repo.getArtifactFile(key);
423
				File file = repo.getArtifactFile(key);
423
				if (file == null) {
424
				if (file == null) {
424
					// TODO: missing bundle
425
					// TODO: missing bundle
(-)src/org/eclipse/pde/internal/ui/build/RuntimeInstallJob.java (-8 / +8 lines)
Lines 126-145 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
133
				IInstallableUnit iuToInstall = (IInstallableUnit) queryMatches.toArray(IInstallableUnit.class)[0];
133
				IInstallableUnit iuToInstall = (IInstallableUnit) queryMatches.iterator().next();
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 {
141
					// There is an existing iu that we need to replace using an installable unit patch
141
					// There is an existing iu that we need to replace using an installable unit patch
142
					Version existingVersion = ((IInstallableUnit) queryMatches.toArray(IInstallableUnit.class)[0]).getVersion();
142
					Version existingVersion = ((IInstallableUnit) queryMatches.iterator().next()).getVersion();
143
					toInstall.add(createInstallableUnitPatch(id, newVersion, existingVersion, profile, monitor));
143
					toInstall.add(createInstallableUnitPatch(id, newVersion, existingVersion, profile, monitor));
144
				}
144
				}
145
				monitor.worked(2);
145
				monitor.worked(2);
Lines 204-212 Link Here
204
		IQueryResult queryMatches = profile.query(new MatchQuery() {
204
		IQueryResult queryMatches = profile.query(new MatchQuery() {
205
			public boolean isMatch(Object candidate) {
205
			public boolean isMatch(Object candidate) {
206
				if (candidate instanceof IInstallableUnit) {
206
				if (candidate instanceof IInstallableUnit) {
207
					IRequirement[] reqs = ((IInstallableUnit) candidate).getRequiredCapabilities();
207
					List/*<IRequirement>*/reqs = ((IInstallableUnit) candidate).getRequiredCapabilities();
208
					for (int i = 0; i < reqs.length; i++) {
208
					for (int i = 0; i < reqs.size(); i++) {
209
						IRequiredCapability reqCap = (IRequiredCapability) reqs[i];
209
						IRequiredCapability reqCap = (IRequiredCapability) reqs.get(i);
210
						if (reqCap.getName().equals(id)) {
210
						if (reqCap.getName().equals(id)) {
211
							if (new VersionRange(existingVersion, true, existingVersion, true).equals(reqCap.getRange())) {
211
							if (new VersionRange(existingVersion, true, existingVersion, true).equals(reqCap.getRange())) {
212
								return true;
212
								return true;
Lines 218-224 Link Here
218
			}
218
			}
219
		}, monitor);
219
		}, monitor);
220
		if (!queryMatches.isEmpty()) {
220
		if (!queryMatches.isEmpty()) {
221
			IInstallableUnit lifecycleUnit = (IInstallableUnit) queryMatches.toArray(IInstallableUnit.class)[0];
221
			IInstallableUnit lifecycleUnit = (IInstallableUnit) queryMatches.iterator().next();
222
			iuPatchDescription.setLifeCycle(MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, lifecycleUnit.getId(), new VersionRange(lifecycleUnit.getVersion(), true, lifecycleUnit.getVersion(), true), null, false, false, false));
222
			iuPatchDescription.setLifeCycle(MetadataFactory.createRequiredCapability(IInstallableUnit.NAMESPACE_IU_ID, lifecycleUnit.getId(), new VersionRange(lifecycleUnit.getVersion(), true, lifecycleUnit.getVersion(), true), null, false, false, false));
223
		}
223
		}
224
224
(-)src/org/eclipse/pde/internal/ui/shared/target/StyledBundleLabelProvider.java (-2 / +2 lines)
Lines 13-20 Link Here
13
import com.ibm.icu.text.MessageFormat;
13
import com.ibm.icu.text.MessageFormat;
14
import java.net.URI;
14
import java.net.URI;
15
import org.eclipse.core.runtime.*;
15
import org.eclipse.core.runtime.*;
16
import org.eclipse.equinox.internal.p2.metadata.TranslationSupport;
16
import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
17
import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
17
import org.eclipse.equinox.p2.common.TranslationSupport;
18
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
18
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
19
import org.eclipse.jface.resource.ImageDescriptor;
19
import org.eclipse.jface.resource.ImageDescriptor;
20
import org.eclipse.jface.viewers.*;
20
import org.eclipse.jface.viewers.*;
Lines 50-56 Link Here
50
		PDEPlugin.getDefault().getLabelProvider().connect(this);
50
		PDEPlugin.getDefault().getLabelProvider().connect(this);
51
		fShowVersion = showVersion;
51
		fShowVersion = showVersion;
52
		fAppendResolvedVariables = appendResolvedVariables;
52
		fAppendResolvedVariables = appendResolvedVariables;
53
		fTranslations = new TranslationSupport();
53
		fTranslations = TranslationSupport.getInstance();
54
	}
54
	}
55
55
56
	/* (non-Javadoc)
56
	/* (non-Javadoc)

Return to bug 292691