Commit dffb6cb2 authored by leberre's avatar leberre
Browse files

Fixed a few issues found by sonar.

git-svn-id: svn+ssh://svn.forge.ow2.org/svnroot/sat4j/maven/trunk@1705 ba638df5-4473-46d1-82f8-c3ae2a17a6e1
parent 2becc825
......@@ -4,7 +4,9 @@ import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.Map;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
......@@ -56,7 +58,7 @@ public class CleanCommandComponent extends CommandComponent {
private final JLabel deleteClauseLabel = new JLabel(DELETE_CLAUSES);
private final static String DELETE_CLAUSES = "Automated clean: ";
private Hashtable<Integer, JLabel> cleanValuesTable;
private Dictionary<Integer, JLabel> cleanValuesTable;
private final JLabel clean5000Label = new JLabel(CLEAN_5000);
private final JLabel clean10000Label = new JLabel(CLEAN_10000);
private final JLabel clean20000Label = new JLabel(CLEAN_20000);
......@@ -106,12 +108,12 @@ public class CleanCommandComponent extends CommandComponent {
// Create the label table
this.cleanValuesTable = new Hashtable<Integer, JLabel>();
this.cleanValuesTable.put(new Integer(0), this.clean5000Label);
this.cleanValuesTable.put(new Integer(1), this.clean10000Label);
this.cleanValuesTable.put(new Integer(2), this.clean20000Label);
this.cleanValuesTable.put(new Integer(3), this.clean50000Label);
this.cleanValuesTable.put(new Integer(4), this.clean100000Label);
this.cleanValuesTable.put(new Integer(5), this.clean500000Label);
this.cleanValuesTable.put(0, this.clean5000Label);
this.cleanValuesTable.put(1, this.clean10000Label);
this.cleanValuesTable.put(2, this.clean20000Label);
this.cleanValuesTable.put(3, this.clean50000Label);
this.cleanValuesTable.put(4, this.clean100000Label);
this.cleanValuesTable.put(5, this.clean500000Label);
this.cleanSlider.setLabelTable(this.cleanValuesTable);
this.cleanSlider.setPaintLabels(true);
......
......@@ -38,8 +38,10 @@ import java.io.IOException;
import java.lang.reflect.Modifier;
import java.net.JarURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.Vector;
import java.util.jar.JarEntry;
......@@ -61,10 +63,10 @@ import java.util.zip.ZipEntry;
*/
public class RTSI {
public static Vector<String> alreadySeenPckges;
public static List<String> alreadySeenPckges;
public static Vector<String> find(String tosubclassname, boolean fullname) {
alreadySeenPckges = new Vector<String>();
alreadySeenPckges = new ArrayList<String>();
Set<String> v = new HashSet<String>();
Set<String> tmp;
try {
......
......@@ -2,13 +2,14 @@ package org.sat4j.sat;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.Vector;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.cli.CommandLine;
......@@ -17,7 +18,6 @@ import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;
import org.sat4j.specs.ILogAble;
import org.sat4j.core.ASolverFactory;
import org.sat4j.minisat.core.DataStructureFactory;
import org.sat4j.minisat.core.ICDCL;
......@@ -33,10 +33,11 @@ import org.sat4j.minisat.orders.RandomWalkDecorator;
import org.sat4j.minisat.orders.VarOrderHeap;
import org.sat4j.pb.orders.RandomWalkDecoratorObjective;
import org.sat4j.pb.orders.VarOrderHeapObjective;
import org.sat4j.specs.ILogAble;
import org.sat4j.specs.ISolver;
import org.sat4j.tools.DotSearchTracing;
public class Solvers {
public final class Solvers {
public final static String ORDERS = "ORDERS";
public final static String LEARNING = "LEARNING";
......@@ -131,7 +132,7 @@ public class Solvers {
return theSolver;
}
private final static <T> T setupObject(String component, Properties pf,
private static <T> T setupObject(String component, Properties pf,
ILogAble logger) {
try {
String configline = pf.getProperty(component);
......@@ -392,8 +393,8 @@ public class Solvers {
}
public static void showAvailableRestarts(ILogAble logger) {
Vector<String> classNames = new Vector<String>();
Vector<String> resultRTSI = RTSI.find(RESTART_STRATEGY_NAME);
List<String> classNames = new ArrayList<String>();
List<String> resultRTSI = RTSI.find(RESTART_STRATEGY_NAME);
Set<String> keySet;
for (String name : resultRTSI) {
if (!name.contains("Remote")) {
......@@ -428,8 +429,8 @@ public class Solvers {
}
public static void showAvailablePhase(ILogAble logger) {
Vector<String> classNames = new Vector<String>();
Vector<String> resultRTSI = RTSI.find(PHASE_NAME);
List<String> classNames = new ArrayList<String>();
List<String> resultRTSI = RTSI.find(PHASE_NAME);
Set<String> keySet;
for (String name : resultRTSI) {
if (!name.contains("Remote")) {
......@@ -462,8 +463,8 @@ public class Solvers {
}
public static void showAvailableLearning(ILogAble logger) {
Vector<String> classNames = new Vector<String>();
Vector<String> resultRTSI = RTSI.find(LEARNING_NAME);
List<String> classNames = new ArrayList<String>();
List<String> resultRTSI = RTSI.find(LEARNING_NAME);
Set<String> keySet;
for (String name : resultRTSI) {
try {
......@@ -496,8 +497,8 @@ public class Solvers {
}
public static void showAvailableOrders(ILogAble logger) {
Vector<String> classNames = new Vector<String>();
Vector<String> resultRTSI = RTSI.find(ORDER_NAME);
List<String> classNames = new ArrayList<String>();
List<String> resultRTSI = RTSI.find(ORDER_NAME);
Set<String> keySet = null;
for (String name : resultRTSI) {
if (!name.contains("Remote")) {
......
......@@ -11,6 +11,11 @@ import org.sat4j.specs.ILogAble;
public class GnuplotBasedSolverVisualisation implements SolverVisualisation {
/**
*
*/
private static final long serialVersionUID = 1L;
private VisuPreferences visuPreferences;
private int nVar;
private Process gnuplotProcess;
......@@ -286,7 +291,7 @@ public class GnuplotBasedSolverVisualisation implements SolverVisualisation {
true, 50));
}
out.println("unset multiplot");
double pauseTime = this.visuPreferences.getRefreshTime() / 1000;
int pauseTime = this.visuPreferences.getRefreshTime() / 1000;
out.println("pause " + pauseTime);
out.println("reread");
out.close();
......
......@@ -18,6 +18,11 @@ import javax.swing.JFrame;
public class JChartBasedSolverVisualisation implements SolverVisualisation {
/**
*
*/
private static final long serialVersionUID = 1L;
private JFrame visuFrame;
private int nVar;
......
package org.sat4j.sat.visu;
public interface SolverVisualisation {
import java.io.Serializable;
public interface SolverVisualisation extends Serializable {
public void start();
......
......@@ -26,6 +26,11 @@ import java.util.Set;
*/
public class TraceComposite implements ITrace2D {
/**
*
*/
private static final long serialVersionUID = 1L;
private List<ITrace2D> traces;
public TraceComposite(List<ITrace2D> traces) {
......
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