Index: src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java b/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
--- a/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java	(date 1618145515466)
@@ -86,7 +86,7 @@
             return MainApplication.worker.submit(downloadTask);
 
         } else if (GpxUrlPattern.TRACKPOINTS_BBOX.matches(url)) {
-            String[] table = url.split("\\?|=|&", -1);
+            String[] table = url.split("[?=&]", -1);
             for (int i = 0; i < table.length; i++) {
                 if ("bbox".equals(table[i]) && i < table.length-1)
                     return download(settings, new Bounds(table[i+1], ",", ParseMethod.LEFT_BOTTOM_RIGHT_TOP), progressMonitor);
Index: src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java b/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java
--- a/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java	(date 1618145515474)
@@ -22,7 +22,7 @@
  */
 public class DownloadSessionTask extends AbstractDownloadTask<Object> {
 
-    private static final String PATTERN_SESSION = "https?://.*/.*\\.jo(s|z)";
+    private static final String PATTERN_SESSION = "https?://.*/.*\\.jo([sz])";
 
     private Loader loader;
 
Index: src/org/openstreetmap/josm/actions/AutoScaleAction.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/actions/AutoScaleAction.java b/src/org/openstreetmap/josm/actions/AutoScaleAction.java
--- a/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/actions/AutoScaleAction.java	(date 1618145515434)
@@ -96,7 +96,7 @@
          * Returns {@code AutoScaleMode} for a given English label
          * @param englishLabel English label
          * @return {@code AutoScaleMode} for given English label
-         * @throws IllegalArgumentException if Engligh label is unknown
+         * @throws IllegalArgumentException if English label is unknown
          */
         public static AutoScaleMode of(String englishLabel) {
             for (AutoScaleMode v : values()) {
@@ -115,13 +115,12 @@
 
     /** Time of last zoom to bounds action */
     protected long lastZoomTime = -1;
-    /** Last zommed bounds */
+    /** Last zoomed bounds */
     protected int lastZoomArea = -1;
 
     /**
      * Zooms the current map view to the currently selected primitives.
      * Does nothing if there either isn't a current map view or if there isn't a current data layer.
-     *
      */
     public static void zoomToSelection() {
         OsmData<?, ?, ?, ?> dataSet = MainApplication.getLayerManager().getActiveData();
@@ -164,20 +163,25 @@
     private static int getModeShortcut(String mode) {
         int shortcut = -1;
 
-        // TODO: convert this to switch/case and make sure the parsing still works
-        // CHECKSTYLE.OFF: LeftCurly
-        // CHECKSTYLE.OFF: RightCurly
         /* leave as single line for shortcut overview parsing! */
-        if (mode.equals("data")) { shortcut = KeyEvent.VK_1; }
-        else if (mode.equals("layer")) { shortcut = KeyEvent.VK_2; }
-        else if (mode.equals("selection")) { shortcut = KeyEvent.VK_3; }
-        else if (mode.equals("conflict")) { shortcut = KeyEvent.VK_4; }
-        else if (mode.equals("download")) { shortcut = KeyEvent.VK_5; }
-        else if (mode.equals("problem")) { shortcut = KeyEvent.VK_6; }
-        else if (mode.equals("previous")) { shortcut = KeyEvent.VK_8; }
-        else if (mode.equals("next")) { shortcut = KeyEvent.VK_9; }
-        // CHECKSTYLE.ON: LeftCurly
-        // CHECKSTYLE.ON: RightCurly
+        switch (mode) {
+            case "data":
+                shortcut = KeyEvent.VK_1; break;
+            case "layer":
+                shortcut = KeyEvent.VK_2; break;
+            case "selection":
+                shortcut = KeyEvent.VK_3; break;
+            case "conflict":
+                shortcut = KeyEvent.VK_4; break;
+            case "download":
+                shortcut = KeyEvent.VK_5; break;
+            case "problem":
+                shortcut = KeyEvent.VK_6; break;
+            case "previous":
+                shortcut = KeyEvent.VK_8; break;
+            case "next":
+                shortcut = KeyEvent.VK_9; break;
+        }
 
         return shortcut;
     }
Index: src/org/openstreetmap/josm/data/coor/conversion/LatLonParser.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/coor/conversion/LatLonParser.java b/src/org/openstreetmap/josm/data/coor/conversion/LatLonParser.java
--- a/src/org/openstreetmap/josm/data/coor/conversion/LatLonParser.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/data/coor/conversion/LatLonParser.java	(date 1618145515426)
@@ -42,7 +42,7 @@
             + "("+DEG+"|o|deg)|"                // (3)
             + "('|"+MIN+"|min)|"                // (4)
             + "(\"|"+SEC+"|sec)|"               // (5)
-            + "(,|;)|"                          // (6)
+            + "([,;])|"                         // (6)
             + "([NSEW"+N_TR+S_TR+E_TR+W_TR+"])|"// (7)
             + "\\s+|"
             + "(.+)", Pattern.CASE_INSENSITIVE);
Index: src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java b/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java
--- a/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/data/osm/search/SearchCompiler.java	(date 1618145515454)
@@ -323,7 +323,7 @@
             } catch (PatternSyntaxException e) {
                 throw new SearchParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e);
             } catch (IllegalArgumentException | StringIndexOutOfBoundsException e) {
-                // StringIndexOutOfBoundsException catched because of https://bugs.openjdk.java.net/browse/JI-9044959
+                // StringIndexOutOfBoundsException caught because of https://bugs.openjdk.java.net/browse/JI-9044959
                 // See #13870: To remove after we switch to a version of Java which resolves this bug
                 throw new SearchParseError(tr(rxErrorMsgNoPos, regex, e.getMessage()), e);
             }
@@ -746,7 +746,7 @@
                 if (mv != null) {
                     String v1 = Normalizer.normalize(caseSensitive ? mv : mv.toLowerCase(Locale.ENGLISH), Normalizer.Form.NFC);
                     String v2 = Normalizer.normalize(caseSensitive ? value : value.toLowerCase(Locale.ENGLISH), Normalizer.Form.NFC);
-                    return v1.indexOf(v2) != -1;
+                    return v1.contains(v2);
                 }
             }
             return false;
@@ -813,8 +813,8 @@
                 if (referenceValue != null) {
                     v = Double.valueOf(referenceValue);
                 }
-            } catch (NumberFormatException ignore) {
-                Logging.trace(ignore);
+            } catch (NumberFormatException e) {
+                Logging.trace(e);
             }
             this.referenceNumber = v;
             this.compareMode = compareMode;
@@ -1086,7 +1086,7 @@
 
                     value = Normalizer.normalize(value, Normalizer.Form.NFC);
 
-                    if (key.indexOf(search) != -1 || value.indexOf(search) != -1)
+                    if (key.contains(search) || value.contains(search))
                         return true;
                 }
             }
