Commit 007cb5e2 authored by leberre's avatar leberre

Fixed some compilers warnings.

git-svn-id: svn+ssh://svn.forge.ow2.org/svnroot/sat4j/maven/trunk@311 ba638df5-4473-46d1-82f8-c3ae2a17a6e1
parent a6d684d2
......@@ -28,6 +28,7 @@
package org.sat4j.minisat.constraints.cnf;
import static org.sat4j.core.LiteralsUtils.neg;
import org.sat4j.minisat.core.ILits;
import org.sat4j.specs.IVecInt;
......
......@@ -28,6 +28,7 @@
package org.sat4j.minisat.constraints.cnf;
import static org.sat4j.core.LiteralsUtils.neg;
import org.sat4j.minisat.core.ILits;
import org.sat4j.minisat.core.UnitPropagationListener;
import org.sat4j.specs.IVecInt;
......
......@@ -32,7 +32,6 @@ import java.io.Serializable;
import org.sat4j.minisat.core.Constr;
import org.sat4j.minisat.core.ILits;
import org.sat4j.minisat.core.UnitPropagationListener;
import org.sat4j.specs.ContradictionException;
import org.sat4j.specs.IVecInt;
/**
......
......@@ -29,8 +29,6 @@ package org.sat4j.minisat.learning;
import org.sat4j.minisat.constraints.cnf.WLClause;
import org.sat4j.minisat.core.Constr;
import org.sat4j.minisat.core.DataStructureFactory;
import org.sat4j.minisat.core.ILits;
/**
* The solver only records among all the constraints only the clauses.
......
......@@ -28,8 +28,6 @@
package org.sat4j.minisat.learning;
import org.sat4j.minisat.core.Constr;
import org.sat4j.minisat.core.DataStructureFactory;
import org.sat4j.minisat.core.ILits;
/**
* A learning scheme for learning constraints of size smaller than a given
......
......@@ -28,7 +28,6 @@
package org.sat4j.minisat.learning;
import org.sat4j.minisat.core.Constr;
import org.sat4j.minisat.core.DataStructureFactory;
import org.sat4j.minisat.core.ILits;
import org.sat4j.minisat.core.LearningStrategy;
import org.sat4j.minisat.core.Solver;
......
......@@ -72,16 +72,16 @@ public class CardDimacsReader extends DimacsReader {
int realNbOfClauses = 0;
IVecInt literals = new VecInt();
IVecInt myLiterals = new VecInt();
while (true) {
line = in.readLine();
if (line == null) {
// end of file
if (literals.size() > 0) {
if (myLiterals.size() > 0) {
// no 0 end the last clause
solver.addClause(literals);
solver.addClause(myLiterals);
realNbOfClauses++;
}
......@@ -106,19 +106,19 @@ public class CardDimacsReader extends DimacsReader {
if ("<=".equals(token) || ">=".equals(token)) {
// on est sur une contrainte de cardinalit?
readCardinalityConstr(token, stk, literals);
literals.clear();
readCardinalityConstr(token, stk, myLiterals);
myLiterals.clear();
realNbOfClauses++;
} else {
lit = Integer.parseInt(token);
if (lit == 0) {
if (literals.size() > 0) {
solver.addClause(literals);
literals.clear();
if (myLiterals.size() > 0) {
solver.addClause(myLiterals);
myLiterals.clear();
realNbOfClauses++;
}
} else {
literals.push(lit);
myLiterals.push(lit);
}
}
}
......@@ -130,15 +130,15 @@ public class CardDimacsReader extends DimacsReader {
}
private void readCardinalityConstr(String token, StringTokenizer stk,
IVecInt literals) throws ContradictionException,
IVecInt myLiterals) throws ContradictionException,
ParseFormatException {
int card = Integer.parseInt(stk.nextToken());
int lit = Integer.parseInt(stk.nextToken());
if (lit == 0) {
if ("<=".equals(token)) {
solver.addAtMost(literals, card);
solver.addAtMost(myLiterals, card);
} else if (">=".equals(token)) {
solver.addAtLeast(literals, card);
solver.addAtLeast(myLiterals, card);
}
} else
throw new ParseFormatException();
......
......@@ -76,10 +76,10 @@ public class LecteurDimacs extends Reader implements Serializable {
}
@Override
public final IProblem parseInstance(final InputStream in)
public final IProblem parseInstance(final InputStream input)
throws ParseFormatException, ContradictionException, IOException {
this.in = new BufferedInputStream(in, LecteurDimacs.TAILLE_BUF);
this.in = new BufferedInputStream(input, LecteurDimacs.TAILLE_BUF);
s.reset();
passerCommentaire();
if (nbVars < 0)
......@@ -93,12 +93,12 @@ public class LecteurDimacs extends Reader implements Serializable {
throw new ParseFormatException("DIMACS error: the clauses are missing");
ajouterClauses(car);
}
in.close();
input.close();
return s;
}
@Override
public IProblem parseInstance(java.io.Reader in) throws IOException,
public IProblem parseInstance(java.io.Reader input) throws IOException,
ContradictionException {
throw new UnsupportedOperationException();
}
......
......@@ -27,7 +27,9 @@
*******************************************************************************/
package org.sat4j;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.sat4j.core.VecInt;
......
......@@ -27,7 +27,9 @@
*******************************************************************************/
package org.sat4j;
import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.sat4j.core.VecInt;
......
......@@ -77,8 +77,8 @@ public abstract class AbstractAcceptanceTestCase<T extends ISolver> extends Test
}
protected InstanceReader createInstanceReader(T solver){
return new InstanceReader(solver);
protected InstanceReader createInstanceReader(T aSolver){
return new InstanceReader(aSolver);
}
@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