Commit 27bb39a8 authored by Riegel's avatar Riegel
Browse files

Marked fields as final. Ref #69

parent 618ff639
...@@ -40,7 +40,7 @@ public class TinObject extends CityObject { ...@@ -40,7 +40,7 @@ public class TinObject extends CityObject {
private static final long serialVersionUID = 1910744427384724422L; private static final long serialVersionUID = 1910744427384724422L;
private TINRelief gmlRelief; private final TINRelief gmlRelief;
public TinObject(TINRelief gmlRelief) { public TinObject(TINRelief gmlRelief) {
this.gmlRelief = gmlRelief; this.gmlRelief = gmlRelief;
......
...@@ -39,7 +39,7 @@ public class Vector3d implements Serializable { ...@@ -39,7 +39,7 @@ public class Vector3d implements Serializable {
public static final int Y = 1; public static final int Y = 1;
public static final int Z = 2; public static final int Z = 2;
private double[] coords; private final double[] coords;
public Vector3d() { public Vector3d() {
this(0d, 0d, 0d); this(0d, 0d, 0d);
......
...@@ -39,9 +39,9 @@ public class ParserConfiguration implements Serializable { ...@@ -39,9 +39,9 @@ public class ParserConfiguration implements Serializable {
private static final CRSFactory CRS_FACTORY = new CRSFactory(); private static final CRSFactory CRS_FACTORY = new CRSFactory();
private int roundingPlaces = 8; private final int roundingPlaces ;
private boolean validate = false; private final boolean validate;
private transient BasicCoordinateTransform targetTransform = null; private transient BasicCoordinateTransform targetTransform = null;
private transient BasicCoordinateTransform originalTransform = null; private transient BasicCoordinateTransform originalTransform = null;
......
...@@ -36,7 +36,7 @@ import de.hft.stuttgart.citydoctor2.math.Vector3d; ...@@ -36,7 +36,7 @@ import de.hft.stuttgart.citydoctor2.math.Vector3d;
*/ */
public class Primitive { public class Primitive {
private static Logger logger = LogManager.getLogger(Primitive.class); private static final Logger logger = LogManager.getLogger(Primitive.class);
private static final double AREA_EPSILON = 0.00001; private static final double AREA_EPSILON = 0.00001;
......
...@@ -69,12 +69,12 @@ public class Checks { ...@@ -69,12 +69,12 @@ public class Checks {
private static final Logger logger = LogManager.getLogger(Checks.class); private static final Logger logger = LogManager.getLogger(Checks.class);
private static List<CheckPrototype> checkPrototypes; private static final List<CheckPrototype> checkPrototypes;
private static Map<CheckId, CheckPrototype> prototypeMap; private static final Map<CheckId, CheckPrototype> prototypeMap;
private static Map<String, Requirement> availableRequirements; private static Map<String, Requirement> availableRequirements;
private Map<CheckId, Check> checkMap; private final Map<CheckId, Check> checkMap;
static { static {
checkPrototypes = new ArrayList<>(); checkPrototypes = new ArrayList<>();
......
...@@ -78,7 +78,7 @@ public class SelfIntersectionUtil { ...@@ -78,7 +78,7 @@ public class SelfIntersectionUtil {
private static final Logger logger = LogManager.getLogger(SelfIntersectionUtil.class); private static final Logger logger = LogManager.getLogger(SelfIntersectionUtil.class);
private static GeometryFactory factory = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING)); private static final GeometryFactory factory = new GeometryFactory(new PrecisionModel(PrecisionModel.FLOATING));
private SelfIntersectionUtil() { private SelfIntersectionUtil() {
......
...@@ -31,7 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger; ...@@ -31,7 +31,7 @@ import java.util.concurrent.atomic.AtomicInteger;
*/ */
public class ErrorStatisticsCollector { public class ErrorStatisticsCollector {
private Map<String, AtomicInteger> errorCounts = new HashMap<>(); private final Map<String, AtomicInteger> errorCounts = new HashMap<>();
public void addError(String errorName) { public void addError(String errorName) {
AtomicInteger numErrors = errorCounts.get(errorName); AtomicInteger numErrors = errorCounts.get(errorName);
......
...@@ -56,8 +56,8 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration; ...@@ -56,8 +56,8 @@ import de.hft.stuttgart.citydoctor2.parser.ParserConfiguration;
*/ */
public class XmlStreamErrorHandler implements ErrorReport { public class XmlStreamErrorHandler implements ErrorReport {
private ErrorDetails details; private final ErrorDetails details;
private BasicCoordinateTransform originalTransform; private final BasicCoordinateTransform originalTransform;
public XmlStreamErrorHandler(ParserConfiguration config) { public XmlStreamErrorHandler(ParserConfiguration config) {
originalTransform = config.getOriginalTransform(); originalTransform = config.getOriginalTransform();
......
...@@ -74,11 +74,11 @@ public class XmlStreamReporter implements StreamReporter { ...@@ -74,11 +74,11 @@ public class XmlStreamReporter implements StreamReporter {
private static final Logger logger = LogManager.getLogger(XmlStreamReporter.class); private static final Logger logger = LogManager.getLogger(XmlStreamReporter.class);
private OutputStream output; private final OutputStream output;
private CheckReport report; private final CheckReport report;
private Map<String, FeatureReport> reportMap; private final Map<String, FeatureReport> reportMap;
private ValidationConfiguration config; private final ValidationConfiguration config;
public XmlStreamReporter(OutputStream output, String fileName, ValidationConfiguration config) { public XmlStreamReporter(OutputStream output, String fileName, ValidationConfiguration config) {
this.output = output; this.output = output;
......
...@@ -31,8 +31,8 @@ public class CodeBlock { ...@@ -31,8 +31,8 @@ public class CodeBlock {
private static final String BLOCK = "block"; private static final String BLOCK = "block";
private Element codeBlockContainer; private final Element codeBlockContainer;
private Element codeBlockElement; private final Element codeBlockElement;
private Element currentLine; private Element currentLine;
......
...@@ -48,8 +48,8 @@ public class PdfErrorHandler implements ErrorReport { ...@@ -48,8 +48,8 @@ public class PdfErrorHandler implements ErrorReport {
private static final String ATTRIBUTE_KEY_COLOR = "#7F007F"; private static final String ATTRIBUTE_KEY_COLOR = "#7F007F";
private static final String ATTRIBUTE_VALUE_COLOR = "#2A00FF"; private static final String ATTRIBUTE_VALUE_COLOR = "#2A00FF";
private Section section; private final Section section;
private ParserConfiguration config; private final ParserConfiguration config;
public PdfErrorHandler(Section section, ParserConfiguration config) { public PdfErrorHandler(Section section, ParserConfiguration config) {
this.config = config; this.config = config;
......
...@@ -72,14 +72,14 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -72,14 +72,14 @@ public class PdfStreamReporter implements StreamReporter {
private static final String WARNING_COLOR = "yellow"; private static final String WARNING_COLOR = "yellow";
private static final String OK_COLOR = "green"; private static final String OK_COLOR = "green";
private PdfReport report; private final PdfReport report;
private OutputStream outFile; private final OutputStream outFile;
private Map<ErrorId, AtomicInteger> errorStatistics; private final Map<ErrorId, AtomicInteger> errorStatistics;
private ValidationConfiguration config; private final ValidationConfiguration config;
private Section statistics; private final Section statistics;
private Section vr; private final Section vr;
private Section buildings; private Section buildings;
private int numErrorBuildings; private int numErrorBuildings;
...@@ -107,7 +107,7 @@ public class PdfStreamReporter implements StreamReporter { ...@@ -107,7 +107,7 @@ public class PdfStreamReporter implements StreamReporter {
private Section globalErrors; private Section globalErrors;
private Map<String, Section> sectionMap = new HashMap<>(); private final Map<String, Section> sectionMap = new HashMap<>();
public PdfStreamReporter(OutputStream pdfOutputFile, String fileName, ValidationConfiguration config) { public PdfStreamReporter(OutputStream pdfOutputFile, String fileName, ValidationConfiguration config) {
this.config = config; this.config = config;
......
...@@ -50,15 +50,15 @@ public class Section { ...@@ -50,15 +50,15 @@ public class Section {
private static final AtomicInteger S_COUNTER = new AtomicInteger(0); private static final AtomicInteger S_COUNTER = new AtomicInteger(0);
private Element tocBlock; private final Element tocBlock;
private Element contentBlock; private final Element contentBlock;
private Element headlineBlock; private final Element headlineBlock;
private String linkId; private String linkId;
private List<Section> subSections; private List<Section> subSections;
private int depth; private final int depth;
// attributes for error reporting // attributes for error reporting
private ErrorStatisticsCollector stats; private ErrorStatisticsCollector stats;
......
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