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

Code cleaning. Ref #69

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