Index: src/org/openstreetmap/josm/data/osm/Storage.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/osm/Storage.java b/src/org/openstreetmap/josm/data/osm/Storage.java
--- a/src/org/openstreetmap/josm/data/osm/Storage.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/data/osm/Storage.java	(date 1618145515470)
@@ -231,9 +231,7 @@
         copyArray();
         modCount++;
         size = 0;
-        for (int i = 0; i < data.length; i++) {
-            data[i] = null;
-        }
+        Arrays.fill(data, null);
     }
 
     @Override
Index: src/org/openstreetmap/josm/data/validation/tests/Addresses.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/validation/tests/Addresses.java b/src/org/openstreetmap/josm/data/validation/tests/Addresses.java
--- a/src/org/openstreetmap/josm/data/validation/tests/Addresses.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/data/validation/tests/Addresses.java	(date 1618145515450)
@@ -268,7 +268,7 @@
      * @return A list of addr:housenumber equivalents
      */
     static List<String> expandHouseNumber(String houseNumber) {
-        return Arrays.asList(houseNumber.split(",|;", -1));
+        return Arrays.asList(houseNumber.split("[,;]", -1));
     }
 
     @Override
Index: src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java b/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java
--- a/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java	(date 1618145515454)
@@ -40,7 +40,7 @@
     private static final Collection<String> KEYS_TO_CHECK = Arrays.asList("opening_hours", "collection_times", "service_times");
     private static final BooleanProperty PREF_STRICT_MODE =
             new BooleanProperty(ValidatorPrefHelper.PREFIX + "." + OpeningHourTest.class.getSimpleName() + "." + "strict", false);
