Index: trunk/src/org/openstreetmap/josm/actions/CloseChangesetAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/CloseChangesetAction.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/actions/CloseChangesetAction.java	(revision 18871)
@@ -36,5 +36,5 @@
 /**
  * User action to close open changesets.
- *
+ * <p>
  * The list of open changesets will be downloaded from the server and presented
  * to the user.
@@ -110,9 +110,10 @@
         protected void finish() {
             SwingUtilities.invokeLater(() -> {
-                            if (lastException != null) {
-                                ExceptionDialogUtil.explainException(lastException);
+                            Exception exception = getLastException();
+                            if (exception != null) {
+                                ExceptionDialogUtil.explainException(exception);
                             }
                             ChangesetCache.getInstance().update(changesets);
-                            if (!canceled && lastException == null) {
+                            if (!isCanceled() && exception == null) {
                                 onPostDownloadOpenChangesets();
                             }
Index: trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java	(revision 18871)
@@ -246,5 +246,5 @@
 
     /**
-     * This hepler class implements algorithm traversing trough connected ways.
+     * This helper class implements algorithm traversing through connected ways.
      * Assumes you are going in clockwise orientation.
      * @author viesturs
Index: trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 18871)
@@ -275,5 +275,5 @@
             if (Utils.isEmpty(files)) return;
 
-            /**
+            /*
              * Find the importer with the chosen file filter
              */
@@ -286,5 +286,5 @@
                 }
             }
-            /**
+            /*
              * If the filter hasn't been changed in the dialog, chosenImporter is null now.
              * When the filter has been set explicitly to AllFormatsImporter, treat this the same.
Index: trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 18871)
@@ -269,5 +269,5 @@
      */
     static Map<String, String> getAnonimicDirectorySymbolMap() {
-        /** maps the anonymized name to the actual used path */
+        /* maps the anonymized name to the actual used path */
         Map<String, String> map = new LinkedHashMap<>();
         map.put(PlatformManager.isPlatformWindows() ? "%JAVA_HOME%" : "${JAVA_HOME}", getSystemEnv("JAVA_HOME"));
Index: trunk/src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 18871)
@@ -73,25 +73,25 @@
 
     static {
-        /**
+        /*
          * Calls validator before upload.
          */
         UPLOAD_HOOKS.add(new ValidateUploadHook());
 
-        /**
+        /*
          * Fixes database errors
          */
         UPLOAD_HOOKS.add(new FixDataHook());
 
-        /**
+        /*
          * Checks server capabilities before upload.
          */
         UPLOAD_HOOKS.add(new ApiPreconditionCheckerHook());
 
-        /**
+        /*
          * Adjusts the upload order of new relations
          */
         UPLOAD_HOOKS.add(new RelationUploadOrderHook());
 
-        /**
+        /*
          * Removes discardable tags like created_by on modified objects
          */
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java	(revision 18871)
@@ -56,33 +56,28 @@
 /**
  * MapMode for making parallel ways.
- *
+ * <p>
  * All calculations are done in projected coordinates.
- *
+ * <p>
  * TODO:
+ * <p>
  * == Functionality ==
- *
- * 1. Use selected nodes as split points for the selected ways.
- *
+ * <ol>
+ * <li>Use selected nodes as split points for the selected ways.
+ * <p>
  * The ways containing the selected nodes will be split and only the "inner"
- * parts will be copied
- *
- * 2. Enter exact offset
- *
- * 3. Improve snapping
- *
- * 4. Visual cues could be better
- *
- * 5. (long term) Parallelize and adjust offsets of existing ways
- *
+ * parts will be copied</li>
+ * <li>Enter exact offset</li>
+ * <li>Improve snapping</li>
+ * <li>Visual cues could be better</li>
+ * <li>(long term) Parallelize and adjust offsets of existing ways</li>
+ * </ol>
  * == Code quality ==
- *
- * a) The mode, flags, and modifiers might be updated more than necessary.
- *
- * Not a performance problem, but better if they where more centralized
- *
- * b) Extract generic MapMode services into a super class and/or utility class
- *
- * c) Maybe better to simply draw our own source way highlighting?
- *
+ * <ol type="a">
+ * <li>The mode, flags, and modifiers might be updated more than necessary.
+ * <p>
+ * Not a performance problem, but better if they where more centralized</li>
+ * <li>Extract generic MapMode services into a super class and/or utility class</li>
+ * <li>Maybe better to simply draw our own source way highlighting?</li>
+ * </ol>
  * Current code doesn't not take into account that ways might been highlighted
  * by other than us. Don't think that situation should ever happen though.
@@ -352,5 +347,5 @@
     @Override
     public void mouseDragged(MouseEvent e) {
-        // WTF.. the event passed here doesn't have button info?
+        // WTF... the event passed here doesn't have button info?
         // Since we get this event from other buttons too, we must check that
         // _BUTTON1_ is down.
@@ -456,5 +451,5 @@
             modifiers.add(Modifier.SHIFT);
         }
-        return spec.entrySet().stream().allMatch(entry -> modifiers.contains(entry.getKey()) == entry.getValue().booleanValue());
+        return spec.entrySet().stream().allMatch(entry -> modifiers.contains(entry.getKey()) == entry.getValue());
     }
 
@@ -465,9 +460,9 @@
 
     private void updateFlagsOnlyChangeableOnPress() {
-        copyTags = COPY_TAGS_DEFAULT.get().booleanValue() != matchesCurrentModifiers(COPY_TAGS_MODIFIER_COMBO);
+        copyTags = COPY_TAGS_DEFAULT.get() != matchesCurrentModifiers(COPY_TAGS_MODIFIER_COMBO);
     }
 
     private void updateFlagsChangeableAlways() {
-        snap = SNAP_DEFAULT.get().booleanValue() != matchesCurrentModifiers(SNAP_MODIFIER_COMBO);
+        snap = SNAP_DEFAULT.get() != matchesCurrentModifiers(SNAP_MODIFIER_COMBO);
     }
 
@@ -554,5 +549,5 @@
 
         KeyboardModifiersProperty(String key, String defaultValue) {
-            super(key, createFromString(defaultValue));
+            this(key, createFromString(defaultValue));
         }
 
Index: trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 18871)
@@ -42,4 +42,5 @@
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel;
+import org.openstreetmap.josm.gui.widgets.JosmComboBoxModel;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
@@ -66,8 +67,8 @@
     private static final String SEARCH_EXPRESSION = "searchExpression";
 
-    private static AutoCompComboBoxModel<SearchSetting> model = new AutoCompComboBoxModel<>();
+    private static final AutoCompComboBoxModel<SearchSetting> model = new AutoCompComboBoxModel<>();
 
     /** preferences reader/writer with automatic transmogrification to and from String */
-    private static AutoCompComboBoxModel<SearchSetting>.Preferences prefs = model.prefs(
+    private static final JosmComboBoxModel<SearchSetting>.Preferences prefs = model.prefs(
             SearchSetting::readFromString, SearchSetting::writeToString);
 
@@ -491,5 +492,5 @@
     @Override
     public List<ActionParameter<?>> getActionParameters() {
-        return Collections.<ActionParameter<?>>singletonList(new SearchSettingsActionParameter(SEARCH_EXPRESSION));
+        return Collections.singletonList(new SearchSettingsActionParameter(SEARCH_EXPRESSION));
     }
 }
Index: trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/PurgeCommand.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/command/PurgeCommand.java	(revision 18871)
@@ -61,5 +61,5 @@
 
     private void init(Collection<OsmPrimitive> toPurge, Collection<OsmPrimitive> makeIncomplete) {
-        /**
+        /*
          * The topological sort is to avoid missing way nodes and missing
          * relation members when adding primitives back to the dataset on undo.
@@ -160,5 +160,5 @@
         Set<OsmPrimitive> remainingNodes = new HashSet<>(in.size());
 
-        /**
+        /*
          *  First add nodes that have no way referrer.
          */
@@ -180,5 +180,5 @@
             }
 
-        /**
+        /*
          * Then add all ways, each preceded by its (remaining) nodes.
          */
Index: trunk/src/org/openstreetmap/josm/data/Bounds.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Bounds.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/Bounds.java	(revision 18871)
@@ -553,7 +553,6 @@
      */
     public String encodeAsString(String separator) {
-        return new StringBuilder()
-          .append(minLat).append(separator).append(minLon).append(separator)
-          .append(maxLat).append(separator).append(maxLon).toString();
+        return minLat + separator + minLon + separator +
+                maxLat + separator + maxLon;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/StructUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/StructUtils.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/StructUtils.java	(revision 18871)
@@ -20,4 +20,12 @@
 import java.util.stream.Collectors;
 
+import org.openstreetmap.josm.spi.preferences.IPreferences;
+import org.openstreetmap.josm.tools.JosmRuntimeException;
+import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.MultiMap;
+import org.openstreetmap.josm.tools.ReflectionUtils;
+import org.openstreetmap.josm.tools.StringParser;
+import org.openstreetmap.josm.tools.Utils;
+
 import jakarta.json.Json;
 import jakarta.json.JsonArray;
@@ -30,15 +38,7 @@
 import jakarta.json.JsonWriter;
 
-import org.openstreetmap.josm.spi.preferences.IPreferences;
-import org.openstreetmap.josm.tools.JosmRuntimeException;
-import org.openstreetmap.josm.tools.Logging;
-import org.openstreetmap.josm.tools.MultiMap;
-import org.openstreetmap.josm.tools.ReflectionUtils;
-import org.openstreetmap.josm.tools.StringParser;
-import org.openstreetmap.josm.tools.Utils;
-
 /**
  * Utility methods to convert struct-like classes to a string map and back.
- *
+ * <p>
  * A "struct" is a class that has some fields annotated with {@link StructEntry}.
  * Those fields will be respected when converting an object to a {@link Map} and back.
@@ -107,8 +107,8 @@
     /**
      * Convenience method that saves a MapListSetting which is provided as a collection of objects.
-     *
+     * <p>
      * Each object is converted to a <code>Map&lt;String, String&gt;</code> using the fields with {@link StructEntry} annotation.
      * The field name is the key and the value will be converted to a string.
-     *
+     * <p>
      * Considers only fields that have the {@code @StructEntry} annotation.
      * In addition it does not write fields with null values. (Thus they are cleared)
@@ -149,9 +149,9 @@
     /**
      * Convert an object to a String Map, by using field names and values as map key and value.
-     *
+     * <p>
      * The field value is converted to a String.
-     *
+     * <p>
      * Only fields with annotation {@link StructEntry} are taken into account.
-     *
+     * <p>
      * Fields will not be written to the map if the value is null or unchanged
      * (compared to an object created with the no-arg-constructor).
@@ -164,5 +164,5 @@
      * @return the resulting map (same data content as <code>struct</code>)
      */
-    public static <T> HashMap<String, String> serializeStruct(T struct, Class<T> klass, SerializeOptions... options) {
+    public static <T> Map<String, String> serializeStruct(T struct, Class<T> klass, SerializeOptions... options) {
         List<SerializeOptions> optionsList = Arrays.asList(options);
         T structPrototype;
@@ -173,5 +173,5 @@
         }
 
-        HashMap<String, String> hash = new LinkedHashMap<>();
+        Map<String, String> hash = new LinkedHashMap<>();
         for (Field f : getDeclaredFieldsInClassOrSuperTypes(klass)) {
             if (f.getAnnotation(StructEntry.class) == null) {
@@ -208,8 +208,8 @@
      * Converts a String-Map to an object of a certain class, by comparing map keys to field names of the class and assigning
      * map values to the corresponding fields.
-     *
+     * <p>
      * The map value (a String) is converted to the field type. Supported types are: boolean, Boolean, int, Integer, double,
      * Double, String, Map&lt;String, String&gt; and Map&lt;String, List&lt;String&gt;&gt;.
-     *
+     * <p>
      * Only fields with annotation {@link StructEntry} are taken into account.
      * @param <T> the class
@@ -219,5 +219,5 @@
      */
     public static <T> T deserializeStruct(Map<String, String> hash, Class<T> klass) {
-        T struct = null;
+        T struct;
         try {
             struct = klass.getConstructor().newInstance();
@@ -284,5 +284,5 @@
     @SuppressWarnings({ "rawtypes", "unchecked" })
     private static Map mapFromJson(String s) {
-        Map ret = null;
+        Map ret;
         try (JsonReader reader = Json.createReader(new StringReader(s))) {
             JsonObject object = reader.readObject();
@@ -322,5 +322,5 @@
     @SuppressWarnings({ "rawtypes", "unchecked" })
     private static MultiMap multiMapFromJson(String s) {
-        MultiMap ret = null;
+        MultiMap ret;
         try (JsonReader reader = Json.createReader(new StringReader(s))) {
             JsonObject object = reader.readObject();
Index: trunk/src/org/openstreetmap/josm/data/imagery/AbstractWMSTileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/AbstractWMSTileSource.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/imagery/AbstractWMSTileSource.java	(revision 18871)
@@ -232,13 +232,11 @@
 
     private static String getBboxstr(double x1, double x2, double x3, double x4) {
-        return new StringBuilder(64)
-                .append(LATLON_FORMAT.format(x1))
-                .append(',')
-                .append(LATLON_FORMAT.format(x2))
-                .append(',')
-                .append(LATLON_FORMAT.format(x3))
-                .append(',')
-                .append(LATLON_FORMAT.format(x4))
-                .toString();
+        return LATLON_FORMAT.format(x1) +
+                ',' +
+                LATLON_FORMAT.format(x2) +
+                ',' +
+                LATLON_FORMAT.format(x3) +
+                ',' +
+                LATLON_FORMAT.format(x4);
     }
 }
Index: trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 18871)
@@ -28,4 +28,5 @@
 import java.util.Collections;
 import java.util.Deque;
+import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
@@ -231,5 +232,5 @@
         /**
          * Get title of the layer for user display.
-         *
+         * <p>
          * This is either the content of the Title element (if available) or
          * the layer identifier (as fallback)
@@ -507,5 +508,5 @@
      */
     private static Collection<Layer> parseContents(XMLStreamReader reader) throws XMLStreamException {
-        Map<String, TileMatrixSet> matrixSetById = new ConcurrentHashMap<>();
+        Map<String, TileMatrixSet> matrixSetById = new HashMap<>();
         Collection<Layer> layers = new ArrayList<>();
         for (int event = reader.getEventType();
@@ -900,8 +901,8 @@
                 .replace("{TileRow}", Integer.toString(tiley))
                 .replace("{TileCol}", Integer.toString(tilex))
-                .replaceAll("(?i)\\{style\\}", this.currentLayer.style);
+                .replaceAll("(?i)\\{style}", this.currentLayer.style);
 
         for (Dimension d : currentLayer.dimensions) {
-            url = url.replaceAll("(?i)\\{"+d.identifier+"\\}", d.defaultValue);
+            url = url.replaceAll("(?i)\\{"+d.identifier+"}", d.defaultValue);
         }
 
Index: trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Expression.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Expression.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Expression.java	(revision 18871)
@@ -20,5 +20,4 @@
     /** An empty expression to use */
     public static final Expression EMPTY_EXPRESSION = new Expression(JsonValue.NULL);
-    private static final String EMPTY_STRING = "";
 
     private final String mapcssFilterExpression;
@@ -38,11 +37,11 @@
                     this.mapcssFilterExpression = convertToString(array.get(1)) + array.getString(0) + convertToString(array.get(2));
                 } else {
-                    this.mapcssFilterExpression = EMPTY_STRING;
+                    this.mapcssFilterExpression = "";
                 }
             } else {
-                this.mapcssFilterExpression = EMPTY_STRING;
+                this.mapcssFilterExpression = "";
             }
         } else {
-            this.mapcssFilterExpression = EMPTY_STRING;
+            this.mapcssFilterExpression = "";
         }
     }
@@ -75,5 +74,5 @@
         case NULL:
         default:
-            return EMPTY_STRING;
+            return "";
         }
     }
@@ -81,5 +80,5 @@
     @Override
     public String toString() {
-        return !EMPTY_STRING.equals(this.mapcssFilterExpression) ? '[' + this.mapcssFilterExpression + ']' : EMPTY_STRING;
+        return !"".equals(this.mapcssFilterExpression) ? '[' + this.mapcssFilterExpression + ']' : "";
     }
 
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 18870)
+++ trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java	(revision 18871)
@@ -15,4 +15,7 @@
 import java.util.stream.Stream;
 
+import org.openstreetmap.josm.gui.mappaint.StyleKeys;
+import org.openstreetmap.josm.tools.Utils;
+
 import jakarta.json.JsonArray;
 import jakarta.json.JsonNumber;
@@ -20,7 +23,4 @@
 import jakarta.json.JsonString;
 import jakarta.json.JsonValue;
-
-import org.openstreetmap.josm.gui.mappaint.StyleKeys;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -59,5 +59,4 @@
     }
 
-    private static final String EMPTY_STRING = "";
     private static final char SEMI_COLON = ';';
     private static final Pattern CURLY_BRACES = Pattern.compile("(\\{(.*?)})");
@@ -148,11 +147,11 @@
                     break;
                 default:
-                    this.paintProperties = EMPTY_STRING;
+                    this.paintProperties = "";
                 }
             } else {
-                this.paintProperties = EMPTY_STRING;
+                this.paintProperties = "";
             }
         } else {
-            this.paintProperties = EMPTY_STRING;
+            this.paintProperties = "";
         }
         this.sourceLayer = layerInfo.getString("source-layer", null);
