Commit 028184de authored by Daniel Le Berre's avatar Daniel Le Berre
Browse files

yet more sonarqube violations fixes for sat4j core

parent bd5b5434
Pipeline #20109 passed with stages
in 44 minutes and 59 seconds
......@@ -101,6 +101,7 @@ class GlucoseLCDS<D extends DataStructureFactory>
+ timer;
}
@Override
public void init() {
final int howmany = solver.voc.nVars();
if (this.flags.length <= howmany) {
......
......@@ -46,12 +46,12 @@ import org.sat4j.specs.Constr;
* @author daniel
*
*/
abstract class AbstractLearning<D extends DataStructureFactory> implements
LearningStrategy<D> {
abstract class AbstractLearning<D extends DataStructureFactory>
implements LearningStrategy<D> {
/**
*
*/
*
*/
private static final long serialVersionUID = 1L;
private VarActivityListener val;
......@@ -65,7 +65,7 @@ abstract class AbstractLearning<D extends DataStructureFactory> implements
}
public final void claBumpActivity(Constr reason) {
for (int i = 0; i < reason.size(); i++) {
for (var i = 0; i < reason.size(); i++) {
int q = reason.get(i);
assert q > 1;
this.val.varBumpActivity(q);
......
......@@ -77,7 +77,7 @@ public final class PureOrder extends VarOrderHeap {
// try to find a pure literal
this.cpt = 0;
int nblits = 2 * this.lits.nVars();
for (int i = 2; i <= nblits; i++) {
for (var i = 2; i <= nblits; i++) {
if (this.lits.isUnassigned(i) && this.lits.watches(i).size() > 0
&& this.lits.watches(i ^ 1).size() == 0) {
return i;
......
......@@ -125,8 +125,8 @@ public class Product extends EncodingStrategyAdapter {
hashTupleSetTable[d] = new ArrayList<>();
ady[d] = new HashMap<>();
adxd[d] = new VecInt();
for (int i = 0; i < n; i++) {
for (int j = 0; j < k; j++) {
for (var i = 0; i < n; i++) {
for (var j = 0; j < k; j++) {
if (j < d) {
aWithoutD[i][d][j] = a[i][j];
} else {
......
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