Index: trunk/src/org/openstreetmap/josm/actions/AboutAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AboutAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/AboutAction.java	(revision 18211)
@@ -140,5 +140,5 @@
         // Get the list of Launchpad contributors using customary msgid “translator-credits”
         String translators = tr("translator-credits");
-        if (translators != null && !translators.isEmpty() && !"translator-credits".equals(translators)) {
+        if (!Utils.isEmpty(translators) && !"translator-credits".equals(translators)) {
             about.addTab(tr("Translators"), createScrollPane(new JosmTextArea(translators)));
         }
@@ -211,5 +211,5 @@
         symbol.setFont(GuiHelper.getMonospacedFont(symbol));
         JosmTextArea dirLabel = new JosmTextArea();
-        if (dir != null && !dir.isEmpty()) {
+        if (!Utils.isEmpty(dir)) {
             dirLabel.setText(dir);
             dirLabel.setEditable(false);
Index: trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/AbstractInfoAction.java	(revision 18211)
@@ -19,4 +19,5 @@
 import org.openstreetmap.josm.tools.OpenBrowser;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -115,5 +116,5 @@
     @Override
     protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
-        setEnabled(selection != null && !selection.isEmpty());
+        setEnabled(!Utils.isEmpty(selection));
     }
 }
Index: trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 18211)
@@ -40,4 +40,5 @@
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -421,5 +422,5 @@
     protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
         if (AutoScaleMode.SELECTION == mode) {
-            setEnabled(selection != null && !selection.isEmpty());
+            setEnabled(!Utils.isEmpty(selection));
         }
     }
Index: trunk/src/org/openstreetmap/josm/actions/CopyAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/CopyAction.java	(revision 18211)
@@ -21,4 +21,5 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -70,5 +71,5 @@
     @Override
     protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
-        setEnabled(selection != null && !selection.isEmpty());
+        setEnabled(!Utils.isEmpty(selection));
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java	(revision 18211)
@@ -69,5 +69,5 @@
     protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
         updateEnabledStateOnModifiableSelection(selection);
-        if (isEnabled() && selection != null && !selection.isEmpty()
+        if (isEnabled() && !Utils.isEmpty(selection)
                 && DownloadPolicy.BLOCKED.equals(selection.iterator().next().getDataSet().getDownloadPolicy())) {
             setEnabled(false);
Index: trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java	(revision 18211)
@@ -37,4 +37,5 @@
 import org.openstreetmap.josm.tools.JosmDecimalFormatSymbolsProvider;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -328,5 +329,5 @@
         protected void buttonAction(int buttonIndex, ActionEvent evt) {
             restoreOldMode = true;
-            if (buttonIndex == 0 && tBookmarkName.getText() != null && !tBookmarkName.getText().isEmpty() &&
+            if (buttonIndex == 0 && !Utils.isEmpty(tBookmarkName.getText()) &&
                     OffsetBookmark.getBookmarkByName(layer, tBookmarkName.getText()) != null &&
                     !confirmOverwriteBookmark()) {
@@ -346,5 +347,5 @@
                 if (getValue() != 1) {
                     layer.getDisplaySettings().setOffsetBookmark(old);
-                } else if (tBookmarkName.getText() != null && !tBookmarkName.getText().isEmpty()) {
+                } else if (!Utils.isEmpty(tBookmarkName.getText())) {
                     OffsetBookmark.bookmarkOffset(tBookmarkName.getText(), layer);
                 }
Index: trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java	(revision 18211)
@@ -12,4 +12,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -77,5 +78,5 @@
      */
     public boolean canExtend() {
-        return outerNodes != null && !outerNodes.isEmpty();
+        return !Utils.isEmpty(outerNodes);
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java	(revision 18211)
@@ -135,5 +135,5 @@
 
         private void addLayers() {
-            if (layers != null && !layers.isEmpty()) {
+            if (!Utils.isEmpty(layers)) {
                 boolean noMap = MainApplication.getMap() == null;
                 for (Layer l : layers) {
Index: trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java	(revision 18211)
@@ -51,4 +51,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -384,5 +385,5 @@
             UndoRedoHandler.getInstance().add(result);
             List<? extends PrimitiveId> newSel = result.getNewSelection();
-            if (newSel != null && !newSel.isEmpty()) {
+            if (!Utils.isEmpty(newSel)) {
                 way.getDataSet().setSelected(newSel);
             }
Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 18211)
@@ -502,5 +502,5 @@
                 }
                 String remark = dataSet.getRemark();
-                if (remark != null && !remark.isEmpty()) {
+                if (!Utils.isEmpty(remark)) {
                     rememberErrorMessage(remark);
                 }
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java	(revision 18211)
@@ -20,4 +20,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -78,5 +79,5 @@
         }
         String input = dialog.getInputText();
-        if (input != null && !input.isEmpty()) {
+        if (!Utils.isEmpty(input)) {
             LatLon latlon = map.mapView.getLatLon(e.getPoint().x, e.getPoint().y);
             noteData.createNote(latlon, input);
Index: trunk/src/org/openstreetmap/josm/actions/relation/AddSelectionToRelations.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/relation/AddSelectionToRelations.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/relation/AddSelectionToRelations.java	(revision 18211)
@@ -70,5 +70,5 @@
 
     private void selectionChanged(final Collection<? extends IPrimitive> newSelection) {
-        GuiHelper.runInEDT(() -> setEnabled(newSelection != null && !newSelection.isEmpty()
+        GuiHelper.runInEDT(() -> setEnabled(!Utils.isEmpty(newSelection)
                 && OsmUtils.isOsmCollectionEditable(relations)));
     }
Index: trunk/src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java	(revision 18211)
@@ -39,4 +39,5 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.tools.SubclassFilteredCollection;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -214,5 +215,5 @@
     public void setPrimitives(Collection<? extends IPrimitive> primitives) {
         relations = Collections.<Relation>emptySet();
-        if (primitives != null && !primitives.isEmpty()) {
+        if (!Utils.isEmpty(primitives)) {
             relations = new SubclassFilteredCollection<>(primitives,
                 r -> r instanceof Relation && r.hasTag("type", Arrays.asList("route", "superroute")));
Index: trunk/src/org/openstreetmap/josm/data/UserIdentityManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/UserIdentityManager.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/UserIdentityManager.java	(revision 18211)
@@ -217,5 +217,5 @@
         String credentialsUserName = CredentialsManager.getInstance().getUsername();
         if (isAnonymous()) {
-            if (credentialsUserName != null && !credentialsUserName.trim().isEmpty()) {
+            if (!Utils.isBlank(credentialsUserName)) {
                 setPartiallyIdentified(credentialsUserName);
             }
Index: trunk/src/org/openstreetmap/josm/data/Version.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Version.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/Version.java	(revision 18211)
@@ -178,5 +178,5 @@
         int v = getVersion();
         String s = (v == JOSM_UNKNOWN_VERSION) ? "UNKNOWN" : Integer.toString(v);
-        if (buildName != null && !buildName.isEmpty()) {
+        if (!Utils.isEmpty(buildName)) {
             s += ' ' + buildName;
         }
Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java	(revision 18211)
@@ -197,5 +197,5 @@
         if (wp != null) {
             String value = wp.getString(GpxConstants.PT_ELE);
-            if (value != null && !value.isEmpty()) {
+            if (!Utils.isEmpty(value)) {
                 try {
                     return Double.valueOf(value);
Index: trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java	(revision 18211)
@@ -15,4 +15,5 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.StreamUtils;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -38,5 +39,5 @@
     public GpxTrack(Collection<Collection<WayPoint>> trackSegs, Map<String, Object> attributes) {
         this.segments = trackSegs.stream()
-                .filter(trackSeg -> trackSeg != null && !trackSeg.isEmpty())
+                .filter(trackSeg -> !Utils.isEmpty(trackSeg))
                 .map(GpxTrackSegment::new)
                 .collect(StreamUtils.toUnmodifiableList());
Index: trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 18211)
@@ -278,13 +278,13 @@
                 projections = String.join(",", i.serverProjections);
             }
-            if (i.noTileHeaders != null && !i.noTileHeaders.isEmpty()) {
+            if (!Utils.isEmpty(i.noTileHeaders)) {
                 noTileHeaders = new MultiMap<>(i.noTileHeaders);
             }
 
-            if (i.noTileChecksums != null && !i.noTileChecksums.isEmpty()) {
+            if (!Utils.isEmpty(i.noTileChecksums)) {
                 noTileChecksums = new MultiMap<>(i.noTileChecksums);
             }
 
-            if (i.metadataHeaders != null && !i.metadataHeaders.isEmpty()) {
+            if (!Utils.isEmpty(i.metadataHeaders)) {
                 metadataHeaders = i.metadataHeaders;
             }
@@ -363,5 +363,5 @@
         if (t != null) {
             this.sourceType = t;
-        } else if (type != null && !type.isEmpty()) {
+        } else if (!Utils.isEmpty(type)) {
             throw new IllegalArgumentException("unknown type: "+type);
         }
@@ -411,5 +411,5 @@
             }
         }
-        if (e.projections != null && !e.projections.isEmpty()) {
+        if (!Utils.isEmpty(e.projections)) {
             // split generates null element on empty string which gives one element Array[null]
             setServerProjections(Arrays.asList(e.projections.split(",", -1)));
@@ -717,5 +717,5 @@
         boolean html = false;
         String dateStr = getDate();
-        if (dateStr != null && !dateStr.isEmpty()) {
+        if (!Utils.isEmpty(dateStr)) {
             html = addNewLineInTooltip(res, tr("Date of imagery: {0}", dateStr), htmlSupported);
         }
@@ -730,5 +730,5 @@
         }
         String desc = getDescription();
-        if (desc != null && !desc.isEmpty()) {
+        if (!Utils.isEmpty(desc)) {
             html = addNewLineInTooltip(res, desc, htmlSupported);
         }
Index: trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java	(revision 18211)
@@ -333,5 +333,5 @@
     // some additional checks to respect extended URLs in preferences (legacy workaround)
     private static boolean isSimilar(String a, String b) {
-        return Objects.equals(a, b) || (a != null && b != null && !a.isEmpty() && !b.isEmpty() && (a.contains(b) || b.contains(a)));
+        return Objects.equals(a, b) || (!Utils.isEmpty(a) && !Utils.isEmpty(b) && (a.contains(b) || b.contains(a)));
     }
 
Index: trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java	(revision 18211)
@@ -142,5 +142,5 @@
         if (isNotImage(headers, statusCode)) {
             String message = detectErrorMessage(new String(content, StandardCharsets.UTF_8));
-            if (message != null && !message.isEmpty()) {
+            if (!Utils.isEmpty(message)) {
                 tile.setError(message);
             }
Index: trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java	(revision 18211)
@@ -1,6 +1,4 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.data.imagery.vectortile.mapbox.style;
-
-import org.openstreetmap.josm.gui.mappaint.StyleKeys;
 
 import java.awt.Font;
@@ -22,4 +20,7 @@
 import javax.json.JsonString;
 import javax.json.JsonValue;
+
+import org.openstreetmap.josm.gui.mappaint.StyleKeys;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -267,5 +268,5 @@
         if (layoutObject.containsKey("icon-image")) {
             sb.append(/* NO-ICON */"icon-image:concat(");
-            if (this.styleId != null && !this.styleId.trim().isEmpty()) {
+            if (!Utils.isBlank(this.styleId)) {
                 sb.append('"').append(this.styleId).append('/').append("\",");
             }
Index: trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyle.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/MapboxVectorStyle.java	(revision 18211)
@@ -37,4 +37,5 @@
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -141,5 +142,5 @@
                 this.sources.put(source, new ElemStyles(Collections.singleton(style)));
             }
-            if (this.spriteUrl != null && !this.spriteUrl.trim().isEmpty()) {
+            if (!Utils.isBlank(this.spriteUrl)) {
                 MainApplication.worker.execute(this::fetchSprites);
             }
Index: trunk/src/org/openstreetmap/josm/data/osm/Tagged.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/Tagged.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/osm/Tagged.java	(revision 18211)
@@ -8,4 +8,6 @@
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
+
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -111,6 +113,5 @@
      */
     default boolean hasTag(String key) {
-        String v = get(key);
-        return v != null && !v.isEmpty();
+        return !Utils.isEmpty(get(key));
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java	(revision 18211)
@@ -32,4 +32,5 @@
 import org.openstreetmap.josm.tools.Geometry.AreaAndPerimeter;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -100,17 +101,17 @@
             Collection<String> literals;
             literals = Config.getPref().getList(PREF_KEY_OUTER_ROLES);
-            if (literals != null && !literals.isEmpty()) {
+            if (!Utils.isEmpty(literals)) {
                 setNormalized(literals, outerExactRoles);
             }
             literals = Config.getPref().getList(PREF_KEY_OUTER_ROLE_PREFIXES);
-            if (literals != null && !literals.isEmpty()) {
+            if (!Utils.isEmpty(literals)) {
                 setNormalized(literals, outerRolePrefixes);
             }
             literals = Config.getPref().getList(PREF_KEY_INNER_ROLES);
-            if (literals != null && !literals.isEmpty()) {
+            if (!Utils.isEmpty(literals)) {
                 setNormalized(literals, innerExactRoles);
             }
             literals = Config.getPref().getList(PREF_KEY_INNER_ROLE_PREFIXES);
-            if (literals != null && !literals.isEmpty()) {
+            if (!Utils.isEmpty(literals)) {
                 setNormalized(literals, innerRolePrefixes);
             }
Index: trunk/src/org/openstreetmap/josm/data/preferences/NamedColorProperty.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/preferences/NamedColorProperty.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/preferences/NamedColorProperty.java	(revision 18211)
@@ -10,4 +10,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.ColorHelper;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -84,5 +85,5 @@
     public Color get() {
         List<String> data = getPreferences().getList(getKey(), getDefaultValuePref()); // store default value
-        if (super.isSet() && data != null && !data.isEmpty()) {
+        if (super.isSet() && !Utils.isEmpty(data)) {
             return ColorHelper.html2color(data.get(0));
         }
Index: trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Proj4DirGridShiftFileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Proj4DirGridShiftFileSource.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2Proj4DirGridShiftFileSource.java	(revision 18211)
@@ -51,5 +51,5 @@
         if (grid == null) {
             String projLib = Utils.getSystemProperty("PROJ_LIB");
-            if (projLib != null && !projLib.isEmpty()) {
+            if (!Utils.isEmpty(projLib)) {
                 File dir = new File(projLib);
                 if (dir.exists() && dir.isDirectory()) {
Index: trunk/src/org/openstreetmap/josm/data/sources/SourceInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/sources/SourceInfo.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/sources/SourceInfo.java	(revision 18211)
@@ -502,5 +502,5 @@
         }
         return entries.stream()
-                .filter(prefEntry -> prefEntry.id != null && !prefEntry.id.isEmpty())
+                .filter(prefEntry -> !Utils.isEmpty(prefEntry.id))
                 .map(prefEntry -> prefEntry.id)
                 .sorted()
@@ -517,5 +517,5 @@
         boolean html = false;
         String dateStr = getDate();
-        if (dateStr != null && !dateStr.isEmpty()) {
+        if (!Utils.isEmpty(dateStr)) {
             res.append("<br>").append(tr("Date of imagery: {0}", dateStr));
             html = true;
@@ -526,5 +526,5 @@
         }
         String desc = getDescription();
-        if (desc != null && !desc.isEmpty()) {
+        if (!Utils.isEmpty(desc)) {
             res.append("<br>").append(Utils.escapeReservedCharactersHTML(desc));
             html = true;
Index: trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 18211)
@@ -392,5 +392,5 @@
             DefaultMutableTreeNode branch;
 
-            if (description != null && !description.isEmpty()) {
+            if (!Utils.isEmpty(description)) {
                 trunk = inTree(root, description);
                 branch = inTree(trunk, key);
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java	(revision 18211)
@@ -297,5 +297,5 @@
     private static String findURLTitle(String url) {
         for (SourceEntry source : new ValidatorPrefHelper().get()) {
-            if (url.equals(source.url) && source.title != null && !source.title.isEmpty()) {
+            if (url.equals(source.url) && !Utils.isEmpty(source.title)) {
                 return source.title;
             }
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java	(revision 18211)
@@ -240,5 +240,5 @@
                 continue;
             Set<String> values = TaggingPresets.getPresetValues(key);
-            boolean allNumerical = values != null && !values.isEmpty()
+            boolean allNumerical = !Utils.isEmpty(values)
                     && values.stream().allMatch(TagChecker::isNum);
             if (allNumerical) {
@@ -428,5 +428,5 @@
      */
     static boolean containsUnwantedNonPrintingControlCharacter(String s) {
-        return s != null && !s.isEmpty() && (
+        return !Utils.isEmpty(s) && (
                 isJoiningChar(s.charAt(0)) ||
                 isJoiningChar(s.charAt(s.length() - 1)) ||
@@ -640,5 +640,5 @@
                 checkSingleTagComplex(withErrors, p, key, value);
             }
-            if (checkFixmes && key != null && value != null && !value.isEmpty() && isFixme(key, value) && !withErrors.contains(p, "FIXME")) {
+            if (checkFixmes && key != null && !Utils.isEmpty(value) && isFixme(key, value) && !withErrors.contains(p, "FIXME")) {
                 errors.add(TestError.builder(this, Severity.OTHER, FIXME)
                         .message(tr("fixme"))
Index: trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/data/validation/util/MultipleNameVisitor.java	(revision 18211)
@@ -13,4 +13,5 @@
 import org.openstreetmap.josm.data.preferences.IntegerProperty;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -44,5 +45,5 @@
         for (OsmPrimitive osm : data) {
             String name = osm.getDisplayName(DefaultNameFormatter.getInstance());
-            if (name != null && !name.isEmpty() && multipleName.length() <= MULTIPLE_NAME_MAX_LENGTH.get()) {
+            if (!Utils.isEmpty(name) && multipleName.length() <= MULTIPLE_NAME_MAX_LENGTH.get()) {
                 if (multipleName.length() > 0) {
                     multipleName.append(", ");
Index: trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 18211)
@@ -509,5 +509,5 @@
     @Override
     public final boolean toggleCheckState() {
-        toggleable = togglePref != null && !togglePref.isEmpty();
+        toggleable = !Utils.isEmpty(togglePref);
         toggleValue = ConditionalOptionPaneUtil.getDialogReturnValue(togglePref);
         return toggleable && toggleValue != -1;
Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 18211)
@@ -195,5 +195,5 @@
 
         private void updateText() {
-            if (customText != null && !customText.isEmpty()) {
+            if (!Utils.isEmpty(customText)) {
                 progressBar.setToolTipText(tr("{0} ({1})", title, customText));
             } else {
@@ -234,5 +234,5 @@
         @Override
         public void appendLogMessage(String message) {
-            if (message != null && !message.isEmpty()) {
+            if (!Utils.isEmpty(message)) {
                 Logging.info("appendLogMessage not implemented for background tasks. Message was: " + message);
             }
Index: trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 18211)
@@ -76,4 +76,5 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.bugreport.BugReport;
 
@@ -819,5 +820,5 @@
     public String getLayerInformationForSourceTag() {
         return layerManager.getVisibleLayersInZOrder().stream()
-                .filter(layer -> layer.getChangesetSourceTag() != null && !layer.getChangesetSourceTag().trim().isEmpty())
+                .filter(layer -> !Utils.isBlank(layer.getChangesetSourceTag()))
                 .map(layer -> layer.getChangesetSourceTag().trim())
                 .distinct()
Index: trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 18211)
@@ -1345,5 +1345,5 @@
                     return ws;
                 }
-                if (preferredRefs != null && !preferredRefs.isEmpty()) {
+                if (!Utils.isEmpty(preferredRefs)) {
                     // prefer ways containing given nodes
                     if (preferredRefs.contains(ws.getFirstNode()) || preferredRefs.contains(ws.getSecondNode())) {
Index: trunk/src/org/openstreetmap/josm/gui/SplashScreen.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/SplashScreen.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/SplashScreen.java	(revision 18211)
@@ -234,5 +234,5 @@
         @Override
         public void beginTask(String title) {
-            if (title != null && !title.isEmpty()) {
+            if (!Utils.isEmpty(title)) {
                 Logging.debug(title);
                 final MeasurableTask task = new MeasurableTask(title);
Index: trunk/src/org/openstreetmap/josm/gui/bbox/JosmMapViewer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bbox/JosmMapViewer.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/bbox/JosmMapViewer.java	(revision 18211)
@@ -30,4 +30,5 @@
 import org.openstreetmap.josm.gui.layer.TMSLayer;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -77,5 +78,5 @@
                 Logging.trace(ex);
                 Logging.warn(ex.getMessage());
-                if (ex.getMessage() != null && !ex.getMessage().isEmpty()) {
+                if (!Utils.isEmpty(ex.getMessage())) {
                     new Notification(ex.getMessage()).setIcon(JOptionPane.WARNING_MESSAGE).show();
                 }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java	(revision 18211)
@@ -295,5 +295,5 @@
 
     private void setOkEnabled(boolean b) {
-        if (buttons != null && !buttons.isEmpty()) {
+        if (!Utils.isEmpty(buttons)) {
             buttons.get(0).setEnabled(b);
         }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 18211)
@@ -588,5 +588,5 @@
          */
         public void setSelectedRelations(Collection<? extends IRelation<?>> sel) {
-            if (sel != null && !sel.isEmpty()) {
+            if (!Utils.isEmpty(sel)) {
                 if (!getVisibleRelations().containsAll(sel)) {
                     resetFilter();
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 18211)
@@ -75,4 +75,5 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -953,5 +954,5 @@
         }
         add(data, BorderLayout.CENTER);
-        if (!buttons.isEmpty() && buttons.get(0) != null && !buttons.get(0).isEmpty()) {
+        if (!buttons.isEmpty() && !Utils.isEmpty(buttons.get(0))) {
             buttonsPanel = new JPanel(new GridLayout(buttons.size(), 1));
             for (Collection<SideButton> buttonRow : buttons) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/HelpAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/HelpAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/HelpAction.java	(revision 18211)
@@ -87,5 +87,5 @@
         }
 
-        if (type != null && !type.isEmpty()) {
+        if (!Utils.isEmpty(type)) {
             pages.add(String.format("%sRelation:%s", lang, type));
             pages.add(String.format("Relation:%s", type));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java	(revision 18211)
@@ -994,5 +994,5 @@
         return presets.stream()
                 .map(preset -> preset.suggestRoleForOsmPrimitive(p))
-                .filter(role -> role != null && !role.isEmpty())
+                .filter(role -> !Utils.isEmpty(role))
                 .collect(Collectors.toSet());
     }
Index: trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java	(revision 18211)
@@ -204,5 +204,5 @@
             );
             b.setArea(currentArea);
-            if (b.getName() != null && !b.getName().isEmpty()) {
+            if (!Utils.isEmpty(b.getName())) {
                 ((DefaultListModel<BookmarkList.Bookmark>) bookmarks.getModel()).addElement(b);
                 bookmarks.save();
Index: trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetDialog.java	(revision 18211)
@@ -12,5 +12,4 @@
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
 
 import javax.swing.AbstractAction;
@@ -32,4 +31,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.InputMapUtils;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -128,6 +128,5 @@
 
         protected void refreshEnabledState() {
-            List<Changeset> list = lstOpenChangesets.getSelectedValuesList();
-            setEnabled(list != null && !list.isEmpty());
+            setEnabled(!Utils.isEmpty(lstOpenChangesets.getSelectedValuesList()));
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java	(revision 18211)
@@ -184,5 +184,5 @@
     private String makePathFit(String t) {
         boolean hasEllipsis = false;
-        while (t != null && !t.isEmpty()) {
+        while (!Utils.isEmpty(t)) {
             int txtwidth = lblFilename.getFontMetrics(lblFilename.getFont()).stringWidth(t);
             if (txtwidth < lblFilename.getWidth() || t.lastIndexOf(File.separator) < ELLIPSIS.length()) {
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java	(revision 18211)
@@ -25,4 +25,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.StreamUtils;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -167,5 +168,5 @@
                 .orElse("");
         final String html = Stream.of(buildChangesetSummary(), buildChangesetSummary2(), buildStrategySummary(), server)
-                .filter(s -> s != null && !s.isEmpty())
+                .filter(s -> !Utils.isEmpty(s))
                 .collect(StreamUtils.toHtmlList());
         jepMessage.setText(html);
Index: trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java	(revision 18211)
@@ -312,5 +312,5 @@
             String commentText = comment.getText();
             //closing a note creates an empty comment that we don't want to show
-            if (commentText != null && !commentText.trim().isEmpty()) {
+            if (!Utils.isBlank(commentText)) {
                 sb.append("<hr/>");
                 String userName = XmlWriter.encode(comment.getUser().getName());
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 18211)
@@ -40,4 +40,5 @@
 import org.openstreetmap.josm.tools.ImageProcessor;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -792,5 +793,5 @@
             errorMessage = null;
         }
-        if (errorMessage != null && !errorMessage.trim().isEmpty()) {
+        if (!Utils.isBlank(errorMessage)) {
             Rectangle2D errorStringSize = g.getFontMetrics(g.getFont()).getStringBounds(errorMessage, g);
             if (Boolean.TRUE.equals(ERROR_MESSAGE_BACKGROUND.get())) {
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertFromGpxLayerAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertFromGpxLayerAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/ConvertFromGpxLayerAction.java	(revision 18211)
@@ -157,5 +157,5 @@
         for (GpxExtension ext : exts) {
             String value = ext.getValue();
-            if (value != null && !value.isEmpty()) {
+            if (!Utils.isEmpty(value)) {
                 String extpre = "extension:";
                 String pre = ext.getPrefix();
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java	(revision 18211)
@@ -124,6 +124,6 @@
     private void importAudio(File audioFile, MarkerLayer ml, double firstStartTime, Markers markers) {
         URL url = Utils.fileToURL(audioFile);
-        boolean hasTracks = layer.data.tracks != null && !layer.data.tracks.isEmpty();
-        boolean hasWaypoints = layer.data.waypoints != null && !layer.data.waypoints.isEmpty();
+        boolean hasTracks = !Utils.isEmpty(layer.data.tracks);
+        boolean hasWaypoints = !Utils.isEmpty(layer.data.waypoints);
         Collection<WayPoint> waypoints = new ArrayList<>();
         boolean timedMarkersOmitted = false;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 18211)
@@ -437,5 +437,5 @@
             final Set<PluginInformation> toDownload = preference.getPluginsScheduledForUpdateOrDownload();
             final PluginDownloadTask task;
-            if (toDownload != null && !toDownload.isEmpty()) {
+            if (!Utils.isEmpty(toDownload)) {
                 task = new PluginDownloadTask(this, toDownload, tr("Download plugins"));
             } else {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java	(revision 18211)
@@ -21,4 +21,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.SubclassFilteredCollection;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -44,5 +45,5 @@
     @Override
     public List<String> getData() {
-        return new ArrayList<>(SubclassFilteredCollection.filter(model.getData(), object -> object != null && !object.isEmpty()));
+        return new ArrayList<>(SubclassFilteredCollection.filter(model.getData(), object -> !Utils.isEmpty(object)));
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java	(revision 18211)
@@ -696,5 +696,5 @@
         putPref("colormode.heatmap.lower-limit", colorTypeHeatMapLowerLimit.getValue());
 
-        if (!global && layers != null && !layers.isEmpty()) {
+        if (!global && !Utils.isEmpty(layers)) {
             layers.forEach(l -> l.data.invalidate());
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryProvidersPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryProvidersPanel.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryProvidersPanel.java	(revision 18211)
@@ -369,5 +369,5 @@
                 int viewIndex = defaultTable.convertRowIndexToView(i);
                 List<Shape> shapes = bounds.getShapes();
-                if (shapes != null && !shapes.isEmpty()) {
+                if (!Utils.isEmpty(shapes)) {
                     if (defaultTable.getSelectionModel().isSelectedIndex(viewIndex)) {
                         if (!mapPolygons.containsKey(i)) {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java	(revision 18211)
@@ -32,4 +32,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -169,5 +170,5 @@
             final MapCSSStyleSource css = new MapCSSStyleSource(entry);
             css.loadStyleSource();
-            if (css.title != null && !css.title.isEmpty()) {
+            if (!Utils.isEmpty(css.title)) {
                 return css.title;
             }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java	(revision 18211)
@@ -137,5 +137,5 @@
             final PluginCheckBox cbPlugin = new PluginCheckBox(pi, selected, this, model);
             String pluginText = tr("{0}: Version {1} (local: {2})", pi.getName(), remoteversion, localversion);
-            if (pi.requires != null && !pi.requires.isEmpty()) {
+            if (!Utils.isEmpty(pi.requires)) {
                 pluginText += tr(" (requires: {0})", pi.requires);
             }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java	(revision 18211)
@@ -63,4 +63,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -556,5 +557,5 @@
                             JOptionPane.QUESTION_MESSAGE
                             );
-                    if (s != null && !s.isEmpty()) {
+                    if (!Utils.isEmpty(s)) {
                         model.addElement(s);
                     }
@@ -582,5 +583,5 @@
                             list.getSelectedValue()
                             );
-                    if (s != null && !s.isEmpty()) {
+                    if (!Utils.isEmpty(s)) {
                         model.setElementAt(s, list.getSelectedIndex());
                     }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java	(revision 18211)
@@ -16,4 +16,5 @@
 import org.openstreetmap.josm.data.projection.Projection;
 import org.openstreetmap.josm.data.projection.Projections;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -78,5 +79,5 @@
     @Override
     public void setPreferences(Collection<String> args) {
-        if (args != null && !args.isEmpty()) {
+        if (!Utils.isEmpty(args)) {
             code = args.iterator().next();
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java	(revision 18211)
@@ -31,4 +31,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -187,5 +188,5 @@
     @Override
     public void setPreferences(Collection<String> args) {
-        if (args != null && !args.isEmpty()) {
+        if (!Utils.isEmpty(args)) {
             pref = args.iterator().next();
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java	(revision 18211)
@@ -70,5 +70,5 @@
     public void setPreferences(Collection<String> args) {
         String zone = null;
-        if (args != null && !args.isEmpty()) {
+        if (!Utils.isEmpty(args)) {
             zone = args.iterator().next();
         }
Index: trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionManager.java	(revision 18211)
@@ -291,5 +291,5 @@
         CheckParameterUtil.ensureParameterNotNull(list, "list");
         Collection<TaggingPreset> presets = r != null ? TaggingPresets.getMatchingPresets(null, r.getKeys(), false) : null;
-        if (r != null && presets != null && !presets.isEmpty()) {
+        if (r != null && !Utils.isEmpty(presets)) {
             for (TaggingPreset tp : presets) {
                 if (tp.roles != null) {
@@ -481,5 +481,5 @@
                     tagCache = null;
                     roleCache = null;
-                    ds = null;                    
+                    ds = null;
                 }
             }
Index: trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/AbstractIdTextField.java	(revision 18211)
@@ -6,4 +6,5 @@
 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -80,5 +81,5 @@
      */
     public boolean tryToPasteFrom(String contents) {
-        if (contents != null && !contents.trim().isEmpty()) {
+        if (!Utils.isBlank(contents)) {
             setText(contents.trim());
             clearTextIfInvalid();
Index: trunk/src/org/openstreetmap/josm/gui/widgets/ChangesetIdTextField.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/ChangesetIdTextField.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/ChangesetIdTextField.java	(revision 18211)
@@ -7,4 +7,5 @@
 
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -74,5 +75,5 @@
         public boolean readChangesetId() {
             String value = getComponent().getText();
-            if (value != null && !value.trim().isEmpty()) {
+            if (!Utils.isBlank(value)) {
                 value = value.trim();
                 id = 0;
Index: trunk/src/org/openstreetmap/josm/gui/widgets/EditableList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/EditableList.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/EditableList.java	(revision 18211)
@@ -20,4 +20,5 @@
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -66,5 +67,5 @@
                     title,
                     JOptionPane.QUESTION_MESSAGE);
-            if (source != null && !source.isEmpty()) {
+            if (!Utils.isEmpty(source)) {
                 ((DefaultListModel<String>) sourcesList.getModel()).addElement(source);
             }
@@ -81,5 +82,5 @@
                 if (sourcesList.getModel().getSize() == 0) {
                     String source1 = JOptionPane.showInputDialog(MainApplication.getMainFrame(), title, title, JOptionPane.QUESTION_MESSAGE);
-                    if (source1 != null && !source1.isEmpty()) {
+                    if (!Utils.isEmpty(source1)) {
                         ((DefaultListModel<String>) sourcesList.getModel()).addElement(source1);
                     }
@@ -98,5 +99,5 @@
                         JOptionPane.QUESTION_MESSAGE, null, null,
                         sourcesList.getSelectedValue());
-                if (source2 != null && !source2.isEmpty()) {
+                if (!Utils.isEmpty(source2)) {
                     ((DefaultListModel<String>) sourcesList.getModel()).setElementAt(source2, row);
                 }
Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmTextField.java	(revision 18211)
@@ -20,4 +20,5 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.tools.Destroyable;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -192,5 +193,5 @@
             icon.paintIcon(this, g, Math.min(leftInsets, h / 2), h / 2);
         }
-        if (hint != null && !hint.isEmpty() && getText().isEmpty() && !isFocusOwner()) {
+        if (!Utils.isEmpty(hint) && getText().isEmpty() && !isFocusOwner()) {
             // Taken from http://stackoverflow.com/a/24571681/2257172
             int h = getHeight();
Index: trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java	(revision 18211)
@@ -92,5 +92,5 @@
 
     protected final void refresh() {
-        if (url != null && !url.isEmpty()) {
+        if (!Utils.isEmpty(url)) {
             refresh("<html><a color=\"" + JosmEditorPane.getLinkColor() + "\" href=\"" + url + "\">" + description + "</a></html>",
                     Cursor.getPredefinedCursor(Cursor.HAND_CURSOR),
@@ -147,5 +147,5 @@
     @Override
     public void mouseClicked(MouseEvent e) {
-        if (url != null && !url.isEmpty()) {
+        if (!Utils.isEmpty(url)) {
             if (SwingUtilities.isLeftMouseButton(e)) {
                 OpenBrowser.displayUrl(url);
Index: trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/DefaultProxySelector.java	(revision 18211)
@@ -142,5 +142,5 @@
         httpProxySocketAddress = null;
         if (proxyPolicy == ProxyPolicy.USE_HTTP_PROXY) {
-            if (host != null && !host.trim().isEmpty() && port > 0) {
+            if (!Utils.isBlank(host) && port > 0) {
                 httpProxySocketAddress = new InetSocketAddress(host, port);
             } else {
@@ -154,5 +154,5 @@
         socksProxySocketAddress = null;
         if (proxyPolicy == ProxyPolicy.USE_SOCKS_PROXY) {
-            if (host != null && !host.trim().isEmpty() && port > 0) {
+            if (!Utils.isBlank(host) && port > 0) {
                 socksProxySocketAddress = new InetSocketAddress(host, port);
             } else {
Index: trunk/src/org/openstreetmap/josm/io/GpxReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 18211)
@@ -32,4 +32,5 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.UncheckedParseException;
+import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.XmlUtils;
 import org.openstreetmap.josm.tools.date.DateUtils;
@@ -661,5 +662,5 @@
                         message += '.';
                 }
-                if (parser.data.creator != null && !parser.data.creator.trim().isEmpty()) {
+                if (!Utils.isBlank(parser.data.creator)) {
                     message += "\n" + tr("The file was created by \"{0}\".", parser.data.creator);
                 }
Index: trunk/src/org/openstreetmap/josm/io/GpxWriter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxWriter.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/GpxWriter.java	(revision 18211)
@@ -36,4 +36,5 @@
 import org.openstreetmap.josm.tools.JosmRuntimeException;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -134,5 +135,5 @@
 
         for (XMLNamespace n : namespaces) {
-            if (n.getURI() != null && n.getPrefix() != null && !n.getPrefix().isEmpty()) {
+            if (n.getURI() != null && !Utils.isEmpty(n.getPrefix())) {
                 out.println(String.format("    xmlns:%s=\"%s\"", n.getPrefix(), n.getURI()));
                 if (n.getLocation() != null) {
@@ -323,5 +324,5 @@
      */
     private void simpleTag(String tag, String content) {
-        if (content != null && !content.isEmpty()) {
+        if (!Utils.isEmpty(content)) {
             open(tag);
             out.print(encode(content));
@@ -332,5 +333,5 @@
 
     private void simpleTag(String tag, String content, String attributes) {
-        if (content != null && !content.isEmpty()) {
+        if (!Utils.isEmpty(content)) {
             open(tag, attributes);
             out.print(encode(content));
Index: trunk/src/org/openstreetmap/josm/io/MessageNotifier.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/MessageNotifier.java	(revision 18211)
@@ -149,5 +149,5 @@
                         String username = Config.getPref().get("osm-server.username", null);
                         String password = Config.getPref().get("osm-server.password", null);
-                        return username != null && !username.isEmpty() && password != null && !password.isEmpty();
+                        return !Utils.isEmpty(username) && !Utils.isEmpty(password);
                     }
                 } else {
@@ -157,5 +157,5 @@
                         String username = credentials.getUsername();
                         char[] password = credentials.getPassword();
-                        return username != null && !username.isEmpty() && password != null && password.length > 0;
+                        return !Utils.isEmpty(username) && password != null && password.length > 0;
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/io/OsmApiException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmApiException.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/OsmApiException.java	(revision 18211)
@@ -218,8 +218,8 @@
             sb.append(tr("The server replied an error with code {0}.", responseCode));
         } else {
-            if (header != null && !header.isEmpty()) {
+            if (!Utils.isEmpty(header)) {
                 sb.append(tr(header));
             }
-            if (body != null && !body.isEmpty() && !body.equals(header)) {
+            if (!Utils.isEmpty(body) && !body.equals(header)) {
                 if (sb.length() > 0) {
                     sb.append(". ");
Index: trunk/src/org/openstreetmap/josm/io/OsmChangeReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmChangeReader.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/OsmChangeReader.java	(revision 18211)
@@ -16,4 +16,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.tools.Pair;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -122,5 +123,5 @@
             }
         }
-        if (location != null && text != null && !text.isEmpty()) {
+        if (location != null && !Utils.isEmpty(text)) {
             noteData.createNote(location, text);
         }
Index: trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java	(revision 18211)
@@ -265,6 +265,6 @@
         boolean javaDur = false;
         if (matcher.matches()) {
-            javaPer = matcher.group(1) != null && !matcher.group(1).isEmpty();
-            javaDur = matcher.group(3) != null && !matcher.group(3).isEmpty();
+            javaPer = !Utils.isEmpty(matcher.group(1));
+            javaDur = !Utils.isEmpty(matcher.group(3));
             duration = 'P' + matcher.group(1).replace('X', 'M') + matcher.group(2);
             if (javaDur) {
Index: trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java	(revision 18211)
@@ -12,4 +12,5 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -128,5 +129,5 @@
         if (requestorType == RequestorType.SERVER && Objects.equals(OsmApi.getOsmApi().getHost(), host)) {
             String username = credentials.getUserName();
-            if (username != null && !username.trim().isEmpty()) {
+            if (!Utils.isBlank(username)) {
                 UserIdentityManager.getInstance().setPartiallyIdentified(username);
             }
Index: trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 18211)
@@ -705,5 +705,5 @@
             String name, List<LayerDetails> selectedLayers, List<String> selectedStyles, String format, boolean transparent) {
         ImageryInfo i = new ImageryInfo(name, buildGetMapUrl(selectedLayers, selectedStyles, format, transparent));
-        if (selectedLayers != null && !selectedLayers.isEmpty()) {
+        if (!selectedLayers.isEmpty()) {
             i.setServerProjections(getServerProjections(selectedLayers));
         }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 18211)
@@ -456,5 +456,5 @@
             usage.append("<li>")
                  .append(handler.getKey());
-            if (sample.getUsage() != null && !sample.getUsage().isEmpty()) {
+            if (!Utils.isEmpty(sample.getUsage())) {
                 usage.append(" &mdash; <i>").append(sample.getUsage()).append("</i>");
             }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java	(revision 18211)
@@ -86,5 +86,5 @@
         // For user-friendliness, let's try to decode these OSM API calls to give a better confirmation message.
         Set<String> taskMessages = new LinkedHashSet<>();
-        if (suitableDownloadTasks != null && !suitableDownloadTasks.isEmpty()) {
+        if (!Utils.isEmpty(suitableDownloadTasks)) {
             for (DownloadTask task : suitableDownloadTasks) {
                 taskMessages.add(Utils.firstNonNull(task.getConfirmationMessage(url), url.toString()));
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java	(revision 18211)
@@ -343,5 +343,5 @@
     private <T> T get(String key, Function<String, T> parser, Supplier<T> defaultSupplier) {
         String val = args.get(key);
-        return val != null && !val.isEmpty() ? parser.apply(val) : defaultSupplier.get();
+        return !Utils.isEmpty(val) ? parser.apply(val) : defaultSupplier.get();
     }
 
Index: trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 18211)
@@ -1141,5 +1141,5 @@
                 plugins = buildListOfPluginsToLoad(parent, monitor.createSubTaskMonitor(1, false));
                 // If only some plugins have to be updated, filter the list
-                if (pluginsWanted != null && !pluginsWanted.isEmpty()) {
+                if (!Utils.isEmpty(pluginsWanted)) {
                     final Collection<String> pluginsWantedName = Utils.transform(pluginsWanted, piw -> piw.name);
                     plugins = SubclassFilteredCollection.filter(plugins, pi -> pluginsWantedName.contains(pi.name));
@@ -1594,5 +1594,5 @@
             PluginInformation pi = pp.getPluginInformation();
             pl.remove(pi.name);
-            pl.add(pi.name + " (" + (pi.localversion != null && !pi.localversion.isEmpty()
+            pl.add(pi.name + " (" + (!Utils.isEmpty(pi.localversion)
                     ? pi.localversion : "unknown") + ')');
         }
@@ -1608,5 +1608,5 @@
         for (final PluginInformation info : getPlugins()) {
             String name = info.name
-            + (info.localversion != null && !info.localversion.isEmpty() ? " Version: " + info.localversion : "");
+            + (!Utils.isEmpty(info.localversion) ? " Version: " + info.localversion : "");
             pluginTab.add(new JLabel(name), GBC.std());
             pluginTab.add(Box.createHorizontalGlue(), GBC.std().fill(GBC.HORIZONTAL));
Index: trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 18211)
@@ -261,5 +261,5 @@
         stage = stageStr == null ? 50 : Integer.parseInt(stageStr);
         version = attr.getValue("Plugin-Version");
-        if (version != null && !version.isEmpty() && version.charAt(0) == '$') {
+        if (!Utils.isEmpty(version) && version.charAt(0) == '$') {
             invalidManifestEntries.add("Plugin-Version");
         }
Index: trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 18211)
@@ -225,5 +225,5 @@
             }
             panel.add(new JLabel("<html><body width=\"500\"><b>"+b.toString().trim()+"</b></body></html>"), GBC.eol().insets(0, 0, 0, 10));
-            if (details != null && !details.isEmpty()) {
+            if (!Utils.isEmpty(details)) {
                 panel.add(new JLabel(tr("Details:")), GBC.eol().insets(0, 0, 0, 10));
                 JosmTextArea area = new JosmTextArea(details);
Index: trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java	(revision 18211)
@@ -313,5 +313,5 @@
         String msg = e.getDisplayMessage();
 
-        if (msg != null && !msg.isEmpty()) {
+        if (!Utils.isEmpty(msg)) {
             return tr("<html>"
                     + "Authorisation at the OSM server failed.<br>"
Index: trunk/src/org/openstreetmap/josm/tools/HttpClient.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/tools/HttpClient.java	(revision 18211)
@@ -147,5 +147,5 @@
                 }
                 cr = performConnection();
-                final boolean hasReason = reasonForRequest != null && !reasonForRequest.isEmpty();
+                final boolean hasReason = !Utils.isEmpty(reasonForRequest);
                 logRequest("{0} {1}{2} -> {3} {4} ({5}{6})",
                         getRequestMethod(), getURL(), hasReason ? (" (" + reasonForRequest + ')') : "",
Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 18211)
@@ -898,5 +898,5 @@
                 String cacheName = prefix + fullName;
                 /* cache separately */
-                if (dirs != null && !dirs.isEmpty()) {
+                if (!Utils.isEmpty(dirs)) {
                     cacheName = "id:" + id + ':' + fullName;
                     if (archive != null) {
@@ -1956,8 +1956,8 @@
     public String toString() {
         return ("ImageProvider ["
-                + (dirs != null && !dirs.isEmpty() ? "dirs=" + dirs + ", " : "") + (id != null ? "id=" + id + ", " : "")
-                + (subdir != null && !subdir.isEmpty() ? "subdir=" + subdir + ", " : "") + "name=" + name + ", "
+                + (!Utils.isEmpty(dirs) ? "dirs=" + dirs + ", " : "") + (id != null ? "id=" + id + ", " : "")
+                + (!Utils.isEmpty(subdir) ? "subdir=" + subdir + ", " : "") + "name=" + name + ", "
                 + (archive != null ? "archive=" + archive + ", " : "")
-                + (inArchiveDir != null && !inArchiveDir.isEmpty() ? "inArchiveDir=" + inArchiveDir : "") + ']').replaceAll(", \\]", "]");
+                + (!Utils.isEmpty(inArchiveDir) ? "inArchiveDir=" + inArchiveDir : "") + ']').replaceAll(", \\]", "]");
     }
 }
Index: trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java	(revision 18211)
@@ -306,5 +306,5 @@
         if (c.isEmpty())
             c = null;
-        if (v != null && !v.isEmpty()) {
+        if (!Utils.isEmpty(v)) {
             if (c != null)
                 list.add(lang+'_'+c+'@'+v);
Index: trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 18211)
@@ -156,5 +156,5 @@
                     try {
                         String version = Utils.execOutput(Arrays.asList(args));
-                        if (version != null && !version.isEmpty()) {
+                        if (!Utils.isEmpty(version)) {
                             return packageName + ':' + version;
                         }
@@ -240,5 +240,5 @@
                 // see https://www.linuxbase.org/lsb-cert/productdir.php?by_prod )
                 String line = exec("lsb_release", "-ds");
-                if (line != null && !line.isEmpty()) {
+                if (!Utils.isEmpty(line)) {
                     line = line.replaceAll("\"+", "");
                     line = line.replace("NAME=", ""); // strange code for some Gentoo's
@@ -262,5 +262,5 @@
                 }) {
                     String description = info.extractDescription();
-                    if (description != null && !description.isEmpty()) {
+                    if (!Utils.isEmpty(description)) {
                         return "Linux " + description;
                     }
@@ -356,5 +356,5 @@
             }
             // Append prefix if any
-            if (result != null && !result.isEmpty() && prefix != null && !prefix.isEmpty()) {
+            if (!Utils.isEmpty(result) && !Utils.isEmpty(prefix)) {
                 result = prefix + result;
             }
@@ -390,5 +390,5 @@
         } else {
             String xdgCacheDir = getSystemEnv("XDG_CACHE_HOME");
-            if (xdgCacheDir != null && !xdgCacheDir.isEmpty()) {
+            if (!Utils.isEmpty(xdgCacheDir)) {
                 return new File(xdgCacheDir, Preferences.getJOSMDirectoryBaseName());
             } else {
@@ -405,5 +405,5 @@
         } else {
             String xdgConfigDir = getSystemEnv("XDG_CONFIG_HOME");
-            if (xdgConfigDir != null && !xdgConfigDir.isEmpty()) {
+            if (!Utils.isEmpty(xdgConfigDir)) {
                 return new File(xdgConfigDir, Preferences.getJOSMDirectoryBaseName());
             } else {
@@ -420,5 +420,5 @@
         } else {
             String xdgDataDir = getSystemEnv("XDG_DATA_HOME");
-            if (xdgDataDir != null && !xdgDataDir.isEmpty()) {
+            if (!Utils.isEmpty(xdgDataDir)) {
                 return new File(xdgDataDir, Preferences.getJOSMDirectoryBaseName());
             } else {
Index: trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java	(revision 18209)
+++ trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java	(revision 18211)
@@ -23,4 +23,5 @@
 import org.openstreetmap.josm.data.osm.search.SearchCompiler.Or;
 import org.openstreetmap.josm.data.osm.search.SearchCompiler.Parent;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -369,5 +370,5 @@
         if (dataProvider instanceof OsmPrimitive) {
             List<OsmPrimitive> primitives = context.getPrimitives((OsmPrimitive) dataProvider);
-            if (primitives != null && !primitives.isEmpty()) {
+            if (!Utils.isEmpty(primitives)) {
                 template.appendText(result, primitives.get(0));
             }
@@ -380,5 +381,5 @@
         if (dataProvider instanceof OsmPrimitive) {
             List<OsmPrimitive> primitives = context.getPrimitives((OsmPrimitive) dataProvider);
-            if (primitives != null && !primitives.isEmpty()) {
+            if (!Utils.isEmpty(primitives)) {
                 return template.isValid(primitives.get(0));
             }