@@ -358,5 +357,5 @@
         if (layoutObject.containsKey("text-field")) {
             sb.append(StyleKeys.TEXT).append(':')
-              .append(layoutObject.getString("text-field").replace("}", EMPTY_STRING).replace("{", EMPTY_STRING))
+              .append(layoutObject.getString("text-field").replace("}", "").replace("{", ""))
               .append(SEMI_COLON);
         }
@@ -461,5 +460,5 @@
     public String toString() {
         if (this.filter.toString().isEmpty() && this.paintProperties.isEmpty()) {
-            return EMPTY_STRING;
+            return "";
         } else if (this.type == Type.BACKGROUND) {
             // AFAIK, paint has no zoom levels, and doesn't accept a layer
@@ -477,5 +476,5 @@
             zoomSelector = MessageFormat.format("|z{0}-{1}", this.minZoom, this.maxZoom);
         } else {
-            zoomSelector = EMPTY_STRING;
+            zoomSelector = "";
         }
         final String commonData = zoomSelector + this.filter.toString() + "::" + this.id + "{" + this.paintProperties + "}";
Index: trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 18871)
@@ -316,4 +316,6 @@
      * @return list of history entries
      */
+    // This needs to return something like a Sequenced Collection (Java 21)
+    @SuppressWarnings({"NonApiType", "squid:S1319"})
     public LinkedList<Collection<? extends OsmPrimitive>> getSelectionHistory() {
         return selectionHistory;
Index: trunk/src/org/openstreetmap/josm/data/osm/NodePair.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/NodePair.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/osm/NodePair.java	(revision 18871)
@@ -76,11 +76,9 @@
     @Override
     public String toString() {
-        return new StringBuilder()
-        .append('[')
-        .append(a.getId())
-        .append(',')
-        .append(b.getId())
-        .append(']')
-        .toString();
+        return "[" +
+                a.getId() +
+                ',' +
+                b.getId() +
+                ']';
     }
 
Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java	(revision 18871)
@@ -125,27 +125,27 @@
             this.flags = flags;
 
-            long order = 0;
+            long styleOrder = 0;
             if ((this.flags & FLAG_DISABLED) == 0) {
-                order |= 1;
-            }
-
-            order <<= 24;
-            order |= floatToFixed(this.style.majorZIndex, 24);
+                styleOrder |= 1;
+            }
+
+            styleOrder <<= 24;
+            styleOrder |= floatToFixed(this.style.majorZIndex, 24);
 
             // selected on top of member of selected on top of unselected
             // FLAG_DISABLED bit is the same at this point, but we simply ignore it
-            order <<= 4;
-            order |= this.flags & 0xf;
-
-            order <<= 24;
-            order |= floatToFixed(this.style.zIndex, 24);
-
-            order <<= 1;
+            styleOrder <<= 4;
+            styleOrder |= this.flags & 0xf;
+
+            styleOrder <<= 24;
+            styleOrder |= floatToFixed(this.style.zIndex, 24);
+
+            styleOrder <<= 1;
             // simple node on top of icons and shapes
             if (DefaultStyles.SIMPLE_NODE_ELEMSTYLE.equals(this.style)) {
-                order |= 1;
-            }
-
-            this.order = order;
+                styleOrder |= 1;
+            }
+
+            this.order = styleOrder;
         }
 
