From 521d4e8d6f4f8862adfc555fe79b0fcd0b3faf40 Mon Sep 17 00:00:00 2001 From: Riegel <alexander.riegel@hft-stuttgart.de> Date: Tue, 10 Dec 2024 13:33:56 +0100 Subject: [PATCH] Refactor: Remove unused fields --- .../citydoctor2/datastructure/LibraryObject.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LibraryObject.java b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LibraryObject.java index 61e7153..3316613 100644 --- a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LibraryObject.java +++ b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/datastructure/LibraryObject.java @@ -24,8 +24,6 @@ public class LibraryObject extends Geometry { private static final Logger logger = LogManager.getLogger(LibraryObject.class); @Serial private static final long serialVersionUID = -50293435187454911L; - private final String filepath; - private final ParserConfiguration config; private static Map<String, LibraryObject> libraryObjects = new ConcurrentHashMap<>(); public static LibraryObject of(Path path, ParserConfiguration config) { @@ -36,7 +34,7 @@ public class LibraryObject extends Geometry { if (protoGeom == null) { return null; } - LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod(), path, config); + LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod()); protoGeom.getPolygons().forEach(libOb::addPolygon); libOb.updateEdgesAndVertices(); libraryObjects.put(path.toString(), libOb); @@ -52,17 +50,15 @@ public class LibraryObject extends Geometry { if (protoGeom == null) { return null; } - LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod(), Path.of(fileName), config); + LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod()); protoGeom.getPolygons().forEach(libOb::addPolygon); libOb.updateEdgesAndVertices(); libraryObjects.put(fileName, libOb); return libOb; } - private LibraryObject(GeometryType type, Lod lod, Path path, ParserConfiguration config) { + private LibraryObject(GeometryType type, Lod lod) { super(type, lod); - this.filepath = path.toString(); - this.config = config; } @@ -111,9 +107,9 @@ public class LibraryObject extends Geometry { } List<CityObject> objects = model.createFeatureStream().toList(); if (objects.isEmpty()) { - throw new InvalidGmlFileException("Referenced library-object's gml file does not contain a CityGML object!"); + throw new InvalidGmlFileException("Referenced library-object gml file does not contain any CityGML objects!"); } else if (objects.size() > 1) { - throw new InvalidGmlFileException("Referenced library-object's gml file contains more than one CityGML object!"); + throw new InvalidGmlFileException("Referenced library-object gml file contains more than one CityGML object!"); } return objects.get(0).getHighestLodGeometry(); } -- GitLab