-    private final JCheckBox checkboxStrictMode = new JCheckBox(tr("Enable strict mode."));
+    private final JCheckBox checkboxStrictMode = new JCheckBox(tr("Enable strict mode"));
 
     /**
      * Constructs a new {@code OpeningHourTest}.
Index: src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java b/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
--- a/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java	(date 1618145515430)
@@ -47,7 +47,7 @@
     /** Bag of all way segments */
     private MultiMap<Pair<Node, Node>, WaySegment> nodePairs;
 
-    private boolean onlyKnwonLinear;
+    private boolean onlyKnownLinear;
     private boolean includeOther;
     private boolean ignoreLayer;
 
@@ -83,7 +83,7 @@
         super.startTest(monitor);
         nodePairs = new MultiMap<>(1000);
         includeOther = isBeforeUpload ? ValidatorPrefHelper.PREF_OTHER_UPLOAD.get() : ValidatorPrefHelper.PREF_OTHER.get();
-        onlyKnwonLinear = Config.getPref().getBoolean("overlapping-ways.only-known-linear", true);
+        onlyKnownLinear = Config.getPref().getBoolean("overlapping-ways.only-known-linear", true);
         ignoreLayer = Config.getPref().getBoolean("overlapping-ways.ignore-layer", false);
     }
 
@@ -192,7 +192,7 @@
                 errortype = tr("Waterway shares segment with linear way");
                 type = OVERLAPPING_WATERWAY_LINEAR_WAY;
                 severity = Severity.WARNING;
