Skip to content

Commit 1edf2ee

Browse files
author
stoecker
committed
fix PMD
git-svn-id: https://josm.openstreetmap.de/svn/trunk@19300 0c6e7542-c601-0410-84e7-c038aed88b3b
1 parent 5139b5e commit 1edf2ee

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,14 @@ private static class ColorEntry {
110110
* @return a description of the color
111111
*/
112112
public String getDisplay() {
113-
switch (info.getCategory()) {
114-
case NamedColorProperty.COLOR_CATEGORY_MAPPAINT:
115-
if (info.getSource() != null)
116-
return tr("Paint style {0}: {1}", tr(I18n.escape(info.getSource())), tr(info.getName()));
117-
// fall through
118-
default:
119-
if (info.getSource() != null)
120-
return tr(I18n.escape(info.getSource())) + " - " + tr(I18n.escape(info.getName()));
121-
else
122-
return tr(I18n.escape(info.getName()));
113+
if (info.getSource() != null) {
114+
if (info.getCategory() == NamedColorProperty.COLOR_CATEGORY_MAPPAINT)
115+
return tr("Paint style {0}: {1}", tr(I18n.escape(info.getSource())), tr(info.getName()));
116+
else
117+
return tr(I18n.escape(info.getSource())) + " - " + tr(I18n.escape(info.getName()));
123118
}
119+
else
120+
return tr(I18n.escape(info.getName()));
124121
}
125122

126123
/**

0 commit comments

Comments
 (0)