Added fixes for problems detected during MISC 2011. Release 1.14.
diff --git a/org.eclipse.equinox.p2.cudf/pom.xml b/org.eclipse.equinox.p2.cudf/pom.xml
index 293ac5b..d463afe 100644
--- a/org.eclipse.equinox.p2.cudf/pom.xml
+++ b/org.eclipse.equinox.p2.cudf/pom.xml
@@ -52,7 +52,7 @@
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.p2.cudf</artifactId>
- <version>1.11-SNAPSHOT</version>
+ <version>1.14-SNAPSHOT</version>
<organization>
diff --git a/org.eclipse.equinox.p2.cudf/src/main/java/org/eclipse/equinox/p2/cudf/Main.java b/org.eclipse.equinox.p2.cudf/src/main/java/org/eclipse/equinox/p2/cudf/Main.java
index ffdab99..b5e3463 100644
--- a/org.eclipse.equinox.p2.cudf/src/main/java/org/eclipse/equinox/p2/cudf/Main.java
+++ b/org.eclipse.equinox.p2.cudf/src/main/java/org/eclipse/equinox/p2/cudf/Main.java
@@ -61,11 +61,14 @@
long end = System.currentTimeMillis();
Log.println(("Solving done (" + (end - begin) / 1000.0 + "s)."));
Collection col = planner.getBestSolutionFoundSoFar();
- if (col.isEmpty()) {
+ if (col == null) {
printFail("Cannot find a solution");
if (options.explain) {
out.println(planner.getExplanation());
}
+ } else if (col.isEmpty()) {
+ System.out.println("# There is nothing to install ????");
+ out.println("# There is nothing to install ....");
} else {
if (planner.isSolutionOptimal()) {
System.out.println("# The solution found IS optimal");
diff --git a/org.eclipse.equinox.p2.cudf/src/main/java/org/eclipse/equinox/p2/cudf/solver/Projector.java b/org.eclipse.equinox.p2.cudf/src/main/java/org/eclipse/equinox/p2/cudf/solver/Projector.java
index e3c235e..c87facc 100644
--- a/org.eclipse.equinox.p2.cudf/src/main/java/org/eclipse/equinox/p2/cudf/solver/Projector.java
+++ b/org.eclipse.equinox.p2.cudf/src/main/java/org/eclipse/equinox/p2/cudf/solver/Projector.java
@@ -112,6 +112,8 @@
PBSolverResolution mysolver = SolverFactory.newCompetPBResLongWLMixedConstraintsObjectiveExpSimp();
mysolver.setSimplifier(mysolver.SIMPLE_SIMPLIFICATION);
mysolver.setRestartStrategy(new LubyRestarts(512));
+ // mysolver.setLearnedConstraintsDeletionStrategy(mysolver.memory_based);
+ // mysolver.setSearchListener(new DecisionTracing("/tmp/rand992.dat"));
solver = mysolver; // SolverFactory.newResolutionGlucoseSimpleSimp();// SolverFactory.newEclipseP2();
}
if ("default".equals(configuration.timeout)) {
@@ -160,8 +162,14 @@
}
} catch (IllegalStateException e) {
result.add(new Status(IStatus.ERROR, Main.PLUGIN_ID, e.getMessage(), e));
+ if (configuration.verbose) {
+ Log.println("*** PBM *** " + e.getMessage());
+ }
} catch (ContradictionException e) {
result.add(new Status(IStatus.ERROR, Main.PLUGIN_ID, Messages.Planner_Unsatisfiable_problem));
+ if (configuration.verbose) {
+ Log.println("Unsat OPB problem ");
+ }
}
}
@@ -417,16 +425,23 @@
}
} catch (TimeoutException e) {
result.merge(new Status(IStatus.ERROR, Main.PLUGIN_ID, Messages.Planner_Timeout));
+ if (configuration.verbose) {
+ Log.println("Timeout reached");
+ }
} catch (Exception e) {
result.merge(new Status(IStatus.ERROR, Main.PLUGIN_ID, Messages.Planner_Unexpected_problem, e));
+ if (configuration.verbose) {
+ Log.println("*** PBM *** " + e.getMessage());
+ }
}
return result;
}
private void backToIU() {
- solution = new ArrayList();
+ solution = null;
if (!isSatisfiable)
return;
+ solution = new ArrayList();
IVec sat4jSolution = dependencyHelper.getSolution();
if (sat4jSolution.isEmpty())
return;
@@ -494,6 +509,8 @@
if (solution == null) {
backToIU();
}
+ if (solution == null)
+ return null;
return extractSolution();
}
}
\ No newline at end of file