From c5c535559d9d2b0101a8372d5a72298c2a3c046c Mon Sep 17 00:00:00 2001 From: stoecker Date: Tue, 28 Jan 2025 12:46:36 +0000 Subject: [PATCH] remove most of the new PMD messages git-svn-id: https://josm.openstreetmap.de/svn/trunk@19295 0c6e7542-c601-0410-84e7-c038aed88b3b --- .../josm/data/SystemOfMeasurement.java | 14 +++++------- .../josm/data/gpx/GpxExtension.java | 3 ++- .../data/validation/tests/UntaggedNode.java | 7 ++---- .../pair/properties/PropertiesMergeModel.java | 22 ++++++++++--------- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/org/openstreetmap/josm/data/SystemOfMeasurement.java b/src/org/openstreetmap/josm/data/SystemOfMeasurement.java index 7cbde182a91..cd970f8e44c 100644 --- a/src/org/openstreetmap/josm/data/SystemOfMeasurement.java +++ b/src/org/openstreetmap/josm/data/SystemOfMeasurement.java @@ -304,14 +304,12 @@ public static SystemOfMeasurement getDefault() { .map(LanguageInfo::getLocale) .orElse(Locale.getDefault()) .getCountry(); - switch (country) { - case "US": - // https://en.wikipedia.org/wiki/Metrication_in_the_United_States#Current_use - // Imperial units still used in transportation and Earth sciences - return IMPERIAL; - default: - return METRIC; - } + if (country == "US") + // https://en.wikipedia.org/wiki/Metrication_in_the_United_States#Current_use + // Imperial units still used in transportation and Earth sciences + return IMPERIAL; + else + return METRIC; } private static String formatText(double v, String unit, NumberFormat format) { diff --git a/src/org/openstreetmap/josm/data/gpx/GpxExtension.java b/src/org/openstreetmap/josm/data/gpx/GpxExtension.java index ebc832546c1..ef23b643f4e 100644 --- a/src/org/openstreetmap/josm/data/gpx/GpxExtension.java +++ b/src/org/openstreetmap/josm/data/gpx/GpxExtension.java @@ -89,8 +89,9 @@ public static XMLNamespace findNamespace(String prefix) { return new XMLNamespace("gpxd", XML_URI_EXTENSIONS_DRAWING, XML_XSD_EXTENSIONS_DRAWING); case "josm": return new XMLNamespace("josm", XML_URI_EXTENSIONS_JOSM, XML_XSD_EXTENSIONS_JOSM); + default: + return null; } - return null; } /** diff --git a/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java b/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java index 1e07b6e4abc..0f009cf66d3 100644 --- a/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java +++ b/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java @@ -111,11 +111,8 @@ public Command fixError(TestError testError) { public boolean isFixable(TestError testError) { if (testError.getTester() instanceof UntaggedNode) { int code = testError.getCode(); - switch (code) { - case UNTAGGED_NODE_BLANK: - case UNTAGGED_NODE_CREATED_BY: - case UNTAGGED_NODE_WATCH: - case UNTAGGED_NODE_SOURCE: + if (code == UNTAGGED_NODE_BLANK || code == UNTAGGED_NODE_CREATED_BY + || code == UNTAGGED_NODE_WATCH || code == UNTAGGED_NODE_SOURCE) { return true; } } diff --git a/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java b/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java index 32f549a6e07..07dcab27fc5 100644 --- a/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java +++ b/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java @@ -180,12 +180,13 @@ public LatLon getTheirCoords() { */ public LatLon getMergedCoords() { switch (coordMergeDecision) { - case KEEP_MINE: return myCoords; - case KEEP_THEIR: return theirCoords; - case UNDECIDED: return null; + case KEEP_MINE: + return myCoords; + case KEEP_THEIR: + return theirCoords; + default: + return null; } - // should not happen - return null; } /** @@ -221,12 +222,13 @@ public Boolean getTheirDeletedState() { */ public Boolean getMergedDeletedState() { switch (deletedMergeDecision) { - case KEEP_MINE: return myDeletedState; - case KEEP_THEIR: return theirDeletedState; - case UNDECIDED: return null; + case KEEP_MINE: + return myDeletedState; + case KEEP_THEIR: + return theirDeletedState; + default: + return null; } - // should not happen - return null; } /**