Commit 6183de1e authored by Daniel Le Berre's avatar Daniel Le Berre
Browse files

With Romain and Manu, a few more sonarqube violations

parent 517ce890
Pipeline #20145 canceled with stages
in 16 minutes and 1 second
......@@ -157,7 +157,7 @@ public class Solver<D extends DataStructureFactory>
private final IVecInt internalDimacsReusableVector = new VecInt();
protected SearchListener slistener = SearchListener.VOID;
protected SearchListener slistener = SearchListener.voidSearchListener();
private RestartStrategy restarter;
......
......@@ -137,7 +137,7 @@ public interface ISolverService {
*
* @return the constraints learned and kept so far by the solver.
*/
IVec<? extends IConstr> getLearnedConstraints();
IVec<Constr> getLearnedConstraints();
/**
* Read-Only access to the number of variables declared in the solver.
......
......@@ -46,13 +46,14 @@ import org.sat4j.annotations.Feature;
public interface SearchListener<S extends ISolverService>
extends UnitClauseConsumer, Serializable {
SearchListener<ISolverService> VOID = new SearchListener<>() {
/**
*
*/
private static final long serialVersionUID = 1L;
};
static <T extends ISolverService> SearchListener<T> voidSearchListener() {
return new SearchListener<>() {
/**
*
*/
private static final long serialVersionUID = 1L;
};
}
/**
* Provide access to the solver's controllable interface.
......
......@@ -36,6 +36,10 @@ import org.sat4j.specs.VarMapper;
@Feature("constraint")
public class UnitWeightedClause implements IConstr {
/**
*
*/
private static final long serialVersionUID = 1L;
private static final UnitWeightedClause INSTANCE = new UnitWeightedClause();
public static UnitWeightedClause instance() {
......@@ -46,26 +50,32 @@ public class UnitWeightedClause implements IConstr {
// singleton design pattern
}
@Override
public boolean learnt() {
throw new UnsupportedOperationException();
}
@Override
public int size() {
throw new UnsupportedOperationException();
}
@Override
public int get(int i) {
throw new UnsupportedOperationException();
}
@Override
public double getActivity() {
throw new UnsupportedOperationException();
}
@Override
public boolean canBePropagatedMultipleTimes() {
throw new UnsupportedOperationException();
}
@Override
public String toString(VarMapper mapper) {
throw new UnsupportedOperationException();
}
......
......@@ -32,7 +32,7 @@ package org.sat4j.pb.core;
import org.sat4j.minisat.core.IOrder;
import org.sat4j.minisat.core.LearningStrategy;
import org.sat4j.pb.constraints.pb.AutoDivisionStrategy;
import org.sat4j.pb.constraints.pb.ConflictMapClause;
import org.sat4j.pb.constraints.pb.ConflictMap;
import org.sat4j.pb.constraints.pb.IConflict;
import org.sat4j.pb.constraints.pb.IWeakeningStrategy;
import org.sat4j.pb.constraints.pb.NoPostProcess;
......@@ -53,7 +53,7 @@ public class PBSolverClause extends PBSolverCP {
@Override
protected IConflict chooseConflict(PBConstr myconfl, int level) {
return ConflictMapClause.createConflict(myconfl, level, isNoRemove(),
return ConflictMap.createConflict(myconfl, level, isNoRemove(),
isSkipAllow(), NoPreProcess.instance(),
NoPostProcess.instance(), IWeakeningStrategy.UNASSIGNED_FIRST,
AutoDivisionStrategy.ENABLED, pbStats);
......
Supports Markdown
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