-            } else if (!includeOther || onlyKnwonLinear) {
+            } else if (!includeOther || onlyKnownLinear) {
                 return;
             } else if (countHighway > 0) {
                 errortype = tr("Highway shares segment with other way");
@@ -269,7 +269,7 @@
         if (IGNORED.test(w))
             return;
 
-        if (onlyKnwonLinear && (w.concernsArea() || w.getInterestingTags().isEmpty()))
+        if (onlyKnownLinear && (w.concernsArea() || w.getInterestingTags().isEmpty()))
             return;
 
         Node lastN = null;
Index: src/org/openstreetmap/josm/data/validation/OsmValidator.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/validation/OsmValidator.java b/src/org/openstreetmap/josm/data/validation/OsmValidator.java
--- a/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(date 1618145515462)
@@ -363,7 +363,7 @@
      */
     public static JTree buildJTreeList() {
         DefaultMutableTreeNode root = new DefaultMutableTreeNode(tr("Ignore list"));
-        final Pattern elemId1Pattern = Pattern.compile(":(r|w|n)_");
+        final Pattern elemId1Pattern = Pattern.compile(":([rwn])_");
         final Pattern elemId2Pattern = Pattern.compile("^[0-9]+$");
         for (Entry<String, String> e: ignoredErrors.entrySet()) {
             String key = e.getKey();
@@ -463,10 +463,10 @@
 
                 String item = child.getUserObject().toString();
                 String entry = null;
-                if (item.matches("^\\[(r|w|n)_.*")) {
+                if (item.matches("^\\[([rwn])_.*")) {
                     // list of elements (produced with list.toString() method)
                     entry = key + ":" + item.substring(1, item.lastIndexOf(']')).replace(", ", ":");
-                } else if (item.matches("^(r|w|n)_.*")) {
+                } else if (item.matches("^([rwn])_.*")) {
                     // single element
                     entry = key + ":" + item;
                 } else if (item.matches("^[0-9]+(_.*|)$")) {
Index: src/org/openstreetmap/josm/data/Preferences.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/data/Preferences.java b/src/org/openstreetmap/josm/data/Preferences.java
--- a/src/org/openstreetmap/josm/data/Preferences.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/data/Preferences.java	(date 1618145515450)
@@ -441,7 +441,7 @@
         }
 
         try (PreferencesWriter writer = new PreferencesWriter(
-                new PrintWriter(new File(prefFile + "_tmp"), StandardCharsets.UTF_8.name()), false, defaults)) {
+                new PrintWriter(prefFile + "_tmp", StandardCharsets.UTF_8.name()), false, defaults)) {
             writer.write(settings);
         } catch (SecurityException e) {
             throw new IOException(e);
Index: src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java b/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
--- a/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java	(date 1618145515446)
@@ -253,10 +253,9 @@
 
     /**
      * Get projections this imagery layer supports natively.
-     *
-     * For example projection of tiles that are downloaded from a server. Layer
-     * may support even more projections (by reprojecting the tiles), but with a
-     * certain loss in image quality and performance.
+     * <p/>
+     * For example projection of tiles that are downloaded from a server. Layer may support even more
+     * projections (by reprojecting the tiles), but with a certain loss in image quality and performance.
      * @return projections this imagery layer supports natively; null if layer is projection agnostic.
      */
     public abstract Collection<String> getNativeProjections();
@@ -643,7 +642,7 @@
          */
         int maxYtiles = (int) Math.ceil((double) height / tileSize + 1);
         int maxXtiles = (int) Math.ceil((double) width / tileSize + 1);
-        int visibileTiles = maxXtiles * maxYtiles;
+        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.
@@ -658,14 +657,14 @@
          * @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 visibileTiles as this unnecessarily grow the cache size
+         * 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
-                visibileTiles * 7 + // 7 to cover tiles from other zooms as described above
+                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
-        Logging.info("AbstractTileSourceLayer: estimated visibile tiles: {0}, estimated cache size: {1}", visibileTiles, ret);
+        Logging.info("AbstractTileSourceLayer: estimated visible tiles: {0}, estimated cache size: {1}", visibleTiles, ret);
         return ret;
     }
 
@@ -867,7 +866,7 @@
     /**
      * Zoom out from map.
      *
-     * @return    true, if zoom increasing was successful, false othervise
+     * @return    true, if zoom increasing was successful, false otherwise
      */
     public boolean decreaseZoomLevel() {
         if (zoomDecreaseAllowed()) {
Index: src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/OnLineStrategy.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/OnLineStrategy.java b/src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/OnLineStrategy.java
--- a/src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/OnLineStrategy.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/gui/mappaint/styleelement/placement/OnLineStrategy.java	(date 1618145515442)
@@ -6,7 +6,6 @@
 import java.awt.geom.Point2D;
 import java.awt.geom.Rectangle2D;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
@@ -88,8 +87,8 @@
         List<OffsetGlyph> offsetGlyphs = computeOffsetGlyphs(gvs,
                 middleOffset + (doRotateText ? 1 : -1) * nb.getWidth() / 2, doRotateText);
 
-        // Order the glyphs along the line to ensure that they are drawn corretly.
-        Collections.sort(offsetGlyphs, Comparator.comparing(OffsetGlyph::getOffset));
+        // Order the glyphs along the line to ensure that they are drawn correctly.
+        offsetGlyphs.sort(Comparator.comparing(OffsetGlyph::getOffset));
 
         // Now translate all glyphs. This will modify the glyphs stored in gvs.
         path.visitLine(new GlyphRotatingVisitor(offsetGlyphs, isDoubleTranslationBug));
Index: src/org/openstreetmap/josm/gui/preferences/imagery/HeadersTable.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/preferences/imagery/HeadersTable.java b/src/org/openstreetmap/josm/gui/preferences/imagery/HeadersTable.java
--- a/src/org/openstreetmap/josm/gui/preferences/imagery/HeadersTable.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/gui/preferences/imagery/HeadersTable.java	(date 1618145515426)
@@ -106,7 +106,7 @@
     }
 
     private static List<String[]> getHeadersAsVector(Map<String, String> headers) {
-        return headers.entrySet().stream().sorted(Comparator.comparing(Map.Entry::getKey))
+        return headers.entrySet().stream().sorted(Map.Entry.comparingByKey())
                 .map(e -> new String[] {e.getKey(), e.getValue()}).collect(Collectors.toList());
     }
 
Index: src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java b/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
--- a/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(date 1618145515438)
@@ -108,8 +108,8 @@
                 }
             }
         }
-        KeyboardUtils.getExtendedKeyCodes(InputContext.getInstance().getLocale()).entrySet()
-            .forEach(e -> list.put(e.getKey(), e.getValue().toString()));
+        KeyboardUtils.getExtendedKeyCodes(InputContext.getInstance().getLocale())
+                .forEach((key, value) -> list.put(key, value.toString()));
         list.put(Integer.valueOf(-1), "");
         return list;
     }
Index: src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java b/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java
--- a/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetItem.java	(date 1618145515462)
@@ -88,7 +88,7 @@
         if (TYPE_CACHE.containsKey(types))
             return TYPE_CACHE.get(types);
         Set<TaggingPresetType> result = EnumSet.noneOf(TaggingPresetType.class);
