Commit 7b16c17e authored by Riegel's avatar Riegel
Browse files

Code cleaning. Ref #69

parent ef767f40
...@@ -128,12 +128,9 @@ public class Requirement implements Serializable { ...@@ -128,12 +128,9 @@ public class Requirement implements Serializable {
return false; return false;
Requirement other = (Requirement) obj; Requirement other = (Requirement) obj;
if (id == null) { if (id == null) {
if (other.id != null) return other.id == null;
return false; } else return id.equals(other.id);
} else if (!id.equals(other.id)) }
return false;
return true;
}
@Override @Override
public String toString() { public String toString() {
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
package de.hft.stuttgart.citydoctor2.datastructure; package de.hft.stuttgart.citydoctor2.datastructure;
import java.io.Serial;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -38,6 +39,7 @@ public class TinObject extends CityObject { ...@@ -38,6 +39,7 @@ public class TinObject extends CityObject {
private static final Logger logger = LogManager.getLogger(TinObject.class); private static final Logger logger = LogManager.getLogger(TinObject.class);
@Serial
private static final long serialVersionUID = 1910744427384724422L; private static final long serialVersionUID = 1910744427384724422L;
private final TINRelief gmlRelief; private final TINRelief gmlRelief;
......
...@@ -236,11 +236,7 @@ public class TransportationObject extends CityObject { ...@@ -236,11 +236,7 @@ public class TransportationObject extends CityObject {
@Override @Override
public void unsetGmlGeometries() { public void unsetGmlGeometries() {
switch (type) { switch (type) {
case ROAD: case ROAD, TRACK, RAILWAY, SQUARE,TRANSPORTATION_COMPLEX:
case TRACK:
case RAILWAY:
case SQUARE:
case TRANSPORTATION_COMPLEX:
AbstractTransportationSpace tc = (AbstractTransportationSpace) ato; AbstractTransportationSpace tc = (AbstractTransportationSpace) ato;
tc.getDeprecatedProperties().setLod1MultiSurface(null); tc.getDeprecatedProperties().setLod1MultiSurface(null);
tc.setLod2MultiSurface(null); tc.setLod2MultiSurface(null);
......
...@@ -134,7 +134,7 @@ public class ProjectionAxis { ...@@ -134,7 +134,7 @@ public class ProjectionAxis {
double x = (d - b * y - c * z) / a; double x = (d - b * y - c * z) / a;
return new Vertex(x, y, z); return new Vertex(x, y, z);
} else { } else {
throw new IllegalStateException("Unknown axis: " + axis); throw new IllegalStateException("Unknown axis: " + Arrays.toString(axis));
} }
} }
......
...@@ -240,11 +240,9 @@ public class Vector3d implements Serializable { ...@@ -240,11 +240,9 @@ public class Vector3d implements Serializable {
@Override @Override
public String toString() { public String toString() {
final int maxLen = 5; final int maxLen = 5;
StringBuilder builder = new StringBuilder(); return "Vector3d [coords=" +
builder.append("Vector3d [coords="); (coords != null ? Arrays.toString(Arrays.copyOf(coords, Math.min(coords.length, maxLen))) : null) +
builder.append(coords != null ? Arrays.toString(Arrays.copyOf(coords, Math.min(coords.length, maxLen))) : null); "]";
builder.append("]");
return builder.toString();
} }
@Override @Override
......
...@@ -91,8 +91,8 @@ public class ParserConfiguration implements Serializable { ...@@ -91,8 +91,8 @@ public class ParserConfiguration implements Serializable {
} }
private void createCoordinateTransforms() { private void createCoordinateTransforms() {
CoordinateReferenceSystem tgtCrs = null; CoordinateReferenceSystem tgtCrs ;
CoordinateReferenceSystem crs = null; CoordinateReferenceSystem crs;
synchronized (CRS_FACTORY) { synchronized (CRS_FACTORY) {
tgtCrs = CRS_FACTORY.createFromParameters("Target", targetTransformString); tgtCrs = CRS_FACTORY.createFromParameters("Target", targetTransformString);
crs = CRS_FACTORY.createFromParameters("Original", originalTransformString); crs = CRS_FACTORY.createFromParameters("Original", originalTransformString);
......
...@@ -412,7 +412,7 @@ public class SelfIntersectionUtil { ...@@ -412,7 +412,7 @@ public class SelfIntersectionUtil {
Triangle3d t2 = p2.getTriangles().get(p2Index); Triangle3d t2 = p2.getTriangles().get(p2Index);
if (t1.doesIntersect(t2)) { if (t1.doesIntersect(t2)) {
logger.trace("{} intersects {}", t1, t2); logger.trace("{} intersects {}", t1, t2);
logger.trace("{} intersects {}", t1.getPartOf().getOriginal().getGmlId(), logger.trace("GML-ID: {} intersects {}", t1.getPartOf().getOriginal().getGmlId(),
t2.getPartOf().getOriginal().getGmlId()); t2.getPartOf().getOriginal().getGmlId());
return new GeometrySelfIntersection(t1.getPartOf().getOriginal(), t2.getPartOf().getOriginal(), t1, return new GeometrySelfIntersection(t1.getPartOf().getOriginal(), t2.getPartOf().getOriginal(), t1,
t2); t2);
......
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