Skip to content

Commit c5c5355

Browse files
author
stoecker
committed
remove most of the new PMD messages
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19295 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent 3e43e20 commit c5c5355

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

src/org/openstreetmap/josm/data/SystemOfMeasurement.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,12 @@ public static SystemOfMeasurement getDefault() {
304304
.map(LanguageInfo::getLocale)
305305
.orElse(Locale.getDefault())
306306
.getCountry();
307-
switch (country) {
308-
case "US":
309-
// https://en.wikipedia.org/wiki/Metrication_in_the_United_States#Current_use
310-
// Imperial units still used in transportation and Earth sciences
311-
return IMPERIAL;
312-
default:
313-
return METRIC;
314-
}
307+
if (country == "US")
308+
// https://en.wikipedia.org/wiki/Metrication_in_the_United_States#Current_use
309+
// Imperial units still used in transportation and Earth sciences
310+
return IMPERIAL;
311+
else
312+
return METRIC;
315313
}
316314

317315
private static String formatText(double v, String unit, NumberFormat format) {

src/org/openstreetmap/josm/data/gpx/GpxExtension.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ public static XMLNamespace findNamespace(String prefix) {
8989
return new XMLNamespace("gpxd", XML_URI_EXTENSIONS_DRAWING, XML_XSD_EXTENSIONS_DRAWING);
9090
case "josm":
9191
return new XMLNamespace("josm", XML_URI_EXTENSIONS_JOSM, XML_XSD_EXTENSIONS_JOSM);
92+
default:
93+
return null;
9294
}
93-
return null;
9495
}
9596

9697
/**

src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,8 @@ public Command fixError(TestError testError) {
111111
public boolean isFixable(TestError testError) {
112112
if (testError.getTester() instanceof UntaggedNode) {
113113
int code = testError.getCode();
114-
switch (code) {
115-
case UNTAGGED_NODE_BLANK:
116-
case UNTAGGED_NODE_CREATED_BY:
117-
case UNTAGGED_NODE_WATCH:
118-
case UNTAGGED_NODE_SOURCE:
114+
if (code == UNTAGGED_NODE_BLANK || code == UNTAGGED_NODE_CREATED_BY
115+
|| code == UNTAGGED_NODE_WATCH || code == UNTAGGED_NODE_SOURCE) {
119116
return true;
120117
}
121118
}

src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,13 @@ public LatLon getTheirCoords() {
180180
*/
181181
public LatLon getMergedCoords() {
182182
switch (coordMergeDecision) {
183-
case KEEP_MINE: return myCoords;
184-
case KEEP_THEIR: return theirCoords;
185-
case UNDECIDED: return null;
183+
case KEEP_MINE:
184+
return myCoords;
185+
case KEEP_THEIR:
186+
return theirCoords;
187+
default:
188+
return null;
186189
}
187-
// should not happen
188-
return null;
189190
}
190191

191192
/**
@@ -221,12 +222,13 @@ public Boolean getTheirDeletedState() {
221222
*/
222223
public Boolean getMergedDeletedState() {
223224
switch (deletedMergeDecision) {
224-
case KEEP_MINE: return myDeletedState;
225-
case KEEP_THEIR: return theirDeletedState;
226-
case UNDECIDED: return null;
225+
case KEEP_MINE:
226+
return myDeletedState;
227+
case KEEP_THEIR:
228+
return theirDeletedState;
229+
default:
230+
return null;
227231
}
228-
// should not happen
229-
return null;
230232
}
231233

232234
/**

0 commit comments

Comments
 (0)