-        for (String type : Arrays.asList(types.split(",", -1))) {
+        for (String type : types.split(",", -1)) {
             try {
                 TaggingPresetType presetType = TaggingPresetType.fromString(type);
                 if (presetType != null) {
Index: src/org/openstreetmap/josm/gui/MainApplication.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/gui/MainApplication.java b/src/org/openstreetmap/josm/gui/MainApplication.java
--- a/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/gui/MainApplication.java	(date 1618145515438)
@@ -1257,9 +1257,9 @@
                                 }
                                 Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
                                 if (!wasv6) {
-                                    Logging.info(tr("Detected useable IPv6 network, preferring IPv6 over IPv4 after next restart."));
+                                    Logging.info(tr("Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart."));
                                 } else {
-                                    Logging.info(tr("Detected useable IPv6 network, preferring IPv6 over IPv4."));
+                                    Logging.info(tr("Detected usable IPv6 network, preferring IPv6 over IPv4."));
                                 }
                             }
                             break; /* we're done */
@@ -1271,7 +1271,7 @@
                     Logging.trace(e);
                 }
                 if (wasv6 && !hasv6) {
-                    Logging.info(tr("Detected no useable IPv6 network, preferring IPv4 over IPv6 after next restart."));
+                    Logging.info(tr("Detected no usable IPv6 network, preferring IPv4 over IPv6 after next restart."));
                     Config.getPref().putBoolean("validated.ipv6", hasv6); // be sure it is stored before the restart!
                     RestartAction.restartJOSM();
                 }
Index: src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java b/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java
--- a/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/io/rtklib/RtkLibPosReader.java	(date 1618145515474)
@@ -77,7 +77,7 @@
         Collection<Collection<WayPoint>> currentTrack = new ArrayList<>();
         Collection<WayPoint> waypoints = new ArrayList<>();
         try (BufferedReader rd = new BufferedReader(new InputStreamReader(source, StandardCharsets.UTF_8))) {
-            String line = null;
+            String line;
             do {
                 line = rd.readLine();
                 if (line != null) {
@@ -124,8 +124,8 @@
     }
 
     /**
-     * Returns the number of coordinates that have been successfuly read.
-     * @return the number of coordinates that have been successfuly read
+     * Returns the number of coordinates that have been successfully read.
+     * @return the number of coordinates that have been successfully read
      */
     public int getNumberOfCoordinates() {
         return success;
Index: src/org/openstreetmap/josm/io/CachedFile.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/io/CachedFile.java b/src/org/openstreetmap/josm/io/CachedFile.java
--- a/src/org/openstreetmap/josm/io/CachedFile.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/io/CachedFile.java	(date 1618145515458)
@@ -352,7 +352,7 @@
             while (entries.hasMoreElements()) {
                 ZipEntry entry = entries.nextElement();
                 // choose any file with correct extension. When more than one file, prefer the one which matches namepart
-                if (entry.getName().endsWith('.' + extension) && (resentry == null || entry.getName().indexOf(namepart) >= 0)) {
+                if (entry.getName().endsWith('.' + extension) && (resentry == null || entry.getName().contains(namepart))) {
                     resentry = entry;
                 }
             }
Index: src/org/openstreetmap/josm/io/GpxWriter.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/io/GpxWriter.java b/src/org/openstreetmap/josm/io/GpxWriter.java
--- a/src/org/openstreetmap/josm/io/GpxWriter.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/io/GpxWriter.java	(date 1618145515458)
@@ -97,7 +97,7 @@
             GpxExtensionCollection layerExts = data.getExtensions().add("josm", "layerPreferences").getExtensions();
             data.getLayerPrefs().entrySet()
             .stream()
-            .sorted(Comparator.comparing(Map.Entry::getKey))
+            .sorted(Map.Entry.comparingByKey())
             .forEach(entry -> {
                 GpxExtension e = layerExts.add("josm", "entry");
                 e.put("key", entry.getKey());
Index: src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java b/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java
--- a/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/io/InvalidXmlCharacterFilter.java	(date 1618145515466)
@@ -3,6 +3,7 @@
 
 import java.io.IOException;
 import java.io.Reader;
+import java.util.Arrays;
 
 import org.openstreetmap.josm.tools.Logging;
 
@@ -27,9 +28,7 @@
 
     static {
         INVALID_CHARS = new boolean[0x20];
-        for (int i = 0; i < INVALID_CHARS.length; ++i) {
-            INVALID_CHARS[i] = true;
-        }
+        Arrays.fill(INVALID_CHARS, true);
         INVALID_CHARS[0x9] = false; // tab
         INVALID_CHARS[0xA] = false; // LF
         INVALID_CHARS[0xD] = false; // CR
Index: src/org/openstreetmap/josm/io/OsmWriter.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/io/OsmWriter.java b/src/org/openstreetmap/josm/io/OsmWriter.java
--- a/src/org/openstreetmap/josm/io/OsmWriter.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/io/OsmWriter.java	(date 1618145515442)
@@ -319,7 +319,7 @@
         addTags(cs, "changeset", false); // also writes closing </changeset>
     }
 
-    protected static final Comparator<Entry<String, String>> byKeyComparator = Comparator.comparing(Entry::getKey);
+    protected static final Comparator<Entry<String, String>> byKeyComparator = Entry.comparingByKey();
 
     protected void addTags(Tagged osm, String tagname, boolean tagOpen) {
         if (osm.hasKeys()) {
Index: src/org/openstreetmap/josm/io/OverpassDownloadReader.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/io/OverpassDownloadReader.java b/src/org/openstreetmap/josm/io/OverpassDownloadReader.java
--- a/src/org/openstreetmap/josm/io/OverpassDownloadReader.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/io/OverpassDownloadReader.java	(date 1618145515478)
@@ -270,7 +270,7 @@
             p = Period.parse(javaDur ? duration.substring(0, idx) : duration);
         }
         if (javaDur) {
-            d = Duration.parse(javaPer ? 'P' + duration.substring(idx, duration.length()) : duration);
+            d = Duration.parse(javaPer ? 'P' + duration.substring(idx) : duration);
         } else if (!javaPer) {
             d = Duration.parse(duration);
         }
Index: src/org/openstreetmap/josm/tools/LanguageInfo.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/org/openstreetmap/josm/tools/LanguageInfo.java b/src/org/openstreetmap/josm/tools/LanguageInfo.java
--- a/src/org/openstreetmap/josm/tools/LanguageInfo.java	(revision 17746)
+++ b/src/org/openstreetmap/josm/tools/LanguageInfo.java	(date 1617873403060)
@@ -65,16 +65,21 @@
                     return "";
                 }
             }
-            if ("nb".equals(code)) { /* OSM-Wiki has "no", but no "nb" */
-                return "No:";
-            } else if ("sr@latin".equals(code)) { /* OSM-Wiki has "Sr-latn" and not Sr-latin */
-                return "Sr-latn:";
-            } else if ("de".equals(code) || "es".equals(code) || "fr".equals(code)
-                    || "it".equals(code) || "nl".equals(code) || "ru".equals(code)
-                    || "ja".equals(code)) {
-                return code.toUpperCase(Locale.ENGLISH) + ":";
-            } else {
-                return code.substring(0, 1).toUpperCase(Locale.ENGLISH) + code.substring(1) + ":";
+            switch (code) {
+                case "nb":          /* OSM-Wiki has "no", but no "nb" */
+                    return "No:";
+                case "sr@latin":    /* OSM-Wiki has "Sr-latn" and not Sr-latin */
+                    return "Sr-latn:";
+                case "de":
+                case "es":
+                case "fr":
+                case "it":
+                case "nl":
+                case "ru":
+                case "ja":
+                    return code.toUpperCase(Locale.ENGLISH) + ":";
+                default:
+                    return code.substring(0, 1).toUpperCase(Locale.ENGLISH) + code.substring(1) + ":";
             }
         }
 
@@ -159,14 +164,15 @@
      */
     public static String getJavaLocaleCode(String localeName) {
         if (localeName == null) return "en";
-        if ("ca@valencia".equals(localeName)) {
-            localeName = "ca__valencia";
-        } else if ("sr@latin".equals(localeName)) {
-            localeName = "sr__latin";
-        } else if ("he".equals(localeName)) {
-            localeName = "iw_IL";
-        } else if ("id".equals(localeName)) {
-            localeName = "in";
+        switch (localeName) {
+            case "ca@valencia":
+                localeName = "ca__valencia"; break;
+            case "sr@latin":
+                localeName = "sr__latin"; break;
+            case "he":
+                localeName = "iw_IL"; break;
+            case "id":
+                localeName = "in"; break;
         }
         return localeName;
     }
