Index: /trunk/scripts/TagInfoExtract.java
===================================================================
--- /trunk/scripts/TagInfoExtract.java	(revision 19107)
+++ /trunk/scripts/TagInfoExtract.java	(revision 19108)
@@ -224,5 +224,5 @@
 
     private abstract class Extractor {
-        abstract void run() throws Exception;
+        abstract void run() throws IOException, OsmTransferException, ParseException, SAXException;
 
         void writeJson(String name, String description, Iterable<TagInfoTag> tags) throws IOException {
Index: /trunk/scripts/TaggingPresetSchemeWikiGenerator.java
===================================================================
--- /trunk/scripts/TaggingPresetSchemeWikiGenerator.java	(revision 19107)
+++ /trunk/scripts/TaggingPresetSchemeWikiGenerator.java	(revision 19108)
@@ -35,5 +35,5 @@
     }
 
-    public static void main(String[] args) throws Exception {
+    public static void main(String[] args) throws IOException, ParserConfigurationException, SAXException, XPathExpressionException {
         document = parseTaggingPresetSchema();
         xPath = XPathFactory.newInstance().newXPath();
Index: /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 19108)
@@ -84,5 +84,5 @@
         // If the user explicitly wants native file dialogs, let them use it.
         // Rather unfortunately, this means that they will not be able to select files and directories.
-        if (FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.get()
+        if (Boolean.TRUE.equals(FileChooserManager.PROP_USE_NATIVE_FILE_DIALOG.get())
                 // This is almost redundant, as the JDK currently doesn't support this with (all?) native file choosers.
                 && !NativeFileChooser.supportsSelectionMode(FILES_AND_DIRECTORIES)) {
Index: /trunk/src/org/openstreetmap/josm/actions/SelectAllAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SelectAllAction.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/actions/SelectAllAction.java	(revision 19108)
@@ -8,4 +8,5 @@
 import java.awt.event.KeyEvent;
 
+import org.openstreetmap.josm.data.osm.IPrimitive;
 import org.openstreetmap.josm.data.osm.OsmData;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -30,10 +31,5 @@
             return;
         OsmData<?, ?, ?, ?> ds = getLayerManager().getActiveData();
-        // Do not use method reference before the Java 11 migration
-        // Otherwise we face a compiler bug, see below:
-        // https://bugs.openjdk.java.net/browse/JDK-8141508
-        // https://bugs.openjdk.java.net/browse/JDK-8142476
-        // https://bugs.openjdk.java.net/browse/JDK-8191655
-        ds.setSelected(ds.getPrimitives(t -> t.isSelectable()));
+        ds.setSelected(ds.getPrimitives(IPrimitive::isSelectable));
     }
 
Index: /trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java	(revision 19108)
@@ -104,16 +104,16 @@
         final Collection<OsmPrimitive> surroundingObjects = getSurroundingObjects(internalPoint);
         final DataSet ds = MainApplication.getLayerManager().getActiveDataSet();
-        if (surroundingObjects.isEmpty()) {
-            return;
-        } else if (doRemove) {
-            final Collection<OsmPrimitive> newSelection = new ArrayList<>(ds.getSelected());
-            newSelection.removeAll(surroundingObjects);
-            ds.setSelected(newSelection);
-        } else if (doAdd) {
-            final Collection<OsmPrimitive> newSelection = new ArrayList<>(ds.getSelected());
-            newSelection.add(surroundingObjects.iterator().next());
-            ds.setSelected(newSelection);
-        } else {
-            ds.setSelected(surroundingObjects.iterator().next());
+        if (!surroundingObjects.isEmpty()) {
+            if (doRemove) {
+                final Collection<OsmPrimitive> newSelection = new ArrayList<>(ds.getSelected());
+                newSelection.removeAll(surroundingObjects);
+                ds.setSelected(newSelection);
+            } else if (doAdd) {
+                final Collection<OsmPrimitive> newSelection = new ArrayList<>(ds.getSelected());
+                newSelection.add(surroundingObjects.iterator().next());
+                ds.setSelected(newSelection);
+            } else {
+                ds.setSelected(surroundingObjects.iterator().next());
+            }
         }
     }
Index: /trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/actions/SelectNonBranchingWaySequences.java	(revision 19108)
@@ -56,8 +56,9 @@
     private void addNodes(Node node) {
         if (node == null) return;
-        else if (!nodes.add(node))
+        if (!nodes.add(node)) {
             outerNodes.remove(node);
-        else
+        } else {
             outerNodes.add(node);
+        }
     }
 
Index: /trunk/src/org/openstreetmap/josm/actions/SessionSaveAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SessionSaveAction.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/actions/SessionSaveAction.java	(revision 19108)
@@ -3,4 +3,5 @@
 
 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 import static org.openstreetmap.josm.tools.I18n.trn;
@@ -8,4 +9,5 @@
 import java.awt.Component;
 import java.awt.Dimension;
+import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
@@ -84,4 +86,5 @@
     private static final BooleanProperty SAVE_PLUGIN_INFORMATION_PROPERTY = new BooleanProperty("session.saveplugins", false);
     private static final String TOOLTIP_DEFAULT = tr("Save the current session.");
+    private static final String SAVE_SESSION = marktr("Save Session");
 
     protected transient FileFilter joz = new ExtensionFileFilter("joz", "joz", tr("Session file (archive) (*.joz)"));
@@ -120,5 +123,5 @@
      */
     protected SessionSaveAction(boolean toolbar, boolean installAdapters) {
-        this(tr("Save Session"), "session", TOOLTIP_DEFAULT,
+        this(tr(SAVE_SESSION), "session", TOOLTIP_DEFAULT,
                 Shortcut.registerShortcut("system:savesession", tr("File: {0}", tr("Save Session...")), KeyEvent.VK_S, Shortcut.ALT_CTRL),
                 toolbar, "save-session", installAdapters);
@@ -183,5 +186,5 @@
                 .collect(Collectors.toList());
 
-        boolean zipRequired = layersOut.stream().map(l -> exporters.get(l))
+        boolean zipRequired = layersOut.stream().map(exporters::get)
                 .anyMatch(ex -> ex != null && ex.requiresZip()) || pluginsWantToSave();
 
@@ -333,7 +336,7 @@
 
         if (zipRequired) {
-            fc = createAndOpenFileChooser(false, false, tr("Save Session"), joz, JFileChooser.FILES_ONLY, "lastDirectory");
+            fc = createAndOpenFileChooser(false, false, tr(SAVE_SESSION), joz, JFileChooser.FILES_ONLY, "lastDirectory");
         } else {
-            fc = createAndOpenFileChooser(false, false, tr("Save Session"), Arrays.asList(jos, joz), jos,
+            fc = createAndOpenFileChooser(false, false, tr(SAVE_SESSION), Arrays.asList(jos, joz), jos,
                     JFileChooser.FILES_ONLY, "lastDirectory");
         }
@@ -366,5 +369,5 @@
          */
         public SessionSaveAsDialog() {
-            super(MainApplication.getMainFrame(), tr("Save Session"), tr("Save As"), tr("Cancel"));
+            super(MainApplication.getMainFrame(), tr(SAVE_SESSION), tr("Save As"), tr("Cancel"));
             configureContextsensitiveHelp("Action/SessionSaveAs", true /* show help button */);
             initialize();
@@ -442,8 +445,8 @@
                 JPanel wrapper = new JPanel(new GridBagLayout());
                 wrapper.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
-                wrapper.add(exportPanel, GBC.std().fill(GBC.HORIZONTAL));
-                ip.add(wrapper, GBC.eol().fill(GBC.HORIZONTAL).insets(2, 2, 4, 2));
-            }
-            ip.add(GBC.glue(0, 1), GBC.eol().fill(GBC.VERTICAL));
+                wrapper.add(exportPanel, GBC.std().fill(GridBagConstraints.HORIZONTAL));
+                ip.add(wrapper, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(2, 2, 4, 2));
+            }
+            ip.add(GBC.glue(0, 1), GBC.eol().fill(GridBagConstraints.VERTICAL));
             JScrollPane sp = new JScrollPane(ip);
             sp.setBorder(BorderFactory.createEmptyBorder());
@@ -475,5 +478,5 @@
             p.add(include, GBC.std());
             p.add(lbl, GBC.std());
-            p.add(GBC.glue(1, 0), GBC.std().fill(GBC.HORIZONTAL));
+            p.add(GBC.glue(1, 0), GBC.std().fill(GridBagConstraints.HORIZONTAL));
             return p;
         }
@@ -538,5 +541,5 @@
      * @deprecated since 18833, use {@link #setCurrentSession(File, List, SessionWriter.SessionWriterFlags...)} instead
      */
-    @Deprecated
+    @Deprecated(since = "18833")
     public static void setCurrentSession(File file, boolean zip, List<Layer> layers) {
         if (zip) {
Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/AbstractDownloadTask.java	(revision 19108)
@@ -61,6 +61,5 @@
 
     protected static <T extends Enum<T> & UrlPattern> String[] patterns(Class<T> urlPatternEnum) {
-        // Do not use a method reference until we switch to Java 11, as we face JDK-8141508 with Java 8
-        return Arrays.stream(urlPatternEnum.getEnumConstants()).map(/* JDK-8141508 */ t -> t.pattern()).toArray(String[]::new);
+        return Arrays.stream(urlPatternEnum.getEnumConstants()).map(UrlPattern::pattern).toArray(String[]::new);
     }
 
Index: /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java	(revision 19108)
@@ -213,6 +213,7 @@
     public Set<OsmPrimitive> getDownloadedPrimitives() {
         return tasks.stream()
-                .filter(t -> t instanceof DownloadOsmTask)
-                .map(t -> ((DownloadOsmTask) t).getDownloadedData())
+                .filter(DownloadOsmTask.class::isInstance)
+                .map(DownloadOsmTask.class::cast)
+                .map(DownloadOsmTask::getDownloadedData)
                 .filter(Objects::nonNull)
                 .flatMap(ds -> ds.allPrimitives().stream())
@@ -240,5 +241,9 @@
                 try {
                     future.get();
-                } catch (InterruptedException | ExecutionException | CancellationException e) {
+                } catch (InterruptedException interruptedException) {
+                    Thread.currentThread().interrupt();
+                    Logging.error(interruptedException);
+                    return;
+                } catch (ExecutionException | CancellationException e) {
                     Logging.error(e);
                     return;
@@ -255,5 +260,4 @@
                                         Utils.joinAsHtmlUnorderedList(errors)) + "</html>",
                                 tr("Errors during download"), JOptionPane.ERROR_MESSAGE);
-                        return;
                     }
                 });
@@ -269,5 +273,5 @@
             if (editDataSet != null && osmData) {
                 final List<DownloadOsmTask> osmTasks = tasks.stream()
-                        .filter(t -> t instanceof DownloadOsmTask).map(t -> (DownloadOsmTask) t)
+                        .filter(DownloadOsmTask.class::isInstance).map(DownloadOsmTask.class::cast)
                         .filter(t -> t.getDownloadedData() != null)
                         .collect(Collectors.toList());
Index: /trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java	(revision 19108)
@@ -390,5 +390,5 @@
         if (!map.mapView.isActiveLayerVisible())
             return;
-        if (!(Boolean) this.getValue("active"))
+        if (Boolean.FALSE.equals(this.getValue("active")))
             return;
         if (e.getButton() != MouseEvent.BUTTON1)
@@ -512,5 +512,5 @@
                     if (moveCommand == null) {
                         //make a new move command
-                        moveCommand = new MoveCommand(new ArrayList<OsmPrimitive>(movingNodeList), bestMovement);
+                        moveCommand = new MoveCommand(new ArrayList<>(movingNodeList), bestMovement);
                         UndoRedoHandler.getInstance().add(moveCommand);
                     } else {
@@ -939,5 +939,6 @@
     private EastNorth calculateBestMovementAndNewNodes(EastNorth mouseEn) {
         EastNorth bestMovement = calculateBestMovement(mouseEn);
-        EastNorth n1movedEn = initialN1en.add(bestMovement), n2movedEn;
+        EastNorth n1movedEn = initialN1en.add(bestMovement);
+        EastNorth n2movedEn;
 
         // find out the movement distance, in metres
@@ -1158,5 +1159,6 @@
         double raoffsety = symbolSize*factor*normal.getY();
 
-        double cx = center.getX(), cy = center.getY();
+        final double cx = center.getX();
+        final double cy = center.getY();
         double k = mirror ? -1 : 1;
         Point2D ra1 = new Point2D.Double(cx + raoffsetx, cy + raoffsety);
Index: /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 19108)
@@ -398,5 +398,5 @@
                     all = ds.allPrimitives();
                 } else {
-                    all = ds.getPrimitives(p -> p.isSelectable()); // Do not use method reference before Java 11!
+                    all = ds.getPrimitives(IPrimitive::isSelectable);
                 }
                 final ProgressMonitor subMonitor = getProgressMonitor().createSubTaskMonitor(all.size(), false);
Index: /trunk/src/org/openstreetmap/josm/data/StructUtils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/StructUtils.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/StructUtils.java	(revision 19108)
@@ -267,11 +267,9 @@
     }
 
-    @SuppressWarnings("rawtypes")
-    private static String mapToJson(Map map) {
+    private static String mapToJson(Map<?, ?> map) {
         StringWriter stringWriter = new StringWriter();
         try (JsonWriter writer = Json.createWriter(stringWriter)) {
             JsonObjectBuilder object = Json.createObjectBuilder();
-            for (Object o: map.entrySet()) {
-                Map.Entry e = (Map.Entry) o;
+            for (Map.Entry<?, ?> e: map.entrySet()) {
                 Object evalue = e.getValue();
                 object.add(e.getKey().toString(), evalue.toString());
@@ -282,10 +280,9 @@
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    private static Map mapFromJson(String s) {
-        Map ret;
+    private static Map<String, String> mapFromJson(String s) {
+        Map<String, String> ret;
         try (JsonReader reader = Json.createReader(new StringReader(s))) {
             JsonObject object = reader.readObject();
-            ret = new HashMap(Utils.hashMapInitialCapacity(object.size()));
+            ret = new HashMap<>(Utils.hashMapInitialCapacity(object.size()));
             for (Map.Entry<String, JsonValue> e: object.entrySet()) {
                 JsonValue value = e.getValue();
@@ -301,12 +298,10 @@
     }
 
-    @SuppressWarnings("rawtypes")
-    private static String multiMapToJson(MultiMap map) {
+    private static String multiMapToJson(MultiMap<?, ?> map) {
         StringWriter stringWriter = new StringWriter();
         try (JsonWriter writer = Json.createWriter(stringWriter)) {
             JsonObjectBuilder object = Json.createObjectBuilder();
-            for (Object o: map.entrySet()) {
-                Map.Entry e = (Map.Entry) o;
-                Set evalue = (Set) e.getValue();
+            for (Map.Entry<?, ?> e : map.entrySet()) {
+                Set<?> evalue = (Set<?>) e.getValue();
                 JsonArrayBuilder a = Json.createArrayBuilder();
                 for (Object evo: evalue) {
@@ -320,10 +315,9 @@
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
-    private static MultiMap multiMapFromJson(String s) {
-        MultiMap ret;
+    private static MultiMap<String, String> multiMapFromJson(String s) {
+        MultiMap<String, String> ret;
         try (JsonReader reader = Json.createReader(new StringReader(s))) {
             JsonObject object = reader.readObject();
-            ret = new MultiMap(object.size());
+            ret = new MultiMap<>(object.size());
             for (Map.Entry<String, JsonValue> e: object.entrySet()) {
                 JsonValue value = e.getValue();
Index: /trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/cache/JCSCacheManager.java	(revision 19108)
@@ -174,5 +174,5 @@
      */
     public static <K, V> CacheAccess<K, V> getCache(String cacheName) {
-        return getCache(cacheName, DEFAULT_MAX_OBJECTS_IN_MEMORY.get().intValue(), 0, null);
+        return getCache(cacheName, DEFAULT_MAX_OBJECTS_IN_MEMORY.get(), 0, null);
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java	(revision 19108)
@@ -474,5 +474,5 @@
      * Check if the object is loadable. This means, if the data will be parsed, and if this response
      * will finish as successful retrieve.
-     *
+     * <p>
      * This simple implementation doesn't load empty response, nor client (4xx) and server (5xx) errors
      *
@@ -544,8 +544,5 @@
         }
 
-        final boolean noCache = force
-                // To remove when switching to Java 11
-                // Workaround for https://bugs.openjdk.java.net/browse/JDK-8146450
-                || (Utils.getJavaVersion() == 8 && Utils.isRunningJavaWebStart());
+        final boolean noCache = force;
         urlConn.useCache(!noCache);
 
Index: /trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Layer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Layer.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Layer.java	(revision 19108)
@@ -99,4 +99,5 @@
      * @throws IOException - if an IO error occurs
      */
+    @SuppressWarnings("PMD.CloseResource") // The resources _are_ closed after use; it just isn't detect with PMD 7.2.x.
     public Layer(Collection<ProtobufRecord> records) throws IOException {
         // Do the unique required fields first
@@ -137,5 +138,5 @@
         }
         // Cleanup bytes (for memory)
-        for (ProtobufRecord protobufRecord : records) {
+        for (ProtobufRecord protobufRecord : records) { // NOSONAR -- this shouldn't be combined since this is a cleanup loop.
             protobufRecord.close();
         }
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 19107)
+++ /trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/style/Layers.java	(revision 19108)
@@ -307,6 +307,5 @@
                     stringBuffer.append(",\"");
                 }
-                stringBuffer.append(tail);
-                stringBuffer.append('"');
+                stringBuffer.append(tail).append('"');
             }
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java	(revision 19108)
@@ -310,5 +310,5 @@
     }
 
-    @Deprecated
+    @Deprecated(since = "17749")
     @Override
     public void setTimestamp(Date timestamp) {
@@ -326,5 +326,5 @@
     }
 
-    @Deprecated
+    @Deprecated(since = "17749")
     @Override
     public Date getTimestamp() {
@@ -648,5 +648,5 @@
         if (key == null || Utils.isStripEmpty(key))
             return;
-        else if (value == null) {
+        if (value == null) {
             remove(key);
         } else if (keys == null) {
@@ -808,4 +808,5 @@
 
     @Override
+    @SuppressWarnings("PMD.UseArraysAsList") // See https://github.com/pmd/pmd/issues/5071
     public final Collection<String> keySet() {
         String[] tKeys = this.keys;
Index: /trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java	(revision 19108)
@@ -50,5 +50,5 @@
     /**
      * constructor
-     *
+     * <p>
      * The visitor will merge <code>sourceDataSet</code> onto <code>targetDataSet</code>
      *
@@ -69,9 +69,9 @@
     /**
      * Merges a primitive onto primitives dataset.
-     *
+     * <p>
      * If other.id != 0 it tries to merge it with an corresponding primitive from
      * my dataset with the same id. If this is not possible a conflict is remembered
      * in {@link #conflicts}.
-     *
+     * <p>
      * If other.id == 0 (new primitive) it tries to find a primitive in my dataset with id == 0 which
      * is semantically equal. If it finds one it merges its technical attributes onto
@@ -239,5 +239,5 @@
                 newNodes.add(targetNode);
                 if (targetNode.isDeleted() && !conflicts.hasConflictForMy(targetNode)) {
-                    addConflict(new Conflict<OsmPrimitive>(targetNode, sourceNode, true));
+                    addConflict(new Conflict<>(targetNode, sourceNode, true));
                     targetNode.setDeleted(false);
                 }
@@ -383,5 +383,5 @@
      * Runs the merge operation. Successfully merged {@link OsmPrimitive}s are in
      * {@link #getTargetDataSet()}.
-     *
+     * <p>
      * See {@link #getConflicts()} for a map of conflicts after the merge operation.
      */
@@ -393,5 +393,5 @@
      * Runs the merge operation. Successfully merged {@link OsmPrimitive}s are in
      * {@link #getTargetDataSet()}.
-     *
+     * <p>
      * See {@link #getConflicts()} for a map of conflicts after the merge operation.
      * @param progressMonitor The progress monitor
@@ -404,5 +404,5 @@
      * Runs the merge operation. Successfully merged {@link OsmPrimitive}s are in
      * {@link #getTargetDataSet()}.
-     *
+     * <p>
      * See {@link #getConflicts()} for a map of conflicts after the merge operation.
      * @param progressMonitor The progress monitor
Index: /trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java	(revision 19108)
@@ -226,7 +226,7 @@
             }
             if (node.isLatLonKnown() && Boolean.TRUE.equals(PROPERTY_SHOW_COOR.get())) {
-                name.append(" \u200E(");
-                name.append(CoordinateFormatManager.getDefaultFormat().toString(node, ", "));
-                name.append(")\u200C");
+                name.append(" \u200E(")
+                    .append(CoordinateFormatManager.getDefaultFormat().toString(node, ", "))
+                    .append(")\u200C");
             }
         }
Index: /trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java	(revision 19108)
@@ -299,5 +299,5 @@
      * @deprecated since 17749, use {@link #getInstant} instead
      */
-    @Deprecated
+    @Deprecated(since = "17749")
     Date getTimestamp();
 
@@ -328,5 +328,5 @@
      * @deprecated since 17749, use {@link #setInstant} instead
      */
-    @Deprecated
+    @Deprecated(since = "17749")
     void setTimestamp(Date timestamp);
 
Index: /trunk/src/org/openstreetmap/josm/data/osm/IRelation.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/IRelation.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/IRelation.java	(revision 19108)
@@ -13,5 +13,5 @@
  * @since 4098
  */
-public interface IRelation<M extends IRelationMember<?>> extends IPrimitive {
+public interface IRelation<M extends IRelationMember<? extends IPrimitive>> extends IPrimitive {
 
     /**
@@ -129,6 +129,6 @@
     default Collection<? extends IPrimitive> getIncompleteMembers() {
         return getMembers().stream()
-                .filter(rm -> rm.getMember().isIncomplete())
-                .map(rm -> rm.getMember())
+                .map(IRelationMember::getMember)
+                .filter(IPrimitive::isIncomplete)
                 .collect(Collectors.toSet());
     }
Index: /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 19108)
@@ -33,7 +33,7 @@
 /**
  * The base class for OSM objects ({@link Node}, {@link Way}, {@link Relation}).
- *
+ * <p>
  * It can be created, deleted and uploaded to the OSM-Server.
- *
+ * <p>
  * Although OsmPrimitive is designed as a base class, it is not to be meant to subclass
  * it by any other than from the package {@link org.openstreetmap.josm.data.osm}. The available primitives are a fixed
@@ -96,5 +96,5 @@
     /**
      * Creates a new primitive for the given id.
-     *
+     * <p>
      * If allowNegativeId is set, provided id can be &lt; 0 and will be set to primitive without any processing.
      * If allowNegativeId is not set, then id will have to be 0 (in that case new unique id will be generated) or
@@ -124,9 +124,9 @@
     /**
      * Creates a new primitive for the given id and version.
-     *
+     * <p>
      * If allowNegativeId is set, provided id can be &lt; 0 and will be set to primitive without any processing.
      * If allowNegativeId is not set, then id will have to be 0 (in that case new unique id will be generated) or
      * positive number.
-     *
+     * <p>
      * If id is not &gt; 0 version is ignored and set to 0.
      *
@@ -225,5 +225,5 @@
     /**
      * Sets the id and the version of this primitive if it is known to the OSM API.
-     *
+     * <p>
      * Since we know the id and its version it can't be incomplete anymore. incomplete
      * is set to false.
@@ -261,5 +261,5 @@
      * The id is a new unique id. The version, changeset and timestamp are set to 0.
      * incomplete and deleted are set to false. It's preferred to use copy constructor with clearMetadata set to true instead
-     *
+     * <p>
      * <strong>Caution</strong>: Do not use this method on primitives which are already added to a {@link DataSet}.
      *
@@ -300,5 +300,5 @@
     }
 
-    @Deprecated
+    @Deprecated(since = "17749", forRemoval = true)
     @Override
     public void setTimestamp(Date timestamp) {
@@ -713,16 +713,16 @@
 
     private void doVisitReferrers(Consumer<OsmPrimitive> visitor) {
-        if (this.referrers == null)
-            return;
-        else if (this.referrers instanceof OsmPrimitive) {
-            OsmPrimitive ref = (OsmPrimitive) this.referrers;
-            if (ref.dataSet == dataSet) {
-                visitor.accept(ref);
-            }
-        } else if (this.referrers instanceof OsmPrimitive[]) {
-            OsmPrimitive[] refs = (OsmPrimitive[]) this.referrers;
-            for (OsmPrimitive ref: refs) {
+        if (this.referrers != null) {
+            if (this.referrers instanceof OsmPrimitive) {
+                OsmPrimitive ref = (OsmPrimitive) this.referrers;
                 if (ref.dataSet == dataSet) {
                     visitor.accept(ref);
+                }
+            } else if (this.referrers instanceof OsmPrimitive[]) {
+                OsmPrimitive[] refs = (OsmPrimitive[]) this.referrers;
+                for (OsmPrimitive ref : refs) {
+                    if (ref.dataSet == dataSet) {
+                        visitor.accept(ref);
+                    }
                 }
             }
@@ -791,5 +791,5 @@
     /**
      * Merges the technical and semantic attributes from <code>other</code> onto this.
-     *
+     * <p>
      * Both this and other must be new, or both must be assigned an OSM ID. If both this and <code>other</code>
      * have an assigned OSM id, the IDs have to be the same.
Index: /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java	(revision 19108)
@@ -161,5 +161,5 @@
      * @since 15820
      */
-    public final UniqueIdGenerator getIdGenerator() {
+    public UniqueIdGenerator getIdGenerator() {
         return idGenerator;
     }
Index: /trunk/src/org/openstreetmap/josm/data/osm/Storage.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/Storage.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/Storage.java	(revision 19108)
@@ -18,5 +18,5 @@
  * It is useful wherever one would use self-mapping construct like
  * <code>Map&lt;T,T&gt;.put(t,t)</code>, that is, for caches, uniqueness filters or similar.
- *
+ * <p>
  * The semantics of equivalency can be external to the object, using the
  * {@link Hash} interface. The set also supports querying for entries using
@@ -400,5 +400,5 @@
      */
     public static <O> Hash<O, O> defaultHash() {
-        return new Hash<O, O>() {
+        return new Hash<>() {
             @Override
             public int getHashCode(O t) {
Index: /trunk/src/org/openstreetmap/josm/data/osm/TagMap.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/TagMap.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/TagMap.java	(revision 19108)
@@ -277,7 +277,7 @@
                 stringBuilder.append(',');
             }
-            stringBuilder.append(e.getKey());
-            stringBuilder.append('=');
-            stringBuilder.append(e.getValue());
+            stringBuilder.append(e.getKey())
+                .append('=')
+                .append(e.getValue());
             first = false;
         }
Index: /trunk/src/org/openstreetmap/josm/data/osm/history/History.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/history/History.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/history/History.java	(revision 19108)
@@ -294,6 +294,9 @@
     @Override
     public String toString() {
-        StringBuilder result = new StringBuilder("History ["
-                + (type != null ? ("type=" + type + ", ") : "") + "id=" + id);
+        StringBuilder result = new StringBuilder("History [");
+        if (type != null) {
+            result.append("type=").append(type).append(", ");
+        }
+        result.append("id=").append(id);
         if (versions != null) {
             result.append(", versions=\n");
Index: /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/RenderBenchmarkCollector.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/RenderBenchmarkCollector.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/RenderBenchmarkCollector.java	(revision 19108)
@@ -113,5 +113,5 @@
 
     public static long getCurrentTimeMilliseconds() {
-        return System.nanoTime() / 1000000; // System.currentTimeMillis has low accuracy, sometimes multiples of 16ms
+        return System.nanoTime() / 1_000_000; // System.currentTimeMillis has low accuracy, sometimes multiples of 16ms
     }
 
@@ -121,5 +121,5 @@
      */
     public static class LoggingBenchmark extends RenderBenchmarkCollector.CapturingBenchmark {
-        private final PrintStream outStream = System.err;
+        private static final PrintStream outStream = System.err;
         private double circum;
 
Index: /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java	(revision 19108)
@@ -41,5 +41,5 @@
 /**
  * Custom projection.
- *
+ * <p>
  * Inspired by PROJ.4 and Proj4J.
  * @since 5072
@@ -59,5 +59,5 @@
     /**
      * pref String that defines the projection
-     *
+     * <p>
      * null means fall back mode (Mercator)
      */
@@ -223,4 +223,5 @@
      * @param pref the string that defines the custom projection
      */
+    @SuppressWarnings("PMD.PreserveStackTrace") // PMD 7.2.x doesn't like log + new exception here for some reason.
     public CustomProjection(String name, String code, String pref) {
         this.name = name;
@@ -874,5 +875,5 @@
     /**
      * Return true, if a geographic coordinate reference system is represented.
-     *
+     * <p>
      * I.e. if it returns latitude/longitude values rather than Cartesian
      * east/north coordinates on a flat surface.
Index: /trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShiftFile.java	(revision 19108)
@@ -171,26 +171,26 @@
         int topLevelCount = 0;
         Map<String, List<NTV2SubGrid>> subGridMap = new HashMap<>();
-        for (int i = 0; i < subGrid.length; i++) {
-            if ("NONE".equalsIgnoreCase(subGrid[i].getParentSubGridName())) {
+        for (NTV2SubGrid ntv2SubGrid : subGrid) {
+            if ("NONE".equalsIgnoreCase(ntv2SubGrid.getParentSubGridName())) {
                 topLevelCount++;
             }
-            subGridMap.put(subGrid[i].getSubGridName(), new ArrayList<NTV2SubGrid>());
+            subGridMap.put(ntv2SubGrid.getSubGridName(), new ArrayList<>());
         }
         NTV2SubGrid[] topLevelSubGrid = new NTV2SubGrid[topLevelCount];
         topLevelCount = 0;
-        for (int i = 0; i < subGrid.length; i++) {
-            if ("NONE".equalsIgnoreCase(subGrid[i].getParentSubGridName())) {
-                topLevelSubGrid[topLevelCount++] = subGrid[i];
+        for (NTV2SubGrid ntv2SubGrid : subGrid) {
+            if ("NONE".equalsIgnoreCase(ntv2SubGrid.getParentSubGridName())) {
+                topLevelSubGrid[topLevelCount++] = ntv2SubGrid;
             } else {
-                List<NTV2SubGrid> parent = subGridMap.get(subGrid[i].getParentSubGridName());
-                parent.add(subGrid[i]);
+                List<NTV2SubGrid> parent = subGridMap.get(ntv2SubGrid.getParentSubGridName());
+                parent.add(ntv2SubGrid);
             }
         }
         NTV2SubGrid[] nullArray = new NTV2SubGrid[0];
-        for (int i = 0; i < subGrid.length; i++) {
-            List<NTV2SubGrid> subSubGrids = subGridMap.get(subGrid[i].getSubGridName());
+        for (NTV2SubGrid ntv2SubGrid : subGrid) {
+            List<NTV2SubGrid> subSubGrids = subGridMap.get(ntv2SubGrid.getSubGridName());
             if (!subSubGrids.isEmpty()) {
                 NTV2SubGrid[] subGridArray = subSubGrids.toArray(nullArray);
-                subGrid[i].setSubGridArray(subGridArray);
+                ntv2SubGrid.setSubGridArray(subGridArray);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/data/validation/ValidatorCLI.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/ValidatorCLI.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/validation/ValidatorCLI.java	(revision 19108)
@@ -281,5 +281,6 @@
                 // The first writeErrors catches anything that was written, for whatever reason. This is probably never
                 // going to be called.
-                final var validationTask = new ValidationTask(errors -> writeErrors(geoJSONMapRouletteWriter, fileOutputStream, errors),
+                final ValidationTask validationTask =
+                        new ValidationTask(errors -> writeErrors(geoJSONMapRouletteWriter, fileOutputStream, errors),
                         progressMonitorFactory.get(), OsmValidator.getEnabledTests(false),
                         dataSet.allPrimitives(), Collections.emptyList(), false);
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(revision 19108)
@@ -342,5 +342,5 @@
                 if (this instanceof CrossingWays.Boundaries) {
                     List<Relation> relations = ds.searchRelations(wt.getBBox()).stream()
-                            .filter(p -> isPrimitiveUsable(p)).collect(Collectors.toList());
+                            .filter(this::isPrimitiveUsable).collect(Collectors.toList());
                     for (Relation r: relations) {
                         for (Way w : r.getMemberPrimitives(Way.class)) {
@@ -360,5 +360,5 @@
 
     static boolean isWaterArea(OsmPrimitive w) {
-        return w.hasTag("natural", "water") || w.hasTag("waterway", "riverbank") || w.hasTag(LANDUSE, "reservoir");
+        return w.hasTag("natural", "water") || w.hasTag(WATERWAY, "riverbank") || w.hasTag(LANDUSE, "reservoir");
     }
 
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java	(revision 19108)
@@ -80,5 +80,5 @@
             LatLon coorK = getLatLon(k);
             LatLon coorT = getLatLon(t);
-            return coorK == coorT || (coorK != null && coorT != null && coorK.equals(coorT));
+            return Objects.equals(coorK, coorT);
         }
 
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(revision 19108)
@@ -21,4 +21,5 @@
 import java.util.stream.Collectors;
 
+import org.openstreetmap.josm.data.osm.IWaySegment;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -122,5 +123,5 @@
             return;
 
-        List<Way> currentWays = duplicated.stream().map(ws -> ws.getWay()).collect(Collectors.toList());
+        List<Way> currentWays = duplicated.stream().map(IWaySegment::getWay).collect(Collectors.toList());
         Collection<WaySegment> highlight;
         if ((highlight = seenWays.get(currentWays)) != null) {
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java	(revision 19108)
@@ -52,14 +52,14 @@
 
     private void testForError(Way w, Node wayNode, OsmPrimitive p) {
-        if (wayNode.isOutsideDownloadArea()
-                || wayNode.getReferrers().stream().anyMatch(p1 -> p1.hasTag("route", "ferry"))) {
-            return;
-        } else if (isArea(p)) {
-            addPossibleError(w, wayNode, p, p);
-        } else {
-            p.referrers(Relation.class)
-                    .filter(r -> r.isMultipolygon() && isArea(r))
-                    .findFirst()
-                    .ifPresent(r -> addPossibleError(w, wayNode, p, r));
+        if (!wayNode.isOutsideDownloadArea()
+                && wayNode.getReferrers().stream().noneMatch(p1 -> p1.hasTag("route", "ferry"))) {
+            if (isArea(p)) {
+                addPossibleError(w, wayNode, p, p);
+            } else {
+                p.referrers(Relation.class)
+                        .filter(r -> r.isMultipolygon() && isArea(r))
+                        .findFirst()
+                        .ifPresent(r -> addPossibleError(w, wayNode, p, r));
+            }
         }
     }
Index: /trunk/src/org/openstreetmap/josm/data/validation/tests/WronglyOrderedWays.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/tests/WronglyOrderedWays.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/data/validation/tests/WronglyOrderedWays.java	(revision 19108)
@@ -37,10 +37,10 @@
 
         String natural = w.get("natural");
-        if (natural == null) {
-            return;
-        } else if ("coastline".equals(natural) && Geometry.isClockwise(w)) {
-            reportError(w, tr("Reversed coastline: land not on left side"), WRONGLY_ORDERED_COAST);
-        } else if ("land".equals(natural) && Geometry.isClockwise(w)) {
-            reportError(w, tr("Reversed land: land not on left side"), WRONGLY_ORDERED_LAND);
+        if (natural != null) {
+            if ("coastline".equals(natural) && Geometry.isClockwise(w)) {
+                reportError(w, tr("Reversed coastline: land not on left side"), WRONGLY_ORDERED_COAST);
+            } else if ("land".equals(natural) && Geometry.isClockwise(w)) {
+                reportError(w, tr("Reversed land: land not on left side"), WRONGLY_ORDERED_LAND);
+            }
         }
     }
Index: /trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 19108)
@@ -14,4 +14,5 @@
 import java.awt.Font;
 import java.awt.GraphicsEnvironment;
+import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.MouseInfo;
@@ -56,4 +57,5 @@
 import javax.swing.Popup;
 import javax.swing.PopupFactory;
+import javax.swing.SwingConstants;
 import javax.swing.UIManager;
 import javax.swing.event.PopupMenuEvent;
@@ -112,7 +114,7 @@
  * It keeps a status line below the map up to date and displays some tooltip
  * information if the user hold the mouse long enough at some point.
- *
+ * <p>
  * All this is done in background to not disturb other processes.
- *
+ * <p>
  * The background thread does not alter any data of the map (read only thread).
  * Also it is rather fail safe. In case of some error in the data, it just does
@@ -316,5 +318,5 @@
             public void run() {
                 // Freeze display when holding down CTRL
-                if ((ms.modifiers & MouseEvent.CTRL_DOWN_MASK) != 0) {
+                if ((ms.modifiers & InputEvent.CTRL_DOWN_MASK) != 0) {
                     // update the information popup's labels though, because the selection might have changed from the outside
                     popupUpdateLabels();
@@ -327,5 +329,5 @@
                 boolean mouseNotMoved = oldMousePos != null && oldMousePos.equals(ms.mousePos);
                 boolean isAtOldPosition = mouseNotMoved && popup != null;
-                boolean middleMouseDown = (ms.modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0;
+                boolean middleMouseDown = (ms.modifiers & InputEvent.BUTTON2_DOWN_MASK) != 0;
 
                 DataSet ds = mv.getLayerManager().getActiveDataSet();
@@ -361,7 +363,7 @@
                                         "Hold CTRL to select directly from this list with the mouse.<hr>")+"</html>",
                                         null,
-                                        JLabel.HORIZONTAL
+                                        SwingConstants.CENTER
                                 );
-                        lbl.setHorizontalAlignment(JLabel.LEADING);
+                        lbl.setHorizontalAlignment(SwingConstants.LEADING);
                         c.add(lbl, GBC.eol().insets(2, 0, 2, 0));
 
@@ -379,5 +381,5 @@
                             JLabel l = popupBuildPrimitiveLabels(osm);
                             lbls.add(l);
-                            c.add(l, GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 2));
+                            c.add(l, GBC.eol().fill(GridBagConstraints.HORIZONTAL).insets(2, 0, 2, 2));
                         }
 
@@ -537,5 +539,5 @@
             // pressed. Cannot use "setSelected()" because it will cause a
             // fireSelectionChanged event which is unnecessary at this point.
-            if ((mods & MouseEvent.SHIFT_DOWN_MASK) == 0) {
+            if ((mods & InputEvent.SHIFT_DOWN_MASK) == 0) {
                 ds.clearSelection();
             }
@@ -648,5 +650,5 @@
                     "<html>" + text.toString() + "</html>",
                     ImageProvider.get(osm.getDisplayType()),
-                    JLabel.HORIZONTAL
+                    SwingConstants.HORIZONTAL
                     ) {
                 // This is necessary so the label updates its colors when the
@@ -661,6 +663,6 @@
             popupSetLabelColors(l, osm);
             l.setFont(l.getFont().deriveFont(Font.PLAIN));
-            l.setVerticalTextPosition(JLabel.TOP);
-            l.setHorizontalAlignment(JLabel.LEADING);
+            l.setVerticalTextPosition(SwingConstants.TOP);
+            l.setHorizontalAlignment(SwingConstants.LEADING);
             l.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
             l.addMouseListener(new MouseAdapter() {
@@ -902,5 +904,5 @@
                     return;
                 // Do not update the view if ctrl or right button is pressed.
-                if ((e.getModifiersEx() & (MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK)) == 0) {
+                if ((e.getModifiersEx() & (InputEvent.CTRL_DOWN_MASK | InputEvent.BUTTON3_DOWN_MASK)) == 0) {
                     updateLatLonText(e.getX(), e.getY());
                 }
@@ -951,5 +953,5 @@
         helpText.setEditable(false);
         add(nameText, GBC.std().insets(3, 0, 0, 0));
-        add(helpText, GBC.std().insets(3, 0, 0, 0).fill(GBC.HORIZONTAL));
+        add(helpText, GBC.std().insets(3, 0, 0, 0).fill(GridBagConstraints.HORIZONTAL));
 
         progressBar.setMaximum(PleaseWaitProgressMonitor.PROGRESS_BAR_MAX);
@@ -1226,5 +1228,5 @@
             }
         }
-        setDist(new SubclassFilteredCollection<OsmPrimitive, Way>(newSelection, Way.class::isInstance));
+        setDist(new SubclassFilteredCollection<>(newSelection, Way.class::isInstance));
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 19107)
+++ /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 19108)
@@ -127,5 +127,5 @@
         private boolean ignoreRepaint;
 
-        private final Set<MapViewPaintable> invalidatedLayers = Collections.newSetFromMap(new IdentityHashMap<MapViewPaintable, Boolean>());
+        private final Set<MapViewPaintable> invalidatedLayers = Collections.newSetFromMap(new IdentityHashMap<>());
 
         @Override
@@ -176,5 +176,5 @@
          */
         private synchronized Set<MapViewPaintable> collectInvalidatedLayers() {
-            Set<MapViewPaintable> layers = Collections.newSetFromMap(new IdentityHashMap<MapViewPaintable, Boolean>());
+            Set<MapViewPaintable> layers = Collections.newSetFromMap(new IdentityHashMap<>());
             layers.addAll(invalidatedLayers);
             invalidatedLayers.clear();
@@ -299,5 +299,5 @@
         });
 
-        setFocusTraversalKeysEnabled(!Shortcut.findShortcut(KeyEvent.VK_TAB, 0).isPresent());
+        setFocusTraversalKeysEnabled(Shortcut.findShortcut(KeyEvent.VK_TAB, 0).isEmpty());
 
         mapNavigationComponents = getMapNavigationComponents(this);
@@ -321,5 +321,5 @@
         zoomSlider.setSize(size);
         zoomSlider.setLocation(3, 0);
-        zoomSlider.setFocusTraversalKeysEnabled(!Shortcut.findShortcut(KeyEvent.VK_TAB, 0).isPresent());
+        zoomSlider.setFocusTraversalKeysEnabled(Shortcut.findShortcut(KeyEvent.VK_TAB, 0).isEmpty());
 
         MapScaler scaler = new MapScaler(forMapView);
Index: /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 19107)
+++ /trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRegressionTest.java	(revision 19108)
@@ -21,5 +21,4 @@
 import java.util.stream.Collectors;
 
-import org.junit.jupiter.api.Assumptions;
 import org.junit.jupiter.api.Test;
 import org.openstreetmap.josm.JOSMFixture;
@@ -29,6 +28,4 @@
 import org.openstreetmap.josm.testutils.annotations.ProjectionNadGrids;
 import org.openstreetmap.josm.tools.Pair;
-import org.openstreetmap.josm.tools.Platform;
-import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -144,9 +141,4 @@
     @Test
     void testNonRegression() throws IOException {
-        // Disable on Github Windows runners + Java 8, minor differences appeared around 2021-07-20
-        Assumptions.assumeFalse(
-                Utils.getJavaVersion() == 8
-                && Platform.determinePlatform() == Platform.WINDOWS
-                && System.getenv("GITHUB_WORKFLOW") != null);
         List<TestData> allData = readData();
         Set<String> dataCodes = allData.stream().map(data -> data.code).collect(Collectors.toSet());
@@ -160,5 +152,4 @@
         }
 
-        final boolean java9 = Utils.getJavaVersion() >= 9;
         for (TestData data : allData) {
             Projection proj = Projections.getProjectionByCode(data.code);
@@ -169,5 +160,5 @@
             EastNorth en = proj.latlon2eastNorth(data.ll);
             LatLon ll2 = proj.eastNorth2latlon(data.en);
-            if (!(java9 ? equalsJava9(en, data.en) : en.equals(data.en))) {
+            if (!equalsJava9(en, data.en)) {
                 String error = String.format("%s (%s): Projecting latlon(%s,%s):%n" +
                         "        expected: eastnorth(%s,%s),%n" +
@@ -176,5 +167,5 @@
                 fail.append(error);
             }
-            if (!(java9 ? equalsJava9(ll2, data.ll2) : ll2.equals(data.ll2))) {
+            if (!equalsJava9(ll2, data.ll2)) {
                 String error = String.format("%s (%s): Inverse projecting eastnorth(%s,%s):%n" +
                         "        expected: latlon(%s,%s),%n" +
