summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2013-05-07 21:01:22 (EDT)
committerPascal Rapicault2013-05-08 14:39:17 (EDT)
commit2934a647ab3c869f90743550b71ad92894e839f6 (patch)
tree7f0cfc8bd02923dc65efcce4d99e458692ae9289
parentf047342611e6140ad5654c00ebc6a10cdb668575 (diff)
downloadrt.equinox.p2-2934a647ab3c869f90743550b71ad92894e839f6.zip
rt.equinox.p2-2934a647ab3c869f90743550b71ad92894e839f6.tar.gz
rt.equinox.p2-2934a647ab3c869f90743550b71ad92894e839f6.tar.bz2
bug 395188 - Consume new SAT4J
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/UserDefinedOptimizationFunction.java6
2 files changed, 4 insertions, 7 deletions
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 092b710..d1b15eb 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
@@ -215,7 +215,7 @@ public class Projector {
((UserFriendlyPBStringSolver<Object>) solver).setMapping(dependencyHelper.getMappingToDomain());
} else {
if (userDefinedFunction)
- dependencyHelper = new LexicoHelper<Object, Explanation>(solver);
+ dependencyHelper = new SteppedTimeoutLexicoHelper<Object, Explanation>(solver);
else
dependencyHelper = new DependencyHelper<Object, Explanation>(solver);
}
@@ -1013,9 +1013,6 @@ public class Projector {
private void backToIU() {
solution = new ArrayList<IInstallableUnit>();
- // TODO WORK AROUND BECAUE OF A BUG IN SAT4J
- if (!userDefinedFunction)
- dependencyHelper.getSolutionCost();
IVec<Object> sat4jSolution = dependencyHelper.getSolution();
for (Iterator<Object> iter = sat4jSolution.iterator(); iter.hasNext();) {
Object var = iter.next();
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/UserDefinedOptimizationFunction.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/UserDefinedOptimizationFunction.java
index 65da7b0..7690ba3 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/UserDefinedOptimizationFunction.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/UserDefinedOptimizationFunction.java
@@ -20,14 +20,14 @@ import org.sat4j.specs.ContradictionException;
public class UserDefinedOptimizationFunction extends OptimizationFunction {
private Collection<IInstallableUnit> alreadyExistingRoots;
- private LexicoHelper<Object, Explanation> dependencyHelper;
+ private SteppedTimeoutLexicoHelper<Object, Explanation> dependencyHelper;
private IQueryable<IInstallableUnit> picker;
public UserDefinedOptimizationFunction(IQueryable<IInstallableUnit> lastState, List<AbstractVariable> abstractVariables, List<AbstractVariable> optionalVariables, IQueryable<IInstallableUnit> picker, IInstallableUnit selectionContext, Map<String, Map<Version, IInstallableUnit>> slice, DependencyHelper<Object, Explanation> dependencyHelper, Collection<IInstallableUnit> alreadyInstalledIUs) {
super(lastState, abstractVariables, optionalVariables, picker, selectionContext, slice);
this.picker = picker;
this.slice = slice;
- this.dependencyHelper = (LexicoHelper<Object, Explanation>) dependencyHelper;
+ this.dependencyHelper = (SteppedTimeoutLexicoHelper<Object, Explanation>) dependencyHelper;
this.alreadyExistingRoots = alreadyInstalledIUs;
}
@@ -35,7 +35,7 @@ public class UserDefinedOptimizationFunction extends OptimizationFunction {
List<WeightedObject<?>> weightedObjects = new ArrayList<WeightedObject<?>>();
List<Object> objects = new ArrayList<Object>();
BigInteger weight = BigInteger.valueOf(slice.size() + 1);
- String[] criteria = new String[] {"+new", "-changed", "-notuptodate", "-removed"}; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
+ String[] criteria = new String[] {"+new", "-notuptodate", "-changed", "-removed"}; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
BigInteger currentWeight = weight.pow(criteria.length - 1);
boolean maximizes;
Object thing;