Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2011-06-28 21:06:41 -0400
committerPascal Rapicault2011-06-28 21:06:41 -0400
commita8d6e37f63cc02019f45617749e042019abf2626 (patch)
treefdfb3c424c6ca4739f5906e2bb6028ce30c74522
parentefe861669515b887e58660a129680c4feb4f2998 (diff)
downloadrt.equinox.p2-a8d6e37f63cc02019f45617749e042019abf2626.tar.gz
rt.equinox.p2-a8d6e37f63cc02019f45617749e042019abf2626.tar.xz
rt.equinox.p2-a8d6e37f63cc02019f45617749e042019abf2626.zip
Bug 350380 - Java package can't install because of dependency on m2e
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/QueryableArray.java9
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SurrogateProfileHandler.java6
2 files changed, 11 insertions, 4 deletions
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 2c8ba97d5..575496d5f 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
@@ -16,8 +16,7 @@ import java.util.List;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
import org.eclipse.equinox.internal.p2.metadata.TranslationSupport;
-import org.eclipse.equinox.internal.p2.metadata.index.CapabilityIndex;
-import org.eclipse.equinox.internal.p2.metadata.index.IndexProvider;
+import org.eclipse.equinox.internal.p2.metadata.index.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.KeyWithLocale;
import org.eclipse.equinox.p2.metadata.index.IIndex;
@@ -25,6 +24,7 @@ import org.eclipse.equinox.p2.metadata.index.IIndex;
public class QueryableArray extends IndexProvider<IInstallableUnit> {
private final List<IInstallableUnit> dataSet;
private IIndex<IInstallableUnit> capabilityIndex;
+ private IIndex<IInstallableUnit> idIndex;
private TranslationSupport translationSupport;
public QueryableArray(IInstallableUnit[] ius) {
@@ -41,6 +41,11 @@ public class QueryableArray extends IndexProvider<IInstallableUnit> {
capabilityIndex = new CapabilityIndex(dataSet.iterator());
return capabilityIndex;
}
+ if (InstallableUnit.MEMBER_ID.equals(memberName)) {
+ if (idIndex == null)
+ idIndex = new IdIndex(dataSet.iterator());
+ return idIndex;
+ }
return 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 37ab89e44..bc83ea9a5 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,8 @@ import org.eclipse.equinox.p2.engine.query.IUProfilePropertyQuery;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription;
+import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil;
+import org.eclipse.equinox.p2.metadata.expression.IMatchExpression;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.util.NLS;
@@ -82,8 +84,8 @@ public class SurrogateProfileHandler implements ISurrogateProfileHandler {
IQueryResult<IInstallableUnit> allIUs = sharedProfile.query(QueryUtil.createIUAnyQuery(), null);
for (Iterator<IInstallableUnit> iterator = allIUs.iterator(); iterator.hasNext();) {
IInstallableUnit iu = iterator.next();
- IRequirement iuRequirement = MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), new VersionRange(iu.getVersion(), true, iu.getVersion(), true), null, false, false, true);
- iuRequirements.add(iuRequirement);
+ IMatchExpression<IInstallableUnit> iuMatcher = ExpressionUtil.getFactory().<IInstallableUnit> matchExpression(ExpressionUtil.parse("id == $0 && version == $1"), iu.getId(), iu.getVersion()); //$NON-NLS-1$
+ iuRequirements.add(MetadataFactory.createRequirement(iuMatcher, null, 0, 1, true));
}
iuDescription.addRequirements(iuRequirements);
iuDescription.setProperty(IInstallableUnit.PROP_NAME, NLS.bind(Messages.Shared_Profile, null));

Back to the top