Skip to content
Snippets Groups Projects
Commit fde8a091 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

immutable fields


Signed-off-by: default avatarkristof <Kristof.Szabados@ericsson.com>
parent dba34ac5
No related branches found
No related tags found
No related merge requests found
Showing
with 44 additions and 44 deletions
......@@ -19,7 +19,7 @@ import org.eclipse.titan.common.logging.ErrorReporter;
* @author Gabor Jenei
*/
public class GUIErrorHandler implements ErrorHandler {
private StringBuilder collectedMessage;
private final StringBuilder collectedMessage;
/**
* Constructor
......
......@@ -46,7 +46,7 @@ public class AutomaticCluster extends BaseCluster {
private boolean checkModulename;
private boolean checkRegexp;
private IProject project;
private final IProject project;
private Set<Set<NodeDescriptor>> clustersToCheck;
/**
......@@ -70,7 +70,7 @@ public class AutomaticCluster extends BaseCluster {
* The next free index for a cluster
*/
private int index;
private int nodenum;
private final int nodenum;
private int clusternum;
private double mq;
private double maxmq;
......
......@@ -42,11 +42,11 @@ import org.eclipse.titanium.swt.SWTResourceManager;
* @see GraphView
*/
public class InfoWindow extends Dialog {
private Table table;
private NodeDescriptor module;
private ModuleMetricsWrapper metricsProvider;
private IMetricEnum chosenMetric;
private Shell shell;
private final Table table;
private final NodeDescriptor module;
private final ModuleMetricsWrapper metricsProvider;
private final IMetricEnum chosenMetric;
private final Shell shell;
protected final GUIErrorHandler errorHandler = new GUIErrorHandler();
private static final Point WINDOW_SIZE = new Point(300, 300);
......
......@@ -43,10 +43,10 @@ public class TitaniumISOMLayout<V, E> extends AbstractLayout<V, E> implements It
}
private Map<V, ISOMVertexData> isomVertexData = new HashMap<V, TitaniumISOMLayout.ISOMVertexData>();
private final Map<V, ISOMVertexData> isomVertexData = new HashMap<V, TitaniumISOMLayout.ISOMVertexData>();
private int maxEpoch = 2000;
private AtomicInteger epoch = new AtomicInteger(1);
private final AtomicInteger epoch = new AtomicInteger(1);
private int radiusConstantTime;
private int radius;
......@@ -60,7 +60,7 @@ public class TitaniumISOMLayout<V, E> extends AbstractLayout<V, E> implements It
private double coolingFactor;
private List<V> queue = new ArrayList<V>();
private final List<V> queue = new ArrayList<V>();
/**
* Creates an <code>ISOMLayout</code> instance for the specified graph
......@@ -70,7 +70,6 @@ public class TitaniumISOMLayout<V, E> extends AbstractLayout<V, E> implements It
*/
public TitaniumISOMLayout(final Graph<V, E> g) {
super(g);
queue = new ArrayList<V>(g.getVertexCount());
}
/**
......
......@@ -36,9 +36,9 @@ public class MetricLayoutAlgorithm implements HierarcicalLayoutAlgorithm<NodeDes
private Map<NodeDescriptor, Double> values;
private Map<NodeDescriptor, Integer> levels;
private Collection<NodeDescriptor> nodes;
private final Collection<NodeDescriptor> nodes;
private Set<NodeDescriptor> badNodes;
private IMetricEnum chosenMetric;
private final IMetricEnum chosenMetric;
private Double minValue;
private Double maxValue;
private int filledLevels;
......
......@@ -28,9 +28,9 @@ import edu.uci.ics.jung.graph.Graph;
public class CheckParallelPaths<V, E> {
protected Graph<V, E> graph;
protected Map<V, E> predArc;
protected Set<Deque<E>> paths;
protected final Set<Deque<E>> paths;
protected V root;
private boolean hasRoot;
private final boolean hasRoot;
/**
* Initialize the data to find all parallel paths.
......@@ -53,7 +53,8 @@ public class CheckParallelPaths<V, E> {
* The source node
*/
public CheckParallelPaths(final Graph<V, E> graph, final V s) {
this(graph);
this.graph = graph;
paths = new HashSet<Deque<E>>();
root = s;
hasRoot = true;
}
......
......@@ -25,10 +25,10 @@ import edu.uci.ics.jung.graph.DirectedSparseGraph;
* edge type
*/
public class CircleCheck<V, E> {
private DirectedSparseGraph<V, E> g;
private List<Deque<E>> circles;
private Deque<E> circleEdges;
private Deque<V> circleVertices;
private final DirectedSparseGraph<V, E> g;
private final List<Deque<E>> circles;
private final Deque<E> circleEdges;
private final Deque<V> circleVertices;
private List<V> remaining;
/**
......
......@@ -77,7 +77,7 @@ class NodeShape<V> implements Transformer<V, Shape> {
* the node's type
*/
class NodeColour<V> implements Transformer<V, Paint> {
private PickedState<V> picked;
private final PickedState<V> picked;
/**
* Constructor, we need to store a reference of the class which tells us the
......@@ -115,7 +115,7 @@ class NodeColour<V> implements Transformer<V, Paint> {
* edge's type
*/
class EdgeColour<E> implements Transformer<E, Paint> {
private PickedState<E> picked;
private final PickedState<E> picked;
/**
* We need to store a reference to the currently chosen edges
......
......@@ -45,7 +45,7 @@ public class FindWindow<T extends Comparable> extends Dialog {
private Label label;
private Label lblResults;
private Tree tree;
private SortedSet<T> treeItems;
private final SortedSet<T> treeItems;
protected final GUIErrorHandler errorHandler = new GUIErrorHandler();
/**
......
......@@ -50,10 +50,10 @@ public class ExportedProblemMerger {
private HSSFSheet summarysheet;
private String project;
private SortedSet<Date> dates;
private Map<Date, Integer> datecol;
private Map<Date, File> datefile;
private Map<String, Integer> smellrow;
private final SortedSet<Date> dates;
private final Map<Date, Integer> datecol;
private final Map<Date, File> datefile;
private final Map<String, Integer> smellrow;
private int smellindex;
public ExportedProblemMerger(final List<File> files, final File outfile) {
......
......@@ -96,7 +96,7 @@ public class CircularImportation extends BaseProjectCodeSmellSpotter {
* </p>
*/
class CycleCheck {
private Map<Module, Node> map;
private final Map<Module, Node> map;
List<List<Module>> cycles;
/**
......
......@@ -66,7 +66,7 @@ public class IfInsteadReceiveTemplate extends BaseModuleCodeSmellSpotter {
*
*/
final class SuspiciouslyUsedIf extends ASTVisitor {
private Reference redirectValue;
private final Reference redirectValue;
private boolean smells;
private If_Clause suspicious;
......@@ -113,7 +113,7 @@ final class SuspiciouslyUsedIf extends ASTVisitor {
*
*/
final class RefUsedInMatching extends ASTVisitor {
private Reference ref;
private final Reference ref;
private boolean used;
public RefUsedInMatching(final Reference ref) {
......@@ -141,7 +141,7 @@ final class RefUsedInMatching extends ASTVisitor {
}
final class ContainsRef extends ASTVisitor {
private Identifier id;
private final Identifier id;
public boolean contains;
public ContainsRef(final Reference ref) {
......
......@@ -46,7 +46,7 @@ public class IncorrectRotate {
private static final String TOOBIGROTATEPROBLEM =
"Rotating a {1} long value to the {0} with {2} will have the same effect as rotating by {3}";
private String actualRotation;
private final String actualRotation;
private RotationChecker(final CodeSmellType type, final String actualRotation) {
super(type);
......
......@@ -40,7 +40,7 @@ public class IncorrectShift {
private static final String TOOBIGSHIFTPROBLEM =
"Shifting a {1} long string to the {0} with {2} will always result in a string of same size, but filled with '0' -s.";
private String actualShift;
private final String actualShift;
private ShiftChecker(final CodeSmellType type, final String actualShift) {
super(type);
......
......@@ -105,7 +105,7 @@ public class IterateOnWrongArray extends BaseModuleCodeSmellSpotter {
//call on Value (final expression of For_Statement)
private static final class FinalExprVisitor extends ASTVisitor {
private List<Reference> arraysIterated = new ArrayList<Reference>();
private final List<Reference> arraysIterated = new ArrayList<Reference>();
public List<Reference> getArraysIterated() {
return arraysIterated;
......
......@@ -273,7 +273,7 @@ public class Lazy extends BaseModuleCodeSmellSpotter {
* @author Peter Olah
*/
public class RelevantFormalParameterCollector extends ASTVisitor {
private List<FormalParameter> items;
private final List<FormalParameter> items;
public RelevantFormalParameterCollector() {
items = new ArrayList<FormalParameter>();
......
......@@ -88,9 +88,9 @@ public class PrivateViaPublic {
private class FieldCollector extends ASTVisitor {
private List<Reference> references;
private final List<Reference> references;
private List<NamedValue> namedValues;
private final List<NamedValue> namedValues;
public FieldCollector() {
references = new ArrayList<Reference>();
......@@ -198,7 +198,7 @@ public class PrivateViaPublic {
private class IdentifierToDefType extends ASTVisitor {
private Identifier identifierToFind;
private final Identifier identifierToFind;
private boolean isPrivate;
......@@ -257,7 +257,7 @@ public class PrivateViaPublic {
private class ValueCollector extends ASTVisitor {
private List<SequenceOf_Value> sequenceOfValues;
private final List<SequenceOf_Value> sequenceOfValues;
public ValueCollector() {
sequenceOfValues = new ArrayList<SequenceOf_Value>();
......
......@@ -82,7 +82,7 @@ final class SuperfluousTemplate extends ASTVisitor {
// these are initialized according to the receive statement of the
// constructor
private IType receivableType;
private boolean hasValueRedirection;
private final boolean hasValueRedirection;
// this is the template of the receive statement, extracted during the
// visiting
private TemplateInstance template;
......
......@@ -135,7 +135,7 @@ public class SelectCoverage extends BaseModuleCodeSmellSpotter {
private final class CaseVisitor extends ASTVisitor {
private List<Identifier> itemsUsed = new ArrayList<Identifier>();
private final List<Identifier> itemsUsed = new ArrayList<Identifier>();
private int count = 0;
private boolean containsUnfoldable = false;
......@@ -182,7 +182,7 @@ public class SelectCoverage extends BaseModuleCodeSmellSpotter {
}
private static final class EnumItemVisitor extends ASTVisitor {
private List<Identifier> itemsFound = new ArrayList<Identifier>();
private final List<Identifier> itemsFound = new ArrayList<Identifier>();
private int count = 0;
public int getCount() {
......
......@@ -117,7 +117,7 @@ public class SelectWithNumbersSorted extends BaseModuleCodeSmellSpotter {
private final class CaseVisitorInteger extends ASTVisitor {
private List<Long> itemsUsed = new ArrayList<Long>();
private final List<Long> itemsUsed = new ArrayList<Long>();
private boolean foundUnfoldable = false;
public List<Long> getItemsUsed() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment