Index: trunk/src/org/openstreetmap/josm/actions/AboutAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AboutAction.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/actions/AboutAction.java	(revision 13824)
@@ -123,5 +123,5 @@
         // Get the list of Launchpad contributors using customary msgid “translator-credits”
         String translators = tr("translator-credits");
-        if (translators != null && !translators.isEmpty() && !translators.equals("translator-credits")) {
+        if (translators != null && !translators.isEmpty() && !"translator-credits".equals(translators)) {
             about.addTab(tr("Translators"), createScrollPane(new JosmTextArea(translators)));
         }
Index: trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 13824)
@@ -25,4 +25,5 @@
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
+import org.openstreetmap.josm.data.imagery.LayerDetails;
 import org.openstreetmap.josm.data.imagery.WMTSTileSource;
 import org.openstreetmap.josm.data.imagery.WMTSTileSource.WMTSGetCapabilitiesException;
@@ -204,12 +205,12 @@
 
             final String url = wms.buildGetMapUrl(
-                    tree.getSelectedLayers().stream().map(x -> x.getName()).collect(Collectors.toList()),
+                    tree.getSelectedLayers().stream().map(LayerDetails::getName).collect(Collectors.toList()),
                     (List<String>) null,
                     (String) formats.getSelectedItem(),
-                    true // TODO: ask the user if (s)he wants transparent layer
+                    true // TODO: ask the user if transparent layer is wanted
                     );
 
             String selectedLayers = tree.getSelectedLayers().stream()
-                    .map(x -> x.getName())
+                    .map(LayerDetails::getName)
                     .collect(Collectors.joining(", "));
             ImageryInfo ret = new ImageryInfo(info.getName() + selectedLayers,
Index: trunk/src/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelper.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/data/imagery/GetCapabilitiesParseHelper.java	(revision 13824)
@@ -126,5 +126,5 @@
             if (XMLStreamReader.START_ELEMENT == event) {
                 if (level > 0) {
-                    ret.append("<" + reader.getLocalName() +">");
+                    ret.append('<').append(reader.getLocalName()).append('>');
                 }
                 level += 1;
@@ -134,5 +134,5 @@
                     return ret.toString();
                 }
-                ret.append("</" + reader.getLocalName() +">");
+                ret.append("</").append(reader.getLocalName()).append('>');
             } else if (XMLStreamReader.CHARACTERS == event) {
                 ret.append(reader.getText());
Index: trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java	(revision 13824)
@@ -409,5 +409,5 @@
             modTileFeatures = i.isModTileFeatures();
             if (!i.defaultLayers.isEmpty()) {
-                default_layers = i.defaultLayers.stream().map(x -> x.toJson()).collect(JsonCollectors.toJsonArray()).toString();
+                default_layers = i.defaultLayers.stream().map(DefaultLayer::toJson).collect(JsonCollectors.toJsonArray()).toString();
             }
             customHttpHeaders = i.customHttpHeaders;
Index: trunk/src/org/openstreetmap/josm/data/imagery/LayerDetails.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/LayerDetails.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/data/imagery/LayerDetails.java	(revision 13824)
@@ -15,6 +15,6 @@
  */
 public class LayerDetails {
-    private Map<String, String> styles = new ConcurrentHashMap<>(); // name -> title
-    private Collection<String> crs = new ArrayList<>();
+    private final Map<String, String> styles = new ConcurrentHashMap<>(); // name -> title
+    private final Collection<String> crs = new ArrayList<>();
     /**
      * The layer name (WMS {@code Title})
@@ -30,5 +30,5 @@
      */
     private String abstr;
-    private LayerDetails parentLayer;
+    private final LayerDetails parentLayer;
     private Bounds bounds;
     private List<LayerDetails> children = new ArrayList<>();
Index: trunk/src/org/openstreetmap/josm/data/imagery/WMSEndpointTileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/WMSEndpointTileSource.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/data/imagery/WMSEndpointTileSource.java	(revision 13824)
@@ -24,11 +24,11 @@
  *
  * @author Wiktor Niesiobedzki
- *
+ * @since 13733
  */
 public class WMSEndpointTileSource extends AbstractWMSTileSource implements TemplatedTileSource {
 
     private final WMSImagery wmsi;
-    private List<DefaultLayer> layers;
-    private String urlPattern;
+    private final List<DefaultLayer> layers;
+    private final String urlPattern;
     private static final Pattern PATTERN_PARAM = Pattern.compile("\\{([^}]+)\\}");
     private final Map<String, String> headers = new ConcurrentHashMap<>();
Index: trunk/src/org/openstreetmap/josm/data/imagery/WMTSCapabilities.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/WMTSCapabilities.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/data/imagery/WMTSCapabilities.java	(revision 13824)
@@ -11,11 +11,10 @@
  *
  * @author Wiktor Niesiobedzki
- *
+ * @since 13733
  */
 public class WMTSCapabilities {
-    private String baseUrl;
-    private TransferMode transferMode;
+    private final String baseUrl;
+    private final TransferMode transferMode;
     private Collection<Layer> layers;
-
 
     /**
@@ -35,5 +34,4 @@
     public void addLayers(Collection<Layer> layers) {
         this.layers = layers;
-
     }
 
Index: trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 13824)
@@ -274,11 +274,9 @@
 
     private static final class SelectLayerDialog extends ExtendedDialog {
-        private final transient List<Entry<String, List<Layer>>> layers;
         private final WMTSLayerSelection list;
 
         SelectLayerDialog(Collection<Layer> layers) {
             super(Main.parent, tr("Select WMTS layer"), tr("Add layers"), tr("Cancel"));
-            this.layers = groupLayersByNameAndTileMatrixSet(layers);
-            this.list = new WMTSLayerSelection(this.layers);
+            this.list = new WMTSLayerSelection(groupLayersByNameAndTileMatrixSet(layers));
             setContent(list);
         }
@@ -296,5 +294,5 @@
     private TileMatrixSet currentTileMatrixSet;
     private double crsScale;
-    private GetCapabilitiesParseHelper.TransferMode transferMode;
+    private final GetCapabilitiesParseHelper.TransferMode transferMode;
 
     private ScaleList nativeScaleList;
@@ -329,5 +327,5 @@
             }
         } else {
-            this.defaultLayer = info.getDefaultLayers().iterator().next();
+            this.defaultLayer = info.getDefaultLayers().get(0);
         }
         if (this.layers.isEmpty())
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java	(revision 13824)
@@ -251,6 +251,8 @@
     @Override
     public void hideNotify() {
-        undoTreeModel.setRoot(undoRoot = new DefaultMutableTreeNode());
-        redoTreeModel.setRoot(redoRoot = new DefaultMutableTreeNode());
+        undoRoot = new DefaultMutableTreeNode();
+        redoRoot = new DefaultMutableTreeNode();
+        undoTreeModel.setRoot(undoRoot);
+        redoTreeModel.setRoot(redoRoot);
         MainApplication.undoRedo.removeCommandQueuePreciseListener(this);
     }
Index: trunk/src/org/openstreetmap/josm/gui/layer/imagery/WMTSLayerSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/imagery/WMTSLayerSelection.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/gui/layer/imagery/WMTSLayerSelection.java	(revision 13824)
@@ -84,9 +84,9 @@
     }
 
-    private List<Entry<String, List<Layer>>> layers;
-    private JTable list;
+    private final List<Entry<String, List<Layer>>> layers;
+    private final JTable list;
 
     /**
-     *
+     * Constructs a new {@code WMTSLayerSelection}.
      * @param layers list of grouped layers (by tileMatrixSet and name)
      */
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java	(revision 13824)
@@ -22,4 +22,5 @@
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
+import org.openstreetmap.josm.data.imagery.LayerDetails;
 import org.openstreetmap.josm.gui.bbox.SlippyMapBBoxChooser;
 import org.openstreetmap.josm.gui.util.GuiHelper;
@@ -154,5 +155,5 @@
         if (wms != null && wms.buildRootUrl() != null) {
             wmsUrl.setText(wms.buildGetMapUrl(
-                    tree.getSelectedLayers().stream().map(x -> x.getName()).collect(Collectors.toList()),
+                    tree.getSelectedLayers().stream().map(LayerDetails::getName).collect(Collectors.toList()),
                     (List<String>) null,
                     (String) formats.getSelectedItem(),
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanel.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMTSLayerPanel.java	(revision 13824)
@@ -7,6 +7,4 @@
 import java.io.IOException;
 import java.util.Collections;
-import java.util.List;
-import java.util.Map.Entry;
 
 import javax.swing.JButton;
@@ -30,5 +28,5 @@
  * Panel for adding WMTS imagery sources
  * @author Wiktor Niesiobędzki
- *
+ * @since 8568
  */
 public class AddWMTSLayerPanel extends AddImageryPanel {
@@ -36,6 +34,4 @@
     private transient WMTSLayerSelection layerTable;
     private final JCheckBox setDefaultLayer = new JCheckBox(tr("Set default layer?"));
-    private List<Entry<String, List<Layer>>> layers;
-    
 
     /**
@@ -68,6 +64,5 @@
             try {
                 WMTSCapabilities capabilities = WMTSTileSource.getCapabilities(rawUrl.getText(), getCommonHeaders());
-                layers = WMTSTileSource.groupLayersByNameAndTileMatrixSet(capabilities.getLayers());
-                layerTable = new WMTSLayerSelection(layers);
+                layerTable = new WMTSLayerSelection(WMTSTileSource.groupLayersByNameAndTileMatrixSet(capabilities.getLayers()));
                 layerTable.getTable().getSelectionModel().addListSelectionListener(lsl -> {
                     if (layerTable.getSelectedLayer() != null) {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/WMSLayerTree.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/WMSLayerTree.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/WMSLayerTree.java	(revision 13824)
@@ -76,5 +76,4 @@
      */
     public void updateTree(WMSImagery wms) {
-        // treeRootNode = new DefaultMutableTreeNode();
         while (treeRootNode.getChildCount() > 0) {
             treeRootNode.remove(0);
Index: trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java	(revision 13824)
@@ -170,5 +170,5 @@
         Roles lastrole = null;
         final List<Check> checks = new LinkedList<>();
-        List<ComboMultiSelect.PresetListEntry> listEntries = new LinkedList<>();
+        final List<ComboMultiSelect.PresetListEntry> listEntries = new LinkedList<>();
         final Map<String, List<Object>> byId = new HashMap<>();
         final Deque<String> lastIds = new ArrayDeque<>();
@@ -297,5 +297,5 @@
                             ((Key) o).value = ""; // Fix #8530
                         }
-                        listEntries = new LinkedList<>();
+                        listEntries.clear();
                         lastrole = null;
                     }
Index: trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 13824)
@@ -43,5 +43,4 @@
  */
 public class WMSImagery {
-
 
     private static final String CAPABILITIES_QUERY_STRING = "SERVICE=WMS&REQUEST=GetCapabilities";
@@ -120,9 +119,9 @@
     }
 
-    private Map<String, String> headers = new ConcurrentHashMap<>();
+    private final Map<String, String> headers = new ConcurrentHashMap<>();
     private String version = "1.1.1"; // default version
     private String getMapUrl;
     private URL capabilitiesUrl;
-    private List<String> formats = new ArrayList<>();
+    private final List<String> formats = new ArrayList<>();
     private List<LayerDetails> layers = new ArrayList<>();
 
@@ -283,5 +282,5 @@
         return buildGetMapUrl(
                 getLayers(selectedLayers),
-                selectedLayers.stream().map(x -> x.getStyle()).collect(Collectors.toList()),
+                selectedLayers.stream().map(DefaultLayer::getStyle).collect(Collectors.toList()),
                 transparent);
     }
@@ -296,5 +295,5 @@
     public String buildGetMapUrl(List<LayerDetails> selectedLayers, List<String> selectedStyles, boolean transparent) {
         return buildGetMapUrl(
-                selectedLayers.stream().map(x -> x.getName()).collect(Collectors.toList()),
+                selectedLayers.stream().map(LayerDetails::getName).collect(Collectors.toList()),
                 selectedStyles,
                 getPreferredFormat(),
@@ -504,5 +503,5 @@
      */
     public boolean belowWMS130() {
-        return this.version.equals("1.1.1") || this.version.equals("1.1") || this.version.equals("1.0");
+        return "1.1.1".equals(version) || "1.1".equals(version) || "1.0".equals(version);
     }
 
@@ -569,5 +568,5 @@
     }
 
-    private Bounds parseBBox(Projection conv, String miny, String minx, String maxy, String maxx) {
+    private static Bounds parseBBox(Projection conv, String miny, String minx, String maxy, String maxx) {
         if (miny == null || minx == null || maxy == null || maxx == null) {
             return null;
@@ -592,5 +591,5 @@
     }
 
-    private String normalizeUrl(String serviceUrlStr) throws MalformedURLException {
+    private static String normalizeUrl(String serviceUrlStr) throws MalformedURLException {
         URL getCapabilitiesUrl = null;
         String ret = null;
@@ -683,5 +682,4 @@
     }
 
-
     /**
      * @param defaultLayers default layers that should select layer object
@@ -689,5 +687,5 @@
      */
     public List<LayerDetails> getLayers(List<DefaultLayer> defaultLayers) {
-        Collection<String> layerNames = defaultLayers.stream().map(x -> x.getLayerName()).collect(Collectors.toList());
+        Collection<String> layerNames = defaultLayers.stream().map(DefaultLayer::getLayerName).collect(Collectors.toList());
         return layers.stream()
                 .flatMap(LayerDetails::flattened)
Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 13823)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 13824)
@@ -1175,5 +1175,5 @@
     }
 
-    private URL getImageUrl(String path, String name) {
+    private static URL getImageUrl(String path, String name) {
         if (path != null && path.startsWith("resource://")) {
             String p = path.substring("resource://".length());
@@ -1778,5 +1778,5 @@
      * @param enforceTransparency if {@code true}, makes sure to read image metadata and, if the image does not
      * provide an alpha channel but defines a {@code TransparentColor} metadata node, that the resulting image
-     * has a transparency set to {@code TRANSLUCENT} and uses the correct transparent color. For Java < 11 only.
+     * has a transparency set to {@code TRANSLUCENT} and uses the correct transparent color. For Java &lt; 11 only.
      *
      * @return a <code>BufferedImage</code> containing the decoded