@@ -245,5 +245,5 @@
     /**
      * Check, if this System has the GlyphVector double translation bug.
-     *
+     * <p>
      * With this bug, <code>gv.setGlyphTransform(i, trfm)</code> has a different
      * effect than on most other systems, namely the translation components
@@ -251,7 +251,7 @@
      * they actually are. The rotation is unaffected (scale &amp; shear not tested
      * so far).
-     *
+     * <p>
      * This bug has only been observed on Mac OS X, see #7841.
-     *
+     * <p>
      * After switch to Java 7, this test is a false positive on Mac OS X (see #10446),
      * i.e. it returns true, but the real rendering code does not require any special
@@ -586,5 +586,5 @@
      * Determine, if partial fill should be turned off for this object, because
      * only a small unfilled gap in the center of the area would be left.
-     *
+     * <p>
      * This is used to get a cleaner look for urban regions with many small
      * areas like buildings, etc.
@@ -623,5 +623,5 @@
         double x = p.getInViewX() + bs.xOffset;
         double y = p.getInViewY() + bs.yOffset;
-        /**
+        /*
          *
          *       left-above __center-above___ right-above
@@ -1017,5 +1017,5 @@
             INode firstNode = viaWay.firstNode();
             INode lastNode = viaWay.lastNode();
-            Boolean onewayvia = Boolean.FALSE;
+            boolean onewayvia = Boolean.FALSE;
 
             String onewayviastr = viaWay.get("oneway");
@@ -1423,5 +1423,5 @@
         isOutlineOnly = paintSettings.isOutlineOnly();
 
-        antialiasing = PREFERENCE_ANTIALIASING_USE.get() ?
+        antialiasing = Boolean.TRUE.equals(PREFERENCE_ANTIALIASING_USE.get()) ?
                         RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF;
         g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, antialiasing);
@@ -1484,10 +1484,10 @@
     /**
      * Fix the clipping area of unclosed polygons for partial fill.
-     *
+     * <p>
      * The current algorithm for partial fill simply strokes the polygon with a
      * large stroke width after masking the outside with a clipping area.
      * This works, but for unclosed polygons, the mask can crop the corners at
      * both ends (see #12104).
-     *
+     * <p>
      * This method fixes the clipping area by sort of adding the corners to the
      * clip outline.
@@ -1532,5 +1532,5 @@
     /**
      * Get the point to add to the clipping area for partial fill of unclosed polygons.
-     *
+     * <p>
      * <code>(p1,p2)</code> is the first or last way segment and <code>p3</code> the
      * opposite endpoint.
@@ -1693,6 +1693,6 @@
             }
 
-            for (StyleRecord record : sorted) {
-                paintRecord(record);
+            for (StyleRecord styleRecord : sorted) {
+                paintRecord(styleRecord);
             }
 
@@ -1710,9 +1710,9 @@
     }
 
-    private void paintRecord(StyleRecord record) {
+    private void paintRecord(StyleRecord styleRecord) {
         try {
-            record.paintPrimitive(paintSettings, this);
+            styleRecord.paintPrimitive(paintSettings, this);
         } catch (RuntimeException e) {
-            throw BugReport.intercept(e).put("record", record);
+            throw BugReport.intercept(e).put("record", styleRecord);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2SubGrid.java	(revision 18871)
@@ -311,28 +311,26 @@
      */
     public String getDetails() {
-        return new StringBuilder(256)
-            .append("Sub Grid : ")
-            .append(subGridName)
-            .append("\nParent   : ")
-            .append(parentSubGridName)
-            .append("\nCreated  : ")
-            .append(created)
-            .append("\nUpdated  : ")
-            .append(updated)
-            .append("\nMin Lat  : ")
-            .append(minLat)
-            .append("\nMax Lat  : ")
-            .append(maxLat)
-            .append("\nMin Lon  : ")
-            .append(minLon)
-            .append("\nMax Lon  : ")
-            .append(maxLon)
-            .append("\nLat Intvl: ")
-            .append(latInterval)
-            .append("\nLon Intvl: ")
-            .append(lonInterval)
-            .append("\nNode Cnt : ")
-            .append(nodeCount)
-            .toString();
+        return "Sub Grid : " +
+                subGridName +
+                "\nParent   : " +
+                parentSubGridName +
+                "\nCreated  : " +
+                created +
+                "\nUpdated  : " +
+                updated +
+                "\nMin Lat  : " +
+                minLat +
+                "\nMax Lat  : " +
+                maxLat +
+                "\nMin Lon  : " +
+                minLon +
+                "\nMax Lon  : " +
+                maxLon +
+                "\nLat Intvl: " +
+                latInterval +
+                "\nLon Intvl: " +
+                lonInterval +
+                "\nNode Cnt : " +
+                nodeCount;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/sources/SourceInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/sources/SourceInfo.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/sources/SourceInfo.java	(revision 18871)
@@ -86,5 +86,5 @@
       * creation date of the source (in the form YYYY-MM-DD;YYYY-MM-DD, where
       * DD and MM as well as a second date are optional).
-      *
+      * <p>
       * Also used as time filter for WMS time={time} parameter (such as Sentinel-2)
       * @since 11570
@@ -106,5 +106,5 @@
     /** category of the imagery (input string, not saved, copied or used otherwise except for error checks) */
     protected String categoryOriginalString;
-    /** when adding a field, also adapt the:
+    /* when adding a field, also adapt the:
      * {@link #ImageryPreferenceEntry ImageryPreferenceEntry object}
      * {@link #ImageryPreferenceEntry#ImageryPreferenceEntry(ImageryInfo) ImageryPreferenceEntry constructor}
@@ -149,5 +149,5 @@
      * Check if this object equals another SourceInfo with respect to the properties
      * that get written to the preference file.
-     *
+     * <p>
      * This should be overridden and called in subclasses.
      *
@@ -219,11 +219,10 @@
     public String toString() {
         // Used in imagery preferences filtering, so must be efficient
-        return new StringBuilder(name)
-                .append('[').append(countryCode)
+        return name +
+                '[' + countryCode +
                 // appending the localized country in toString() allows us to filter imagery preferences table with it!
-                .append("] ('").append(getLocalizedCountry(countryCode)).append(')')
-                .append(" - ").append(url)
-                .append(" - ").append(sourceType)
-                .toString();
+                "] ('" + getLocalizedCountry(countryCode) + ')' +
+                " - " + url +
+                " - " + sourceType;
     }
 
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/Addresses.java	(revision 18871)
@@ -428,5 +428,5 @@
         if (r.isIncomplete())
             return;
-        /** array of country codes for which the test should be performed. For now, only Germany */
+        /* array of country codes for which the test should be performed. For now, only Germany */
         String[] countryCodes = {"DE"};
         TagMap neededtagsForHouse = new TagMap();
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/MultipolygonTest.java	(revision 18871)
@@ -602,7 +602,7 @@
      */
     private static Map<List<Way>, List<WaySegment>> findIntersectingWays(Relation r, boolean findSharedWaySegments) {
-        /** All way segments, grouped by cells */
+        /* All way segments, grouped by cells */
         final Map<Point2D, List<WaySegment>> cellSegments = new HashMap<>(1000);
-        /** The detected crossing ways */
+        /* The detected crossing ways */
         final Map<List<Way>, List<WaySegment>> crossingWays = new HashMap<>(50);
 
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java	(revision 18871)
@@ -569,4 +569,5 @@
 
         /**
+         * Get the detected segments
          * @return the detected segments
          */
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 18871)
@@ -461,5 +461,5 @@
          * @return true if a reasonable connection was found
          */
-        private boolean isConnectedTo(Node node, LinkedHashSet<Node> visited, double len, Way parent) {
+        private boolean isConnectedTo(Node node, Set<Node> visited, double len, Way parent) {
             if (len > maxLen) {
                 return false;
@@ -480,5 +480,5 @@
             if (visited != null) {
                 visited.add(node);
-                List<Way> wantedParents = node.getParentWays().stream().filter(pw -> isWantedWay(pw))
+                List<Way> wantedParents = node.getParentWays().stream().filter(UnconnectedWays.this::isWantedWay)
                         .collect(Collectors.toList());
                 if (wantedParents.size() > 1 && wantedParents.indexOf(parent) != wantedParents.size() - 1) {
Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 18871)
@@ -215,10 +215,10 @@
         splitPane.setRightComponent(dialogsPanel);
 
-        /**
+        /*
          * All additional space goes to the mapView
          */
         splitPane.setResizeWeight(1.0);
 
-        /**
+        /*
          * Some beautifications.
          */
@@ -515,5 +515,5 @@
         panel.add(this, BorderLayout.CENTER);
 
-        /**
+        /*
          * sideToolBar: add map modes icons
          */
@@ -526,5 +526,5 @@
         }
 
-        /**
+        /*
          * sideToolBar: add toggle dialogs icons
          */
@@ -538,5 +538,5 @@
         }
 
-        /**
+        /*
          * sideToolBar: add dynamic popup menu
          */
@@ -545,10 +545,9 @@
         sideToolBar.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 1));
 
-        /**
+        /*
          * sideToolBar: decide scroll- and visibility
          */
         if (Config.getPref().getBoolean("sidetoolbar.scrollable", true)) {
-            final ScrollViewport svp = new ScrollViewport(sideToolBar, ScrollViewport.VERTICAL_DIRECTION);
-            sideToolBar = svp;
+            sideToolBar = new ScrollViewport(sideToolBar, ScrollViewport.VERTICAL_DIRECTION);
         }
         sideToolBar.setVisible(SIDE_TOOLBAR_VISIBLE.get());
@@ -556,10 +555,10 @@
         SIDE_TOOLBAR_VISIBLE.addListener(sidetoolbarPreferencesChangedListener);
 
-        /**
+        /*
          * sideToolBar: add it to the panel
          */
         panel.add(sideToolBar, BorderLayout.WEST);
 
-        /**
+        /*
          * statusLine: add to panel
          */
Index: trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 18871)
@@ -45,4 +45,5 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.IPrimitive;
+import org.openstreetmap.josm.data.osm.IWaySegment;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -209,5 +210,5 @@
     // The only events that may move/resize this map view are window movements or changes to the map view size.
     // We can clean this up more by only recalculating the state on repaint.
