Commit 2e621c29 authored by Daniel Le Berre's avatar Daniel Le Berre

Fixing last sonarqube vulnerabilities.

parent 05702b6c
...@@ -33,7 +33,7 @@ import java.math.BigInteger; ...@@ -33,7 +33,7 @@ import java.math.BigInteger;
public final class ConflictMapSwitchToClause extends ConflictMap { public final class ConflictMapSwitchToClause extends ConflictMap {
public static int UpperBound; private static int upperBound;
public ConflictMapSwitchToClause(PBConstr cpb, int level) { public ConflictMapSwitchToClause(PBConstr cpb, int level) {
super(cpb, level); super(cpb, level);
...@@ -65,7 +65,7 @@ public final class ConflictMapSwitchToClause extends ConflictMap { ...@@ -65,7 +65,7 @@ public final class ConflictMapSwitchToClause extends ConflictMap {
bigCoef = bigCoef.add(this.weightedLits.get(wpb.get(i)) bigCoef = bigCoef.add(this.weightedLits.get(wpb.get(i))
.multiply(this.coefMult)); .multiply(this.coefMult));
} }
if (bigCoef.toString().length() > UpperBound) { if (bigCoef.toString().length() > upperBound) {
// if we deal with really big integers // if we deal with really big integers
// reducing the constraint to a clause // reducing the constraint to a clause
this.numberOfReductions++; this.numberOfReductions++;
...@@ -90,4 +90,12 @@ public final class ConflictMapSwitchToClause extends ConflictMap { ...@@ -90,4 +90,12 @@ public final class ConflictMapSwitchToClause extends ConflictMap {
return BigInteger.ONE; return BigInteger.ONE;
} }
public static int getUpperBound() {
return upperBound;
}
public static void setUpperBound(int upperBound) {
ConflictMapSwitchToClause.upperBound = upperBound;
}
} }
...@@ -46,13 +46,13 @@ public class PBSolverCautious extends PBSolverCP { ...@@ -46,13 +46,13 @@ public class PBSolverCautious extends PBSolverCP {
public PBSolverCautious(LearningStrategy<PBDataStructureFactory> learner, public PBSolverCautious(LearningStrategy<PBDataStructureFactory> learner,
PBDataStructureFactory dsf, IOrder order) { PBDataStructureFactory dsf, IOrder order) {
super(learner, dsf, order); super(learner, dsf, order);
ConflictMapSwitchToClause.UpperBound = BOUND; ConflictMapSwitchToClause.setUpperBound(BOUND);
} }
public PBSolverCautious(LearningStrategy<PBDataStructureFactory> learner, public PBSolverCautious(LearningStrategy<PBDataStructureFactory> learner,
PBDataStructureFactory dsf, IOrder order, int bound) { PBDataStructureFactory dsf, IOrder order, int bound) {
super(learner, dsf, order); super(learner, dsf, order);
ConflictMapSwitchToClause.UpperBound = bound; ConflictMapSwitchToClause.setUpperBound(bound);
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment