This is an automated email from the ASF dual-hosted git repository. bchapuis pushed a commit to branch sonar in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
commit 840b1b930b57c7be48bd310f87d70ac127942535 Author: Bertil Chapuis <[email protected]> AuthorDate: Thu Jun 13 00:04:21 2024 +0200 Add default to switch --- .../org/apache/baremaps/workflow/tasks/ImportDaylightFeatures.java | 5 +++-- .../apache/baremaps/workflow/tasks/ImportDaylightTranslations.java | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ImportDaylightFeatures.java b/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ImportDaylightFeatures.java index 50169bd2..8ff7b3ea 100644 --- a/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ImportDaylightFeatures.java +++ b/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ImportDaylightFeatures.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.StringJoiner; - import org.apache.baremaps.database.postgres.*; import org.apache.baremaps.openstreetmap.model.Element; import org.apache.baremaps.workflow.Task; @@ -93,11 +92,13 @@ public class ImportDaylightFeatures implements Task { case "node" -> save(feature, nodeRepository); case "way" -> save(feature, wayRepository); case "relation" -> save(feature, relationRepository); + default -> logger.warn("Unknown type: {}", feature.type()); } } } - private <T extends Element> void save(Feature feature, Repository<Long, T> repository) throws RepositoryException { + private <T extends Element> void save(Feature feature, Repository<Long, T> repository) + throws RepositoryException { var entity = repository.get(feature.id()); if (entity != null) { var tags = new HashMap<>(feature.tags()); diff --git a/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ImportDaylightTranslations.java b/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ImportDaylightTranslations.java index ee84e20a..b99e073d 100644 --- a/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ImportDaylightTranslations.java +++ b/baremaps-core/src/main/java/org/apache/baremaps/workflow/tasks/ImportDaylightTranslations.java @@ -21,10 +21,8 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.HashMap; import java.util.List; -import java.util.Map.Entry; import java.util.StringJoiner; import java.util.stream.Collectors; - import org.apache.baremaps.database.postgres.*; import org.apache.baremaps.openstreetmap.model.Element; import org.apache.baremaps.workflow.Task; @@ -107,12 +105,14 @@ public class ImportDaylightTranslations implements Task { case "node" -> save(key, value, nodeRepository); case "way" -> save(key, value, wayRepository); case "relation" -> save(key, value, relationRepository); + default -> logger.warn("Unknown type: {}", key.type()); } } } } - private <T extends Element> void save(Group group, List<Line> lines, Repository<Long, T> repository) throws RepositoryException { + private <T extends Element> void save(Group group, List<Line> lines, + Repository<Long, T> repository) throws RepositoryException { var entity = repository.get(group.id()); if (entity != null) { var tags = new HashMap<>(entity.getTags());