-    private final transient HierarchyListener hierarchyListener = e -> {
+    private final transient HierarchyListener hierarchyListenerNavigatableComponent = e -> {
         long interestingFlags = HierarchyEvent.ANCESTOR_MOVED | HierarchyEvent.SHOWING_CHANGED;
         if ((e.getChangeFlags() & interestingFlags) != 0) {
@@ -216,5 +217,5 @@
     };
 
-    private final transient ComponentAdapter componentListener = new ComponentAdapter() {
+    private final transient ComponentAdapter componentListenerNavigatableComponent = new ComponentAdapter() {
         @Override
         public void componentShown(ComponentEvent e) {
@@ -254,6 +255,6 @@
     public void addNotify() {
         updateLocationState();
-        addHierarchyListener(hierarchyListener);
-        addComponentListener(componentListener);
+        addHierarchyListener(hierarchyListenerNavigatableComponent);
+        addComponentListener(componentListenerNavigatableComponent);
         addPrimitiveHoverMouseListeners();
         super.addNotify();
@@ -262,6 +263,6 @@
     @Override
     public void removeNotify() {
-        removeHierarchyListener(hierarchyListener);
-        removeComponentListener(componentListener);
+        removeHierarchyListener(hierarchyListenerNavigatableComponent);
+        removeComponentListener(componentListenerNavigatableComponent);
         removePrimitiveHoverMouseListeners();
         super.removeNotify();
@@ -290,5 +291,5 @@
     /**
      * Replies the layer which scale is set to.
-     * @return the current scale layer (may be null)
+     * @return the current scale layer (may be {@code null})
      */
     public NativeScaleLayer getNativeScaleLayer() {
@@ -324,5 +325,5 @@
             ScaleList scaleList = nativeScaleLayer.getNativeScales();
             if (scaleList != null) {
-                if (PROP_ZOOM_INTERMEDIATE_STEPS.get()) {
+                if (Boolean.TRUE.equals(PROP_ZOOM_INTERMEDIATE_STEPS.get())) {
                     scaleList = scaleList.withIntermediateSteps(PROP_ZOOM_RATIO.get());
                 }
@@ -366,5 +367,5 @@
             ScaleList scaleList = nativeScaleLayer.getNativeScales();
             if (scaleList != null) {
-                if (PROP_ZOOM_INTERMEDIATE_STEPS.get()) {
+                if (Boolean.TRUE.equals(PROP_ZOOM_INTERMEDIATE_STEPS.get())) {
                     scaleList = scaleList.withIntermediateSteps(PROP_ZOOM_RATIO.get());
                 }
@@ -478,5 +479,5 @@
     /**
      * Returns the current center of the viewport.
-     *
+     * <p>
      * (Use {@link #zoomTo(EastNorth)} to the change the center.)
      *
@@ -489,5 +490,5 @@
     /**
      * Returns the current scale.
-     *
+     * <p>
      * In east/north units per pixel.
      *
@@ -590,5 +591,5 @@
     /**
      * Return the point on the screen where this Coordinate would be.
-     *
+     * <p>
      * Alternative: {@link #getState()}, then {@link MapViewState#getPointFor(ILatLon)}
      * @param latlon The point, where this geopoint would be drawn.
@@ -605,5 +606,5 @@
     /**
      * Return the point on the screen where this Coordinate would be.
-     *
+     * <p>
      * Alternative: {@link #getState()}, then {@link MapViewState#getPointFor(ILatLon)}
      * @param latlon The point, where this geopoint would be drawn.
@@ -616,5 +617,5 @@
     /**
      * Return the point on the screen where this Node would be.
-     *
+     * <p>
      * Alternative: {@link #getState()}, then {@link MapViewState#getPointFor(ILatLon)}
      * @param n The node, where this geopoint would be drawn.
@@ -827,7 +828,5 @@
                 for (int i = 0; i < frames && !doStop; i++) {
                     final EastNorth z = oldCenter.interpolate(finalNewCenter, (1.0+i) / frames);
-                    GuiHelper.runInEDTAndWait(() -> {
-                        zoomTo(z);
-                    });
+                    GuiHelper.runInEDTAndWait(() -> zoomTo(z));
                     Thread.sleep(sleepTime);
                 }
@@ -1109,6 +1108,5 @@
                     if (!nlist.isEmpty()) {
                         minDistSq = distSq;
-                        nearestList = new ArrayList<>();
-                        nearestList.addAll(nlist);
+                        nearestList = new ArrayList<>(nlist);
                     }
                 } else {
@@ -1141,14 +1139,14 @@
     /**
      * The *result* depends on the current map selection state IF use_selected is true.
-     *
+     * <p>
      * If more than one node within node.snap-distance pixels is found,
      * the nearest node selected is returned IF use_selected is true.
-     *
+     * <p>
      * Else the nearest new/id=0 node within about the same distance
      * as the true nearest node is returned.
-     *
+     * <p>
      * If no such node is found either, the true nearest node to p is returned.
-     *
-     * Finally, if a node is not found at all, null is returned.
+     * <p>
+     * Finally, if a node is not found at all, {@code null} is returned.
      *
      * @param p the screen point
@@ -1165,16 +1163,16 @@
     /**
      * The *result* depends on the current map selection state IF use_selected is true
-     *
+     * <p>
      * If more than one node within node.snap-distance pixels is found,
      * the nearest node selected is returned IF use_selected is true.
-     *
+     * <p>
      * If there are no selected nodes near that point, the node that is related to some of the preferredRefs
-     *
+     * <p>
      * Else the nearest new/id=0 node within about the same distance
      * as the true nearest node is returned.
-     *
+     * <p>
      * If no such node is found either, the true nearest node to p is returned.
-     *
-     * Finally, if a node is not found at all, null is returned.
+     * <p>
+     * Finally, if a node is not found at all, {@code null} is returned.
      *
      * @param p the screen point
@@ -1289,9 +1287,9 @@
                      * loose some precision to account for possible deviations in the calculation above
                      * e.g. if identical (A and B) come about reversed in another way, values may differ
-                     * -- zero out least significant 32 dual digits of mantissa..
+                     * -- zero out least significant 32 dual digits of mantissa.
                      */
                     double perDistSq = Double.longBitsToDouble(
                             Double.doubleToLongBits(a - (a - b + c) * (a - b + c) / 4 / c)
-                            >> 32 << 32); // resolution in numbers with large exponent not needed here..
+                            >> 32 << 32); // resolution in numbers with large exponent not needed here.
 
                     if (perDistSq < snapDistanceSq && a < c + snapDistanceSq && b < c + snapDistanceSq) {
@@ -1462,5 +1460,5 @@
                 .flatMap(Collection::stream)
                 .filter(ws -> wset.add(ws.getWay()))
-                .map(ws -> ws.getWay())
+                .map(IWaySegment::getWay)
                 .collect(Collectors.toList());
         if (ignore != null) {
@@ -1504,11 +1502,11 @@
      * neither does the result *order*.
      * It solely depends on the distance to point p.
-     *
+     * <p>
      * First, nodes will be searched. If there are nodes within BBox found,
      * return a collection of those nodes only.
-     *
+     * <p>
      * If no nodes are found, search for nearest ways. If there are ways
      * within BBox found, return a collection of those ways only.
-     *
+     * <p>
      * If nothing is found, return an empty collection.
      *
@@ -1574,16 +1572,16 @@
     /**
      * The *result* depends on the current map selection state IF use_selected is true.
-     *
+     * <p>
      * IF use_selected is true, use {@link #getNearestNode(Point, Predicate)} to find
      * the nearest, selected node.  If not found, try {@link #getNearestWaySegment(Point, Predicate)}
      * to find the nearest selected way.
-     *
+     * <p>
      * IF use_selected is false, or if no selected primitive was found, do the following.
-     *
+     * <p>
      * If the nearest node found is within 4px of p, simply take it.
      * Else, find the nearest way segment. Then, if p is closer to its
      * middle than to the node, take the way segment, else take the node.
-     *
-     * Finally, if no nearest primitive is found at all, return null.
+     * <p>
+     * Finally, if no nearest primitive is found at all, return {@code null}.
      *
      * @param p The point on screen.
@@ -1637,5 +1635,5 @@
     /**
      * if r = 0 returns a, if r=1 returns b,
-     * if r = 0.5 returns center between a and b, etc..
+     * if r = 0.5 returns center between a and b, etc.
      *
      * @param r scale value
@@ -1673,5 +1671,5 @@
                 .flatMap(Collection::stream)
                 .filter(ws -> wset.add(ws.getWay()))
-                .map(ws -> ws.getWay())
+                .map(IWaySegment::getWay)
                 .collect(Collectors.toList());
 
@@ -1724,15 +1722,15 @@
 
     /**
-     * Return a ID which is unique as long as viewport dimensions are the same
+     * Return an ID which is unique as long as viewport dimensions are the same
      * @return A unique ID, as long as viewport dimensions are the same
      */
     public int getViewID() {
         EastNorth center = getCenter();
-        String x = new StringBuilder().append(center.east())
-                          .append('_').append(center.north())
-                          .append('_').append(getScale())
-                          .append('_').append(getWidth())
-                          .append('_').append(getHeight())
-                          .append('_').append(getProjection()).toString();
+        String x = String.valueOf(center.east()) +
+                '_' + center.north() +
+                '_' + getScale() +
+                '_' + getWidth() +
+                '_' + getHeight() +
+                '_' + getProjection();
         CRC32 id = new CRC32();
         id.update(x.getBytes(StandardCharsets.UTF_8));
Index: trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 18871)
@@ -13,4 +13,5 @@
 import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.stream.Collectors;
@@ -147,5 +148,5 @@
     }
 
-    private static LinkedHashMap<String, TileSource> getAllTileSources() {
+    private static Map<String, TileSource> getAllTileSources() {
         // using a LinkedHashMap of <id, TileSource> to retain ordering but provide deduplication
         return providers.stream().flatMap(
@@ -366,5 +367,5 @@
      */
     public final void refreshTileSources() {
-        final LinkedHashMap<String, TileSource> newTileSources = getAllTileSources();
+        final Map<String, TileSource> newTileSources = getAllTileSources();
         final TileSource currentTileSource = this.getTileController().getTileSource();
 
Index: trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java	(revision 18871)
@@ -35,11 +35,8 @@
         // editing cells in the first column
         //
-        mergedEntriesTableModel = this.new EntriesTableModel(ListRole.MERGED_ENTRIES) {
+        mergedEntriesTableModel = new EntriesTableModel(ListRole.MERGED_ENTRIES) {
             @Override
             public boolean isCellEditable(int row, int column) {
-                switch(column) {
-                case 1: return true;
-                default: return false;
-                }
+                return column == 1;
             }
         };
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/DialogsPanel.java	(revision 18871)
@@ -175,5 +175,5 @@
         final int n = allDialogs.size();
 
-        /**
+        /*
          * reset the panels
          */
@@ -183,5 +183,5 @@
         }
 
-        /**
+        /*
          * Add the elements to their respective panel.
          *
@@ -216,5 +216,5 @@
         final int numPanels = n - k;
 
-        /**
+        /*
          * Determine the panel geometry
          */
@@ -245,5 +245,5 @@
             }
 
-            /**
+            /*
              * If we add additional dialogs on startup (e.g. geoimage), they may
              * not have an actual height yet.
@@ -255,8 +255,8 @@
             }
 
-            /** total Height */
+            /* total Height */
             final int h = mSpltPane.getMultiSplitLayout().getModel().getBounds().getSize().height;
 
-            /** space, that is available for dialogs in default view (after the reconfiguration) */
+            /* space, that is available for dialogs in default view (after the reconfiguration) */
             final int s2 = h - (numPanels - 1) * DIVIDER_SIZE - sumC;
 
@@ -264,12 +264,12 @@
             if (hpTrig <= 0) throw new IllegalStateException(); // Must be positive
 
-            /** The new dialog gets a fair share */
+            /* The new dialog gets a fair share */
             final int hnTrig = hpTrig * s2 / (hpTrig + sumP);
             triggeredBy.setPreferredSize(new Dimension(Integer.MAX_VALUE, hnTrig));
 
-            /** This is remaining for the other default view dialogs */
+            /* This is remaining for the other default view dialogs */
             final int r = s2 - hnTrig;
 
-            /**
+            /*
              * Take space only from dialogs that are relatively large
              */
@@ -289,5 +289,5 @@
                 }
             }
-            /** adjust, without changing the sum */
+            /* adjust, without changing the sum */
             for (final ToggleDialog dlg : allDialogs) {
                 if (dlg != triggeredBy && dlg.isDialogInDefaultView()) {
@@ -306,5 +306,5 @@
         }
 
-        /**
+        /*
          * create Layout
          */
@@ -334,5 +334,5 @@
         mSpltPane.revalidate();
 
-        /**
+        /*
          * Hide the Panel, if there is nothing to show
          */
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 18871)
@@ -256,7 +256,7 @@
         this.preferenceClass = prefClass;
 
-        /** Use the full width of the parent element */
+        /* Use the full width of the parent element */
         setPreferredSize(new Dimension(0, preferredHeight));
-        /** Override any minimum sizes of child elements so the user can resize freely */
+        /* Override any minimum sizes of child elements so the user can resize freely */
         setMinimumSize(new Dimension(0, 0));
         this.preferredHeight = Config.getPref().getInt(preferencePrefix+".preferredHeight", preferredHeight);
@@ -268,5 +268,5 @@
         buttonHiding = propButtonHiding.get();
 
-        /** show the minimize button */
+        /* show the minimize button */
         titleBar = new TitleBar(name, iconName);
         add(titleBar, BorderLayout.NORTH);
@@ -293,5 +293,5 @@
     /**
      * The action to toggle the visibility state of this toggle dialog.
-     *
+     * <p>
      * Emits {@link PropertyChangeEvent}s for the property <code>selected</code>:
      * <ul>
@@ -382,5 +382,5 @@
     @Override
     public void buttonHidden() {
-        if ((Boolean) toggleAction.getValue("selected")) {
+        if (Boolean.TRUE.equals(toggleAction.getValue("selected"))) {
             toggleAction.actionPerformed(null);
         }
@@ -597,7 +597,5 @@
             // show the help button
             addButton(new JButton(ImageProvider.get("help", ImageProvider.ImageSizes.SMALLICON)),
-                    tr("Open help for this panel"), e -> {
-                HelpBrowser.setUrlForHelpTopic(helpTopic());
-            });
+                    tr("Open help for this panel"), e -> HelpBrowser.setUrlForHelpTopic(helpTopic()));
 
             // show the sticky button
@@ -967,11 +965,11 @@
                         ? new FlowLayout(FlowLayout.LEFT) : new GridLayout(1, buttonRow.size()));
                 buttonsPanel.add(buttonRowPanel);
-                for (SideButton button : buttonRow) {
-                    buttonRowPanel.add(button);
-                    javax.swing.Action action = button.getAction();
+                for (SideButton sideButton : buttonRow) {
+                    buttonRowPanel.add(sideButton);
+                    javax.swing.Action action = sideButton.getAction();
                     if (action != null) {
                         buttonActions.add(action);
                     } else {
-                        Logging.warn("Button " + button + " doesn't have action defined");
+                        Logging.warn("Button " + sideButton + " doesn't have action defined");
                         Logging.error(new Exception());
                     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java	(revision 18871)
@@ -47,6 +47,6 @@
                 INode n3 = w.getNode(2);
                 if (n1 != null && n2 != null && n3 != null && w.isClosed()) {
-                    /** do some simple determinant / cross product test on the first 3 nodes
-                        to see, if the roundabout goes clock wise or ccw */
+                    /* do some simple determinant / cross product test on the first 3 nodes
+                       to see, if the roundabout goes clock wise or ccw */
                     EastNorth en1 = n1.getEastNorth();
                     EastNorth en2 = n2.getEastNorth();
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/WayConnectionTypeCalculator.java	(revision 18871)
@@ -7,6 +7,6 @@
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
-import java.util.stream.Collectors;
 
 import org.openstreetmap.josm.data.osm.Node;
@@ -45,7 +45,5 @@
     public List<WayConnectionType> updateLinks(Relation r, List<RelationMember> members) {
         this.members = members;
-        final List<WayConnectionType> con = members.stream()
-                .map(ignore -> (WayConnectionType) null)
-                .collect(Collectors.toList());
+        final List<WayConnectionType> con = new ArrayList<>(Collections.nCopies(members.size(), null));
 
         firstGroupIdx = 0;
@@ -165,5 +163,5 @@
     }
 
-    private boolean isSuperRoute(Relation r) {
+    private static boolean isSuperRoute(Relation r) {
         return r != null && r.hasTag("type", "superroute");
     }
@@ -226,5 +224,5 @@
             if (RelationSortUtils.isBackward(m) != reversed) return BACKWARD;
             else return FORWARD;
-        } else { /** guess the direction and see if it fits with the next member */
+        } else { /* guess the direction and see if it fits with the next member */
             if (determineDirection(i, FORWARD, i+1) != NONE) return FORWARD;
             if (determineDirection(i, BACKWARD, i+1) != NONE) return BACKWARD;
@@ -332,7 +330,7 @@
      * Determines the direction of way {@code k} with respect to the way {@code ref_i}.
      * The way {@code ref_i} is assumed to have the direction {@code ref_direction} and to be the predecessor of {@code k}.
-     *
+     * <p>
      * If both ways are not linked in any way, NONE is returned.
-     *
+     * <p>
      * Else the direction is given as follows:
      * Let the relation be a route of oneway streets, and someone travels them in the given order.
@@ -363,5 +361,5 @@
             return NONE;
 
-        /** the list of nodes the way k can dock to */
+        /* the list of nodes the way k can dock to */
         List<Node> refNodes = new ArrayList<>();
 
@@ -419,5 +417,5 @@
     }
 
-    private boolean isConnected(Way way1, Way way2) {
+    private static boolean isConnected(Way way1, Way way2) {
         return way1 != null && way2 != null && way1.isUsable() && way2.isUsable()
                 && (way1.isFirstLastNode(way2.firstNode()) || way1.isFirstLastNode(way2.lastNode()));
Index: trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java	(revision 18871)
@@ -16,4 +16,5 @@
 import org.openstreetmap.josm.gui.download.overpass.OverpassWizardRegistration.OverpassWizardCallbacks;
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompComboBoxModel;
+import org.openstreetmap.josm.gui.widgets.JosmComboBoxModel;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.SearchCompilerQueryWizard;
@@ -29,5 +30,5 @@
 
     private static final ListProperty OVERPASS_WIZARD_HISTORY =
-            new ListProperty("download.overpass.wizard", new ArrayList<String>());
+            new ListProperty("download.overpass.wizard", new ArrayList<>());
     private final OverpassWizardCallbacks callbacks;
 
@@ -37,8 +38,8 @@
     private static final int CANCEL = 2;
 
-    private AutoCompComboBoxModel<SearchSetting> model;
+    private final AutoCompComboBoxModel<SearchSetting> model;
 
     /** preferences reader/writer with automatic transmogrification to and from String */
-    private AutoCompComboBoxModel<SearchSetting>.Preferences prefs;
+    private final JosmComboBoxModel<SearchSetting>.Preferences prefs;
 
     /**
Index: trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 18871)
@@ -200,5 +200,5 @@
             if (e.getButton() == MouseEvent.BUTTON3) {
                 Component component = e.getComponent();
-                if (POPUP_MENU_ENABLED.get() && component.isShowing()) {
+                if (Boolean.TRUE.equals(POPUP_MENU_ENABLED.get()) && component.isShowing()) {
                     new TileSourceLayerPopup(e.getX(), e.getY()).show(component, e.getX(), e.getY());
                 }
@@ -422,5 +422,5 @@
 
         private static String getSizeString(int size) {
-            return new StringBuilder().append(size).append('x').append(size).toString();
+            return Integer.toString(size) + 'x' + size;
         }
 
@@ -452,7 +452,7 @@
                         getSizeString(tile.getTileSource().getTileSize())));
                 content.add(Arrays.asList(tr("Tile display size"),
-                        new StringBuilder().append(displaySize.getWidth())
-                                .append('x')
-                                .append(displaySize.getHeight()).toString()));
+                        Double.toString(displaySize.getWidth()) +
+                                'x' +
+                                displaySize.getHeight()));
                 if (layer.coordinateConverter.requiresReprojection()) {
                     content.add(Arrays.asList(tr("Reprojection"),
@@ -561,5 +561,5 @@
         MapView.addZoomChangeListener(this);
 
-        if (this instanceof NativeScaleLayer && NavigatableComponent.PROP_ZOOM_SCALE_FOLLOW_NATIVE_RES_AT_LOAD.get()) {
+        if (this instanceof NativeScaleLayer && Boolean.TRUE.equals(NavigatableComponent.PROP_ZOOM_SCALE_FOLLOW_NATIVE_RES_AT_LOAD.get())) {
             event.getMapView().setNativeScaleLayer((NativeScaleLayer) this);
         }
@@ -640,5 +640,5 @@
             tileSize = tileSource.getTileSize();
         }
-        /**
+        /*
          * As we can see part of the tile at the top and at the bottom, use Math.ceil(...) + 1 to accommodate for that
          */
@@ -646,27 +646,32 @@
         int maxXtiles = (int) Math.ceil((double) width / tileSize + 1);
         int visibleTiles = maxXtiles * maxYtiles;
-        /**
-         * Take into account ZOOM_OFFSET to calculate real number of tiles and multiply by 7, to cover all tiles, that might be
-         * accessed when looking for tiles outside current zoom level.
-         *
-         * Currently we use otherZooms = {1, 2, -1, -2, -3, -4, -5}
-         *
-         * The value should be sum(2^x for x in (-5 to 2)) - 1
-         * -1 to exclude current zoom level
-         *
-         * Check call to tryLoadFromDifferentZoom
-         * @see #tryLoadFromDifferentZoom(Graphics2D, int, List<Tile>,int)
-         * @see #drawInViewArea((Graphics2D, MapView, ProjectionBounds)
-         *
-         * Add +2 to maxYtiles / maxXtiles to add space in cache for extra tiles in current zoom level that are
-         * download by overloadTiles(). This is not added in computation of visibleTiles as this unnecessarily grow the cache size
-         * @see #overloadTiles()
-         */
-        int ret = (int) Math.ceil(
-                Math.pow(2d, ZOOM_OFFSET.get()) * // use offset to decide, how many tiles are visible
-                visibleTiles * 7 + // 7 to cover tiles from other zooms as described above
-                ((maxYtiles + 2) * (maxXtiles +2))); // to add as many tiles as they will be accessed on current zoom level
+
+        int ret = calculateRealTiles(visibleTiles, maxXtiles, maxYtiles);
         Logging.info("AbstractTileSourceLayer: estimated visible tiles: {0}, estimated cache size: {1}", visibleTiles, ret);
         return ret;
+    }
+
+    /**
+     * Take into account ZOOM_OFFSET to calculate real number of tiles and multiply by 7, to cover all tiles, that might be
+     * accessed when looking for tiles outside current zoom level.
+     * <p>
+     * Currently we use otherZooms = {1, 2, -1, -2, -3, -4, -5}
+     * <p>
+     * The value should be sum(2^x for x in (-5 to 2)) - 1
+     * -1 to exclude current zoom level
+     * <p>
+     * Check call to tryLoadFromDifferentZoom
+     * @see #tryLoadFromDifferentZoom(Graphics2D, int, List, int)
+     * @see #drawInViewArea(Graphics2D, MapView, ProjectionBounds)
+     *
+     * Add +2 to maxYtiles / maxXtiles to add space in cache for extra tiles in current zoom level that are
+     * download by overloadTiles(). This is not added in computation of visibleTiles as this unnecessarily grow the cache size
+     * @see TileSet#overloadTiles()
+     */
+    private static int calculateRealTiles(int visibleTiles, int maxXtiles, int maxYtiles) {
+        return (int) Math.ceil(
+                Math.pow(2d, ZOOM_OFFSET.get()) * // use offset to decide, how many tiles are visible
+                        visibleTiles * 7 + // 7 to cover tiles from other zooms as described above
+                        ((maxYtiles + 2) * (maxXtiles +2))); // to add as many tiles as they will be accessed on current zoom level
     }
 
@@ -1325,5 +1330,5 @@
          */
         private void overloadTiles() {
-            /**
+            /*
              * consult calculation in estimateTileCacheSize() before changing values here.
              *
@@ -1596,5 +1601,5 @@
         }
         if (getDisplaySettings().isAutoZoom()) {
-            /**
+            /*
              * consult calculation in estimateTileCacheSize() before changing values here.
              *
@@ -1947,5 +1952,5 @@
      * Calculates tiles, that needs to be downloaded to cache, gets a current tile loader and creates a task to download
      * all of the tiles. Buffer contains at least one tile.
-     *
+     * <p>
      * To prevent accidental clear of the queue, new download executor is created with separate queue
      *
Index: trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java	(revision 18871)
@@ -42,5 +42,5 @@
 public class WMSLayer extends AbstractCachedTileSourceLayer<AbstractWMSTileSource> {
     private static final String PREFERENCE_PREFIX = "imagery.wms";
-    /**
+    /*
      * Registers all setting properties
      */
@@ -148,7 +148,5 @@
 
     private Projection chooseProjection(Projection requested) {
-        if (serverProjections.contains(requested.toCode())) {
-            return requested;
-        } else {
+        if (!serverProjections.contains(requested.toCode())) {
             LatLon center = MainApplication.isDisplayingMapView() ?
                     requested.eastNorth2latlon(MainApplication.getMap().mapView.getCenter()) : null;
@@ -173,6 +171,6 @@
             }
             Logging.warn(tr("Unable to find supported projection for layer {0}. Using {1}.", getName(), requested.toCode()));
-            return requested;
-        }
+        }
+        return requested;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/layer/WMTSLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/WMTSLayer.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/layer/WMTSLayer.java	(revision 18871)
@@ -23,7 +23,7 @@
  * WMTS layer based on AbstractTileSourceLayer. Overrides few methods to align WMTS to Tile based computations
  * but most magic is done within WMTSTileSource class.
- *
+ * <p>
  * Full specification of the protocol available at:
- * http://www.opengeospatial.org/standards/wmts
+ * <a href="https://www.ogc.org/standard/wmts/">OpenGIS Web Map Tile Service Implementation Standard</a>
  *
  * @author Wiktor NiesiobÄ™dzki
@@ -33,5 +33,5 @@
     private static final String PREFERENCE_PREFIX = "imagery.wmts";
 
-    /**
+    /*
      * Registers all setting properties
      */
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 18871)
@@ -22,5 +22,4 @@
 import java.io.File;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -193,8 +192,10 @@
         this.data.addImageDataUpdateListener(this);
         this.data.setLayer(this);
-        synchronized (ImageViewerDialog.class) {
-            if (!ImageViewerDialog.hasInstance()) {
-                GuiHelper.runInEDTAndWait(ImageViewerDialog::createInstance);
-            }
+        if (!ImageViewerDialog.hasInstance()) {
+            GuiHelper.runInEDTAndWait(() -> {
+                if (!ImageViewerDialog.hasInstance()) {
+                    ImageViewerDialog.createInstance();
+                }
+            });
         }
         if (getInvalidGeoImages().size() == data.size()) {
@@ -202,7 +203,5 @@
             // We do have to wrap the EDT call in a worker call, since layers may be created in the EDT.
             // And the layer must be added to the layer list in order for the dialog to work properly.
-            MainApplication.worker.execute(() -> GuiHelper.runInEDT(() -> {
-                ImageViewerDialog.getInstance().displayImages(this.getSelection());
-            }));
+            MainApplication.worker.execute(() -> GuiHelper.runInEDT(() -> ImageViewerDialog.getInstance().displayImages(this.getSelection())));
         }
     }
@@ -813,5 +812,5 @@
     /**
      * Stop to load thumbnails.
-     *
+     * <p>
      * Can be called at any time to make sure that the
      * thumbnail loader is stopped.
@@ -826,5 +825,5 @@
     /**
      * Called to signal that the loading of thumbnails has finished.
-     *
+     * <p>
      * Usually called from {@link ThumbsLoader} in another thread.
      */
@@ -874,5 +873,5 @@
         return gpxData != null ? MainApplication.getLayerManager().getLayersOfType(GpxLayer.class)
                 .stream().filter(l -> gpxData.equals(l.getGpxData()))
-                .findFirst().orElseThrow(() -> new IllegalStateException()) : null;
+                .findFirst().orElseThrow(IllegalStateException::new) : null;
     }
 
@@ -912,5 +911,5 @@
         if (gpxFauxData == null) {
             gpxFauxData = new GpxData();
-            gpxFauxData.addTrack(new GpxTrack(Arrays.asList(
+            gpxFauxData.addTrack(new GpxTrack(Collections.singletonList(
                     data.getImages().stream().map(ImageEntry::asWayPoint).filter(Objects::nonNull).collect(toList())),
                     Collections.emptyMap()));
@@ -974,5 +973,5 @@
     @Override
     public Data getData() {
-        return data;
+        return getImageData();
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java	(revision 18871)
@@ -120,4 +120,5 @@
         private boolean restart;
 
+        @SuppressWarnings("DoNotCall") // we are calling `run` from the thread we want it to be running on (aka recursive)
         @Override
         public void run() {
Index: trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java	(revision 18871)
@@ -240,5 +240,5 @@
         hdopAlpha = Config.getPref().getInt("hdop.color.alpha", -1);
         velocityScale = ColorScale.createHSBScale(256);
-        /** Colors (without custom alpha channel, if given) for HDOP painting. **/
+        /* Colors (without custom alpha channel, if given) for HDOP painting. */
         hdopScale = ColorScale.createHSBScale(256).makeReversed().addTitle(tr("HDOP"));
         qualityScale = ColorScale.createFixedScale(rtkLibQualityColors).addTitle(tr("Quality")).addColorBarTitles(rtkLibQualityNames);
@@ -769,7 +769,12 @@
      */
     private void drawArrows(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
-        /****************************************************************
-         ********** STEP 3b - DRAW NICE ARROWS **************************
-         ****************************************************************/
+        drawArrows3b(g, mv, visibleSegments);
+        drawArrows3c(g, mv, visibleSegments);
+    }
+
+    /****************************************************************
+     ********** STEP 3b - DRAW NICE ARROWS **************************
+     ****************************************************************/
+    private void drawArrows3b(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
         if (lines && arrows && !arrowsFast) {
             Point old = null;
@@ -798,8 +803,10 @@
             } // end for trkpnt
         }
-
-        /****************************************************************
-         ********** STEP 3c - DRAW FAST ARROWS **************************
-         ****************************************************************/
+    }
+
+    /****************************************************************
+     ********** STEP 3c - DRAW FAST ARROWS **************************
+     ****************************************************************/
+    private void drawArrows3c(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
         if (lines && arrows && arrowsFast) {
             Point old = null;
@@ -836,9 +843,15 @@
      */
     private void drawPoints(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
-        /****************************************************************
-         ********** STEP 3d - DRAW LARGE POINTS AND HDOP CIRCLE *********
-         ****************************************************************/
+        drawPointsStep3d(g, mv, visibleSegments);
+        drawPointsStep3e(g, mv, visibleSegments);
+        drawPointsStep3f(g, mv, visibleSegments);
+    }
+
+    /****************************************************************
+     ********** STEP 3d - DRAW LARGE POINTS AND HDOP CIRCLE *********
+     ****************************************************************/
+    private void drawPointsStep3d(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
         if (large || hdopCircle) {
-            final int halfSize = largesize/2;
+            final int halfSize = largesize / 2;
             for (WayPoint trkPnt : visibleSegments) {
                 LatLon c = trkPnt.getCoor();
@@ -855,11 +868,11 @@
                     }
                     Color customColoringTransparent = hdopAlpha < 0 ? trkPnt.customColoring :
-                        new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (hdopAlpha << 24), true);
+                            new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (hdopAlpha << 24), true);
                     g.setColor(customColoringTransparent);
                     // hdop circles
                     int hdopp = mv.getPoint(new LatLon(
                             trkPnt.getCoor().lat(),
-                            trkPnt.getCoor().lon() + 2d*6*hdop*360/40000000d)).x - screen.x;
-                    g.drawArc(screen.x-hdopp/2, screen.y-hdopp/2, hdopp, hdopp, 0, 360);
+                            trkPnt.getCoor().lon() + 2d * 6 * hdop * 360 / 40000000d)).x - screen.x;
+                    g.drawArc(screen.x - hdopp / 2, screen.y - hdopp / 2, hdopp, hdopp, 0, 360);
                 }
                 if (large) {
@@ -870,5 +883,5 @@
                         } else {
                             Color customColoringTransparent = largePointAlpha < 0 ? trkPnt.customColoring :
-                                new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (largePointAlpha << 24), true);
+                                    new Color((trkPnt.customColoring.getRGB() & 0x00ffffff) | (largePointAlpha << 24), true);
 
                             g.setColor(customColoringTransparent);
@@ -877,12 +890,14 @@
                         }
                     }
-                    g.fillRect(screen.x-halfSize, screen.y-halfSize, largesize, largesize);
+                    g.fillRect(screen.x - halfSize, screen.y - halfSize, largesize, largesize);
                 }
             } // end for trkpnt
         } // end if large || hdopcircle
-
-        /****************************************************************
-         ********** STEP 3e - DRAW SMALL POINTS FOR LINES ***************
-         ****************************************************************/
+    }
+
+    /****************************************************************
+     ********** STEP 3e - DRAW SMALL POINTS FOR LINES ***************
+     ****************************************************************/
+    private void drawPointsStep3e(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
         if (!large && lines) {
             g.setColor(neutralColor);
@@ -899,8 +914,10 @@
             } // end for trkpnt
         } // end if large
-
-        /****************************************************************
-         ********** STEP 3f - DRAW SMALL POINTS INSTEAD OF LINES ********
-         ****************************************************************/
+    }
+
+    /****************************************************************
+     ********** STEP 3f - DRAW SMALL POINTS INSTEAD OF LINES ********
+     ****************************************************************/
+    private void drawPointsStep3f(Graphics2D g, MapView mv, List<WayPoint> visibleSegments) {
         if (!large && !lines) {
             g.setColor(neutralColor);
@@ -1308,8 +1325,6 @@
                 }
 
-                boolean bDrawIt = false;
-
                 // when one of segment is mapped to black
-                bDrawIt = bDrawIt || (lastPixelColor == 0) || (thePixelColor == 0);
+                boolean bDrawIt = (lastPixelColor == 0) || (thePixelColor == 0);
 
                 // different color
Index: trunk/src/org/openstreetmap/josm/gui/layer/imagery/LoadAllTilesAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/imagery/LoadAllTilesAction.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/layer/imagery/LoadAllTilesAction.java	(revision 18871)
@@ -2,8 +2,4 @@
 package org.openstreetmap.josm.gui.layer.imagery;
 
-/**
- * Load all tiles.
- * @since 11950 (extracted from {@link AbstractTileSourceLayer})
- */
 import static org.openstreetmap.josm.tools.I18n.tr;
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java	(revision 18871)
@@ -46,5 +46,5 @@
 /**
  * MapCSS selector.
- *
+ * <p>
  * A rule has two parts, a selector and a declaration block
  * e.g.
@@ -55,5 +55,5 @@
  *
  * The selector decides, if the declaration block gets applied or not.
- *
+ * <p>
  * All implementing classes of Selector are immutable.
  */
@@ -355,5 +355,5 @@
             private Map<List<Way>, List<WaySegment>> findCrossings(IPrimitive area,
                     Map<Point2D, List<WaySegment>> cellSegments) {
-                /** The detected crossing ways */
+                /* The detected crossing ways */
                 Map<List<Way>, List<WaySegment>> crossingWays = new HashMap<>(50);
                 if (area instanceof Way) {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java	(revision 18871)
@@ -765,5 +765,5 @@
     private static void prepareFileChooser(String url, AbstractFileChooser fc) {
         if (Utils.isBlank(url)) return;
-        URL sourceUrl = null;
+        URL sourceUrl;
         try {
             sourceUrl = new URL(url);
@@ -816,5 +816,5 @@
             p.add(new JLabel(tr("URL / File:")), GBC.std().insets(15, 0, 5, 0));
             p.add(tfURL, GBC.std().insets(0, 0, 5, 5));
-            JButton fileChooser = new JButton(new LaunchFileChooserAction());
+            JButton fileChooser = new JButton(new LaunchFileChooserSourceTypeAction());
             fileChooser.setMargin(new Insets(0, 0, 0, 0));
             p.add(fileChooser, GBC.eol().insets(0, 0, 5, 5));
@@ -848,6 +848,6 @@
         }
 
-        class LaunchFileChooserAction extends AbstractAction {
-            LaunchFileChooserAction() {
+        class LaunchFileChooserSourceTypeAction extends AbstractAction {
+            LaunchFileChooserSourceTypeAction() {
                 new ImageProvider("open").getResource().attachImageIcon(this);
                 putValue(SHORT_DESCRIPTION, tr("Launch a file chooser to select a file"));
@@ -1535,5 +1535,5 @@
             gc.weightx = 0.0;
             gc.weighty = 1.0;
-            add(new JButton(new LaunchFileChooserAction()));
+            add(new JButton(new LaunchFileChooserEditCellAction()));
 
             tfFileName.addFocusListener(
@@ -1622,6 +1622,6 @@
         }
 
-        class LaunchFileChooserAction extends AbstractAction {
-            LaunchFileChooserAction() {
+        class LaunchFileChooserEditCellAction extends AbstractAction {
+            LaunchFileChooserEditCellAction() {
                 putValue(NAME, "...");
                 putValue(SHORT_DESCRIPTION, tr("Launch a file chooser to select a file"));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 18871)
@@ -24,4 +24,5 @@
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
@@ -299,5 +300,5 @@
                 return null;
 
-            ActionDefinition result = new ActionDefinition(action);
+            ActionDefinition actionDefinition = new ActionDefinition(action);
 
             if (action instanceof ParameterizedAction) {
@@ -305,5 +306,5 @@
 
                 ParameterizedAction parametrizedAction = (ParameterizedAction) action;
-                Map<String, ActionParameter<?>> actionParams = new ConcurrentHashMap<>();
+                Map<String, ActionParameter<?>> actionParams = new HashMap<>();
                 for (ActionParameter<?> param: parametrizedAction.getActionParameters()) {
                     actionParams.put(param.getName(), param);
@@ -317,5 +318,5 @@
                         ActionParameter<?> actionParam = actionParams.get(paramName);
                         if (actionParam != null) {
-                            result.getParameters().put(paramName, actionParam.readFromString(paramValue));
+                            actionDefinition.getParameters().put(paramName, actionParam.readFromString(paramValue));
                         }
                     }
@@ -332,7 +333,7 @@
                     String paramValue = readTillChar(',', '}');
                     if ("icon".equals(paramName) && !paramValue.isEmpty()) {
-                        result.setIcon(paramValue);
+                        actionDefinition.setIcon(paramValue);
                     } else if ("name".equals(paramName) && !paramValue.isEmpty()) {
-                        result.setName(paramValue);
+                        actionDefinition.setName(paramValue);
                     }
                     skip(',');
@@ -341,5 +342,5 @@
             }
 
-            return result;
+            return actionDefinition;
         }
 
@@ -798,16 +799,23 @@
         private JButton createButton(String name) {
             JButton b = new JButton();
-            if ("up".equals(name)) {
-                b.setIcon(ImageProvider.get("dialogs", "up", ImageSizes.LARGEICON));
-                b.setToolTipText(tr("Move the currently selected members up"));
-            } else if ("down".equals(name)) {
-                b.setIcon(ImageProvider.get("dialogs", "down", ImageSizes.LARGEICON));
-                b.setToolTipText(tr("Move the currently selected members down"));
-            } else if ("<".equals(name)) {
-                b.setIcon(ImageProvider.get("dialogs/conflict", "copybeforecurrentright", ImageSizes.LARGEICON));
-                b.setToolTipText(tr("Add all objects selected in the current dataset before the first selected member"));
-            } else if (">".equals(name)) {
-                b.setIcon(ImageProvider.get("dialogs", "delete", ImageSizes.LARGEICON));
-                b.setToolTipText(tr("Remove"));
+            switch (name) {
+                case "up":
+                    b.setIcon(ImageProvider.get("dialogs", "up", ImageSizes.LARGEICON));
+                    b.setToolTipText(tr("Move the currently selected members up"));
+                    break;
+                case "down":
+                    b.setIcon(ImageProvider.get("dialogs", "down", ImageSizes.LARGEICON));
+                    b.setToolTipText(tr("Move the currently selected members down"));
+                    break;
+                case "<":
+                    b.setIcon(ImageProvider.get("dialogs/conflict", "copybeforecurrentright", ImageSizes.LARGEICON));
+                    b.setToolTipText(tr("Add all objects selected in the current dataset before the first selected member"));
+                    break;
+                case ">":
+                    b.setIcon(ImageProvider.get("dialogs", "delete", ImageSizes.LARGEICON));
+                    b.setToolTipText(tr("Remove"));
+                    break;
+                default:
+                    // do nothing
             }
             b.addActionListener(moveAction);
@@ -1044,5 +1052,5 @@
                         continue;
                     } else if (!(tb instanceof String)) {
-                        if (!(tb instanceof Boolean) || (Boolean) tb) {
+                        if (!(tb instanceof Boolean) || Boolean.TRUE.equals(tb)) {
                             Logging.info(tr("Strange toolbar value: {0}",
                             action.getClass().getName()));
@@ -1162,5 +1170,5 @@
     /**
      * Parse the toolbar preference setting and construct the toolbar GUI control.
-     *
+     * <p>
      * Call this, if anything has changed in the toolbar settings and you want to refresh
      * the toolbar content (e.g. after registering actions in a plugin)
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java	(revision 18871)
@@ -216,5 +216,5 @@
         public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
             if (columnIndex == 1 && aValue instanceof Color) {
-                data.get(rowIndex).info.setValue((Color) aValue);
+                getEntry(rowIndex).info.setValue((Color) aValue);
                 fireTableCellUpdated(rowIndex, columnIndex);
             }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CacheSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CacheSettingsPanel.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/imagery/CacheSettingsPanel.java	(revision 18871)
@@ -9,4 +9,5 @@
 import java.util.ArrayList;
 import java.util.Comparator;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
@@ -14,5 +15,4 @@
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
 
 import javax.swing.AbstractAction;
@@ -120,5 +120,5 @@
     public static String[][] getCacheStats(CacheAccess<String, BufferedImageCacheEntry> cache) {
         Set<String> keySet = cache.getCacheControl().getKeySet();
-        Map<String, int[]> temp = new ConcurrentHashMap<>(); // use int[] as a Object reference to int, gives better performance
+        Map<String, int[]> temp = new HashMap<>(); // use int[] as a Object reference to int, gives better performance
         for (String key: keySet) {
             String[] keyParts = key.split(":", 2);
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java	(revision 18871)
@@ -306,5 +306,5 @@
                 boolean requiresRestart = PluginHandler.removePlugins(deactivatedPlugins);
                 if (requiresRestart)
-                    return requiresRestart;
+                    return true;
             }
             return model.getNewlyActivatedPlugins().stream().anyMatch(pi -> !pi.canloadatruntime);
@@ -521,5 +521,5 @@
             // It removes a list item mark at the beginning of the line: +, -, *
             // It removes the version number after the plugin, like: 123, (123), (v5.7alpha3), (1b3), (v1-SNAPSHOT-1)...
-            Pattern regex = Pattern.compile("^[-+\\*\\s]*|\\s[\\d\\s]*(\\([^\\(\\)\\[\\]]*\\))?[\\d\\s]*$");
+            Pattern regex = Pattern.compile("^[-+*\\s]*|\\s[\\d\\s]*(\\([^()\\[\\]]*\\))?[\\d\\s]*$");
             for (String line : lines) {
                 String name = regex.matcher(line).replaceAll("");
Index: trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java	(revision 18871)
@@ -51,13 +51,13 @@
 /**
  * Projection preferences.
- *
+ * <p>
  * How to add new Projections:
  *  - Find EPSG code for the projection.
- *  - Look up the parameter string for Proj4, e.g. on http://spatialreference.org/
+ *  - Look up the parameter string for Proj4, e.g. on <a href="https://spatialreference.org">https://spatialreference.org</a>/
  *      and add it to the file 'data/projection/epsg' in JOSM trunk
  *  - Search for official references and verify the parameter values. These
  *      documents are often available in the local language only.
  *  - Use {@link #registerProjectionChoice}, to make the entry known to JOSM.
- *
+ * <p>
  * In case there is no EPSG code:
  *  - override {@link AbstractProjectionChoice#getProjection()} and provide
@@ -87,9 +87,9 @@
     /**
      * Mercator Projection.
-     *
+     * <p>
      * The center of the mercator projection is always the 0 grad coordinate.
-     *
-     * See also USGS Bulletin 1532 (http://pubs.usgs.gov/bul/1532/report.pdf)
-     * initially EPSG used 3785 but that has been superseded by 3857, see https://www.epsg-registry.org/
+     * <p>
+     * See also <a href="https://pubs.usgs.gov/bul/1532/report.pdf">USGS Bulletin 1532</a>
+     * initially EPSG used 3785 but that has been superseded by 3857, see <a href="https://www.epsg-registry.org/">epsg-registry.org</a>
      */
     public static final ProjectionChoice mercator = registerProjectionChoice(tr("Mercator"), "core:mercator", 3857);
@@ -97,9 +97,9 @@
     /**
      * Lambert conic conform 4 zones using the French geodetic system NTF.
-     *
+     * <p>
      * This newer version uses the grid translation NTF&lt;-&gt;RGF93 provided by IGN for a submillimetric accuracy.
      * (RGF93 is the French geodetic system similar to WGS84 but not mathematically equal)
-     *
-     * Source: http://geodesie.ign.fr/contenu/fichiers/Changement_systeme_geodesique.pdf
+     * <p>
+     * Source: <a href="https://geodesie.ign.fr/contenu/fichiers/Changement_systeme_geodesique.pdf">Changement_systeme_geodesique.pdf</a>
      */
     public static final ProjectionChoice lambert = new LambertProjectionChoice();
@@ -107,5 +107,5 @@
     /**
      * French regions in the Caribbean Sea and Indian Ocean.
-     *
+     * <p>
      * Using the UTM transvers Mercator projection and specific geodesic settings.
      */
@@ -114,7 +114,7 @@
     /**
      * Lambert Conic Conform 9 Zones projection.
-     *
+     * <p>
      * As specified by the IGN in this document
-     * http://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/cc9zones.pdf
+     * <a href="https://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/cc9zones.pdf">cc9zones.pdf</a>
      */
     public static final ProjectionChoice lambert_cc9 = new LambertCC9ZonesProjectionChoice();
@@ -122,20 +122,20 @@
     static {
 
-        /************************
+        /* ***********************
          * Global projections.
          */
 
-        /**
+        /* *
          * UTM.
          */
         registerProjectionChoice(new UTMProjectionChoice());
 
-        /************************
+        /* ***********************
          * Regional - alphabetical order by country code.
          */
 
-        /**
+        /*
          * Belgian Lambert 72 projection.
-         *
+         * <p>
          * As specified by the Belgian IGN in this document:
          * http://www.ngi.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf
@@ -145,7 +145,7 @@
         registerProjectionChoice(tr("Belgian Lambert 1972"), "core:belgianLambert1972", 31370);     // BE
 
-        /**
+        /*
          * Belgian Lambert 2008 projection.
-         *
+         * <p>
          * As specified by the Belgian IGN in this document:
          * http://www.ngi.be/Common/Lambert2008/Transformation_Geographic_Lambert_FR.pdf
@@ -155,10 +155,10 @@
         registerProjectionChoice(tr("Belgian Lambert 2008"), "core:belgianLambert2008", 3812);      // BE
 
-        /**
+        /*
          * SwissGrid CH1903 / L03, see https://en.wikipedia.org/wiki/Swiss_coordinate_system.
-         *
+         * <p>
          * Actually, what we have here, is CH1903+ (EPSG:2056), but without
          * the additional false easting of 2000km and false northing 1000 km.
-         *
+         * <p>
          * To get to CH1903, a shift file is required. So currently, there are errors
          * up to 1.6m (depending on the location).
@@ -168,7 +168,7 @@
         registerProjectionChoice(new GaussKruegerProjectionChoice());                               // DE
 
-        /**
+        /*
          * Estonian Coordinate System of 1997.
-         *
+         * <p>
          * Thanks to Johan Montagnat and its geoconv java converter application
          * (https://www.i3s.unice.fr/~johan/gps/ , published under GPL license)
@@ -177,45 +177,45 @@
         registerProjectionChoice(tr("Lambert Zone (Estonia)"), "core:lambertest", 3301);            // EE
 
-        /**
+        /*
          * Lambert conic conform 4 zones using the French geodetic system NTF.
-         *
+         * <p>
          * This newer version uses the grid translation NTF<->RGF93 provided by IGN for a submillimetric accuracy.
          * (RGF93 is the French geodetic system similar to WGS84 but not mathematically equal)
-         *
-         * Source: http://geodesie.ign.fr/contenu/fichiers/Changement_systeme_geodesique.pdf
+         * <p>
+         * Source: https://geodesie.ign.fr/contenu/fichiers/Changement_systeme_geodesique.pdf
          * @author Pieren
          */
         registerProjectionChoice(lambert);                                                          // FR
 
-        /**
+        /*
          * Lambert 93 projection.
-         *
+         * <p>
          * As specified by the IGN in this document
-         * http://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/Lambert-93.pdf
+         * https://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/Lambert-93.pdf
          * @author Don-vip
          */
         registerProjectionChoice(tr("Lambert 93 (France)"), "core:lambert93", 2154);                // FR
 
-        /**
+        /*
          * Lambert Conic Conform 9 Zones projection.
-         *
+         * <p>
          * As specified by the IGN in this document
-         * http://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/cc9zones.pdf
+         * https://geodesie.ign.fr/contenu/fichiers/documentation/rgf93/cc9zones.pdf
          * @author Pieren
          */
         registerProjectionChoice(lambert_cc9);                                                      // FR
 
-        /**
+        /*
          * French departements in the Caribbean Sea and Indian Ocean.
-         *
+         * <p>
          * Using the UTM transvers Mercator projection and specific geodesic settings.
          */
         registerProjectionChoice(utm_france_dom);                                                   // FR
 
-        /**
+        /*
          * LKS-92/ Latvia TM projection.
-         *
+         * <p>
          * Based on data from spatialreference.org.
-         * http://spatialreference.org/ref/epsg/3059/
+         * https://spatialreference.org/ref/epsg/3059/
          *
          * @author Viesturs Zarins
@@ -223,5 +223,5 @@
         registerProjectionChoice(tr("LKS-92 (Latvia TM)"), "core:tmerclv", 3059);                   // LV
 
-        /**
+        /*
          * Netherlands RD projection
          *
@@ -230,7 +230,7 @@
         registerProjectionChoice(tr("Rijksdriehoekscoördinaten (Netherlands)"), "core:dutchrd", 28992); // NL
 
-        /**
+        /*
          * PUWG 1992 and 2000 are the official cordinate systems in Poland.
-         *
+         * <p>
          * They use the same math as UTM only with different constants.
          *
@@ -239,5 +239,5 @@
         registerProjectionChoice(new PuwgProjectionChoice());                                       // PL
 
-        /**
+        /*
          * SWEREF99 projections. Official coordinate system in Sweden.
          */
@@ -245,10 +245,10 @@
         registerProjectionChoice(tr("SWEREF99 13 30 / EPSG:3008 (Sweden)"), "core:sweref99", 3008); // SE
 
-        /************************
+        /* ***********************
          * Projection by Code.
          */
         registerProjectionChoice(new CodeProjectionChoice());
 
-        /************************
+        /* ***********************
          * Custom projection.
          */
Index: trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetMenu.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetMenu.java	(revision 18871)
@@ -35,4 +35,5 @@
  */
 public class TaggingPresetMenu extends TaggingPreset {
+    /** The menu to show users */
     public JMenu menu; // set by TaggingPresets
 
@@ -73,5 +74,5 @@
     public void setDisplayName() {
         putValue(Action.NAME, getName());
-        /** Tooltips should be shown for the toolbar buttons, but not in the menu. */
+        /* Tooltips should be shown for the toolbar buttons, but not in the menu. */
         putValue(OPTIONAL_TOOLTIP_TEXT, group != null ?
                 tr("Preset group {1} / {0}", getLocaleName(), group.getName()) :
Index: trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java	(revision 18871)
@@ -167,5 +167,5 @@
      */
     public static Collection<TaggingPreset> readAll(Reader in, boolean validate) throws SAXException {
-        return readAll(in, validate, new HashSetWithLast<TaggingPreset>());
+        return readAll(in, validate, new HashSetWithLast<>());
     }
 
@@ -181,9 +181,9 @@
         XmlObjectParser parser = buildParser();
 
-        /** to detect end of {@code <checkgroup>} */
+        /* to detect end of {@code <checkgroup>} */
         CheckGroup lastcheckgroup = null;
-        /** to detect end of {@code <group>} */
+        /* to detect end of {@code <group>} */
         TaggingPresetMenu lastmenu = null;
-        /** to detect end of reused {@code <group>} */
+        /* to detect end of reused {@code <group>} */
         TaggingPresetMenu lastmenuOriginal = null;
         Roles lastrole = null;
@@ -192,5 +192,5 @@
         final Map<String, List<Object>> byId = new HashMap<>();
         final Deque<String> lastIds = new ArrayDeque<>();
-        /** lastIdIterators contains non empty iterators of items to be handled before obtaining the next item from the XML parser */
+        /* lastIdIterators contains non empty iterators of items to be handled before obtaining the next item from the XML parser */
         final Deque<Iterator<Object>> lastIdIterators = new ArrayDeque<>();
 
@@ -351,5 +351,5 @@
      */
     public static Collection<TaggingPreset> readAll(String source, boolean validate) throws SAXException, IOException {
-        return readAll(source, validate, new HashSetWithLast<TaggingPreset>());
+        return readAll(source, validate, new HashSetWithLast<>());
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/KeyedItem.java	(revision 18871)
@@ -242,5 +242,5 @@
             return tags.containsKey(key);
         case KEY_VALUE:
-            return tags.containsKey(key) && getValues().contains(tags.get(key)) ? Boolean.TRUE : null;
+            return (tags.containsKey(key) && getValues().contains(tags.get(key))) ? Boolean.TRUE : null;
         case KEY_VALUE_REQUIRED:
             return tags.containsKey(key) && getValues().contains(tags.get(key));
Index: trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java	(revision 18871)
@@ -1120,11 +1120,10 @@
         @Override
         public String toString() {
-            return new StringBuilder("MultiSplitLayout.Leaf \"")
-              .append(getName())
-              .append("\" weight=")
-              .append(getWeight())
-              .append(' ')
-              .append(getBounds())
-              .toString();
+            return "MultiSplitLayout.Leaf \"" +
+                    getName() +
+                    "\" weight=" +
+                    getWeight() +
+                    ' ' +
+                    getBounds();
         }
     }
Index: trunk/src/org/openstreetmap/josm/io/OsmApi.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/io/OsmApi.java	(revision 18871)
@@ -307,7 +307,7 @@
      */
     protected final String toXml(IPrimitive o, boolean addBody) {
-        StringWriter swriter = new StringWriter();
-        try (OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(new PrintWriter(swriter), true, version)) {
-            swriter.getBuffer().setLength(0);
+        StringWriter stringWriter = new StringWriter();
+        try (OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(new PrintWriter(stringWriter), true, version)) {
+            stringWriter.getBuffer().setLength(0);
             osmWriter.setWithBody(addBody);
             osmWriter.setChangeset(changeset);
@@ -319,5 +319,5 @@
             Logging.warn(e);
         }
-        return swriter.toString();
+        return stringWriter.toString();
     }
 
@@ -328,7 +328,7 @@
      */
     protected final String toXml(Changeset s) {
-        StringWriter swriter = new StringWriter();
-        try (OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(new PrintWriter(swriter), true, version)) {
-            swriter.getBuffer().setLength(0);
+        StringWriter stringWriter = new StringWriter();
+        try (OsmWriter osmWriter = OsmWriterFactory.createOsmWriter(new PrintWriter(stringWriter), true, version)) {
+            stringWriter.getBuffer().setLength(0);
             osmWriter.header();
             osmWriter.visit(s);
@@ -338,5 +338,5 @@
             Logging.warn(e);
         }
-        return swriter.toString();
+        return stringWriter.toString();
     }
 
@@ -348,5 +348,5 @@
         rv.append('/');
         // this works around a ruby (or lighttpd) bug where two consecutive slashes in
-        // an URL will cause a "404 not found" response.
+        // a URL will cause a "404 not found" response.
         int p;
         while ((p = rv.indexOf("//", rv.indexOf("://")+2)) > -1) {
@@ -456,5 +456,5 @@
      * Creates a new changeset based on the keys in <code>changeset</code>. If this
      * method succeeds, changeset.getId() replies the id the server assigned to the new changeset
-     *
+     * <p>
      * The changeset must not be null, but its key/value-pairs may be empty.
      *
@@ -741,5 +741,5 @@
     /**
      * Generic method for sending requests to the OSM API.
-     *
+     * <p>
      * This method will automatically re-try any requests that are answered with a 5xx
      * error code, or that resulted in a timeout exception from the TCP layer.
@@ -851,6 +851,4 @@
             } catch (IOException e) {
                 throw new OsmTransferException(e);
-            } catch (OsmTransferException e) {
-                throw e;
             }
         }
@@ -922,11 +920,10 @@
     public Note createNote(LatLon latlon, String text, ProgressMonitor monitor) throws OsmTransferException {
         initialize(monitor);
-        String noteUrl = new StringBuilder()
-            .append("notes?lat=")
-            .append(latlon.lat())
-            .append("&lon=")
-            .append(latlon.lon())
-            .append("&text=")
-            .append(Utils.encodeUrl(text)).toString();
+        String noteUrl = "notes?lat=" +
+                latlon.lat() +
+                "&lon=" +
+                latlon.lon() +
+                "&text=" +
+                Utils.encodeUrl(text);
 
         return parseSingleNote(sendPostRequest(noteUrl, null, monitor));
Index: trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java	(revision 18871)
@@ -40,6 +40,6 @@
             if (locator == null)
                 return "";
-            return new StringBuilder().append('(').append(locator.getLineNumber())
-                                      .append(',').append(locator.getColumnNumber()).append(')').toString();
+            return "(" + locator.getLineNumber() +
+                    ',' + locator.getColumnNumber() + ')';
         }
 
Index: trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 18871)
@@ -314,5 +314,5 @@
             default: // Do nothing
             }
-            /**
+            /*
              * Did not recognize the element, so the new state is UNKNOWN.
              * This includes the case where we are already inside an unknown
Index: trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java	(revision 18871)
@@ -313,9 +313,10 @@
     /**
      * Returns URL for accessing GetMap service. String will contain following parameters:
-     * * {proj} - that needs to be replaced with projection (one of {@link #getServerProjections(List)})
-     * * {width} - that needs to be replaced with width of the tile
-     * * {height} - that needs to be replaces with height of the tile
-     * * {bbox} - that needs to be replaced with area that should be fetched (in {proj} coordinates)
-     *
+     * <ul>
+     *   <li>{proj} - that needs to be replaced with projection (one of {@link #getServerProjections(List)})</li>
+     *   <li>{width} - that needs to be replaced with width of the tile</li>
+     *   <li>{height} - that needs to be replaces with height of the tile</li>
+     *   <li>{bbox} - that needs to be replaced with area that should be fetched (in {proj} coordinates)</li>
+     * </ul>
      * Format of the response will be calculated using {@link #getPreferredFormat()}
      *
@@ -333,9 +334,10 @@
     /**
      * Returns URL for accessing GetMap service. String will contain following parameters:
-     * * {proj} - that needs to be replaced with projection (one of {@link #getServerProjections(List)})
-     * * {width} - that needs to be replaced with width of the tile
-     * * {height} - that needs to be replaces with height of the tile
-     * * {bbox} - that needs to be replaced with area that should be fetched (in {proj} coordinates)
-     *
+     * <ul>
+     *   <li>{proj} - that needs to be replaced with projection (one of {@link #getServerProjections(List)})</li>
+     *   <li>{width} - that needs to be replaced with width of the tile</li>
+     *   <li>{height} - that needs to be replaces with height of the tile</li>
+     *   <li>{bbox} - that needs to be replaced with area that should be fetched (in {proj} coordinates)</li>
+     * </ul>
      * Format of the response will be calculated using {@link #getPreferredFormat()}
      *
@@ -411,5 +413,5 @@
         boolean ret = a.equals(b);
         if (ret) {
-            return ret;
+            return true;
         }
 
@@ -488,6 +490,6 @@
 
     private void parseRequest(XMLStreamReader reader) throws XMLStreamException {
-        String mode = "";
-        String getMapUrl = "";
+        String mode;
+        String newGetMapUrl = "";
         if (GetCapabilitiesParseHelper.moveReaderToTag(reader, this::tagEquals, QN_GETMAP)) {
             for (int event = reader.getEventType();
@@ -506,14 +508,14 @@
                         mode = reader.getName().getLocalPart();
                         if (GetCapabilitiesParseHelper.moveReaderToTag(reader, this::tagEquals, QN_ONLINE_RESOURCE)) {
-                            getMapUrl = reader.getAttributeValue(GetCapabilitiesParseHelper.XLINK_NS_URL, "href");
+                            newGetMapUrl = reader.getAttributeValue(GetCapabilitiesParseHelper.XLINK_NS_URL, "href");
                         }
                         // TODO should we handle also POST?
-                        if ("GET".equalsIgnoreCase(mode) && getMapUrl != null && !getMapUrl.isEmpty()) {
+                        if ("GET".equalsIgnoreCase(mode) && newGetMapUrl != null && !newGetMapUrl.isEmpty()) {
                             try {
-                                String query = new URL(getMapUrl).getQuery();
+                                String query = new URL(newGetMapUrl).getQuery();
                                 if (query == null) {
-                                    this.getMapUrl = getMapUrl + "?";
+                                    this.getMapUrl = newGetMapUrl + "?";
                                 } else {
-                                    this.getMapUrl = getMapUrl;
+                                    this.getMapUrl = newGetMapUrl;
                                 }
                             } catch (MalformedURLException e) {
@@ -581,5 +583,5 @@
     private void parseAndAddStyle(XMLStreamReader reader, LayerDetails ld) throws XMLStreamException {
         String name = null;
-        String title = null;
+        String styleTitle = null;
         for (int event = reader.getEventType();
                 reader.hasNext() && !(event == XMLStreamReader.END_ELEMENT && tagEquals(QN_STYLE, reader.getName()));
@@ -590,5 +592,5 @@
                 }
                 if (tagEquals(QN_TITLE, reader.getName())) {
-                    title = reader.getElementText();
+                    styleTitle = reader.getElementText();
                 }
             }
@@ -597,5 +599,5 @@
             name = "";
         }
-        ld.addStyle(name, title);
+        ld.addStyle(name, styleTitle);
     }
 
@@ -665,6 +667,6 @@
 
     private static String normalizeUrl(String serviceUrlStr) throws MalformedURLException {
-        URL getCapabilitiesUrl = null;
-        String ret = null;
+        URL getCapabilitiesUrl;
+        String ret;
 
         if (!Pattern.compile(".*GetCapabilities.*", Pattern.CASE_INSENSITIVE).matcher(serviceUrlStr).matches()) {
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 18871)
@@ -196,5 +196,5 @@
         }
 
-        /**
+        /*
          * deselect objects if parameter addtags given
          */
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadDataHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadDataHandler.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadDataHandler.java	(revision 18871)
@@ -82,5 +82,5 @@
         validateDownloadParams();
         this.data = args.get("data");
-        /**
+        /*
          * Holds the mime type. Currently only OSM_MIME_TYPE is supported
          * But it could be extended to text/csv, application/gpx+xml, ... or even binary encoded data
Index: trunk/src/org/openstreetmap/josm/tools/Geometry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/tools/Geometry.java	(revision 18871)
@@ -89,5 +89,5 @@
      * Handles self-intersections too.
      * And makes commands to add the intersection points to ways.
-     *
+     * <p>
      * Prerequisite: no two nodes have the same coordinates.
      *
@@ -244,5 +244,5 @@
     /**
      * Tests if given point is to the right side of path consisting of 3 points.
-     *
+     * <p>
      * (Imagine the path is continued beyond the endpoints, so you get two rays
      * starting from lineP2 and going through lineP1 and lineP3 respectively
@@ -532,5 +532,5 @@
     /**
      * This method tests if secondNode is clockwise to first node.
-     *
+     * <p>
      * The line through the two points commonNode and firstNode divides the
      * plane into two parts. The test returns true, if secondNode lies in
@@ -564,5 +564,5 @@
      */
     public static Area getArea(List<? extends INode> polygon) {
-        Path2D path = new Path2D.Double();
+        Path2D path = new Path2D.Double(Path2D.WIND_NON_ZERO, polygon.size());
 
         boolean begin = true;
@@ -842,10 +842,12 @@
     /**
      * Determines whether a way is oriented clockwise.
-     *
+     * <p>
      * Internals: Assuming a closed non-looping way, compute twice the area
      * of the polygon using the formula {@code 2 * area = sum (X[n] * Y[n+1] - X[n+1] * Y[n])}.
      * If the area is negative the way is ordered in a clockwise direction.
-     *
-     * See http://paulbourke.net/geometry/polyarea/
+     * <p>
+     * See <a href="https://web.archive.org/web/20120722100030/http://paulbourke.net/geometry/polyarea/">
+     *     https://paulbourke.net/geometry/polyarea/
+     *     </a>
      *
      * @param w the way to be checked.
@@ -994,5 +996,5 @@
     /**
      * Compute the center of the circle closest to different nodes.
-     *
+     * <p>
      * Ensure exact center computation in case nodes are already aligned in circle.
      * This is done by least square method.
@@ -1013,5 +1015,5 @@
         int nc = nodes.size();
         if (nc < 3) return null;
-        /**
+        /*
          * Equation of each bisector ax + by + c = 0
          */
@@ -1160,5 +1162,5 @@
         if (!polygon.isClosed() || polygon.getNodesCount() <= 3)
             return res;
-        /** polygon area in east north space, calculated only when really needed */
+        /* polygon area in east north space, calculated only when really needed */
         Area polygonArea = null;
         for (IPrimitive p : primitives) {
@@ -1283,5 +1285,5 @@
     /**
      * Calculate area and perimeter length of a polygon.
-     *
+     * <p>
      * Uses current projection; units are that of the projected coordinates.
      *
@@ -1327,7 +1329,7 @@
      * Get the closest primitive to {@code osm} from the collection of
      * OsmPrimitive {@code primitives}
-     *
+     * <p>
      * The {@code primitives} should be fully downloaded to ensure accuracy.
-     *
+     * <p>
      * Note: The complexity of this method is O(n*m), where n is the number of
      * children {@code osm} has plus 1, m is the number of children the
@@ -1351,7 +1353,7 @@
      * Get the closest primitives to {@code osm} from the collection of
      * OsmPrimitive {@code primitives}
-     *
+     * <p>
      * The {@code primitives} should be fully downloaded to ensure accuracy.
-     *
+     * <p>
      * Note: The complexity of this method is O(n*m), where n is the number of
      * children {@code osm} has plus 1, m is the number of children the
@@ -1386,10 +1388,10 @@
      * Get the furthest primitive to {@code osm} from the collection of
      * OsmPrimitive {@code primitives}
-     *
+     * <p>
      * The {@code primitives} should be fully downloaded to ensure accuracy.
-     *
+     * <p>
      * It does NOT give the furthest primitive based off of the furthest
      * part of that primitive
-     *
+     * <p>
      * Note: The complexity of this method is O(n*m), where n is the number of
      * children {@code osm} has plus 1, m is the number of children the
@@ -1412,10 +1414,10 @@
      * Get the furthest primitives to {@code osm} from the collection of
      * OsmPrimitive {@code primitives}
-     *
+     * <p>
      * The {@code primitives} should be fully downloaded to ensure accuracy.
-     *
+     * <p>
      * It does NOT give the furthest primitive based off of the furthest
      * part of that primitive
-     *
+     * <p>
      * Note: The complexity of this method is O(n*m), where n is the number of
      * children {@code osm} has plus 1, m is the number of children the
@@ -1454,5 +1456,5 @@
      * (or the unit of the current projection, see {@link Projection}).
      * May return {@link Double#NaN} if one of the primitives is incomplete.
-     *
+     * <p>
      * Note: The complexity is O(n*m), where (n,m) are the number of child
      * objects the {@link OsmPrimitive}s have.
Index: trunk/src/org/openstreetmap/josm/tools/ReflectionUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ReflectionUtils.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/tools/ReflectionUtils.java	(revision 18871)
@@ -61,5 +61,5 @@
     }
 
-    private static <T extends Object> T findCaller(Function<StackTraceElement, T> getter, Collection<T> exclusions) {
+    private static <T> T findCaller(Function<StackTraceElement, T> getter, Collection<T> exclusions) {
         StackTraceElement[] stack = Thread.currentThread().getStackTrace();
         for (int i = 3; i < stack.length; i++) {
Index: trunk/src/org/openstreetmap/josm/tools/Shortcut.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Shortcut.java	(revision 18870)
+++ trunk/src/org/openstreetmap/josm/tools/Shortcut.java	(revision 18871)
@@ -28,11 +28,11 @@
 /**
  * Global shortcut class.
- *
+ * <p>
  * Note: This class represents a single shortcut, contains the factory to obtain
  *       shortcut objects from, manages shortcuts and shortcut collisions, and
  *       finally manages loading and saving shortcuts to/from the preferences.
- *
+ * <p>
  * Action authors: You only need the {@link #registerShortcut} factory. Ignore everything else.
- *
+ * <p>
  * All: Use only public methods that are also marked to be used. The others are
  *      public so the shortcut preferences can use them.
@@ -433,4 +433,9 @@
 
     // shutdown handling
+
+    /**
+     * Save shortcuts to preferences
+     * @return {@code true} if preferences were changed
+     */
     public static boolean savePrefs() {
         return shortcuts.stream()
@@ -485,5 +490,5 @@
             Integer code = (int) c;
             result.add(registerShortcut(
-                    new StringBuilder(shortText).append(" (").append(i).append(')').toString(), longText,
+                    shortText + " (" + i + ')', longText,
                     // Add extended keyCode if not a regular one
                     regularKeyCodes.containsKey(code) ? regularKeyCodes.get(code) :
@@ -501,5 +506,5 @@
     /**
      * Register a shortcut.
-     *
+     * <p>
      * Here you get your shortcuts from. The parameters are:
      *
@@ -623,8 +628,8 @@
     /**
      * Returns the tooltip text plus the {@linkplain #getKeyText(KeyStroke) key stroke text}.
-     *
+     * <p>
      * Tooltips are usually not system dependent, unless the
      * JVM is too dumb to provide correct names for all the keys.
-     *
+     * <p>
      * Some LAFs don't understand HTML, such as the OSX LAFs.
      *
