Ticket #20741: josm_20741.diff

File josm_20741.diff, 34.0 KB (added by gaben, 5 years ago)
  • 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 b  
    8686            return MainApplication.worker.submit(downloadTask);
    8787
    8888        } else if (GpxUrlPattern.TRACKPOINTS_BBOX.matches(url)) {
    89             String[] table = url.split("\\?|=|&", -1);
     89            String[] table = url.split("[?=&]", -1);
    9090            for (int i = 0; i < table.length; i++) {
    9191                if ("bbox".equals(table[i]) && i < table.length-1)
    9292                    return download(settings, new Bounds(table[i+1], ",", ParseMethod.LEFT_BOTTOM_RIGHT_TOP), progressMonitor);
  • 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 b  
    2222 */
    2323public class DownloadSessionTask extends AbstractDownloadTask<Object> {
    2424
    25     private static final String PATTERN_SESSION = "https?://.*/.*\\.jo(s|z)";
     25    private static final String PATTERN_SESSION = "https?://.*/.*\\.jo([sz])";
    2626
    2727    private Loader loader;
    2828
  • 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 b  
    9696         * Returns {@code AutoScaleMode} for a given English label
    9797         * @param englishLabel English label
    9898         * @return {@code AutoScaleMode} for given English label
    99          * @throws IllegalArgumentException if Engligh label is unknown
     99         * @throws IllegalArgumentException if English label is unknown
    100100         */
    101101        public static AutoScaleMode of(String englishLabel) {
    102102            for (AutoScaleMode v : values()) {
     
    115115
    116116    /** Time of last zoom to bounds action */
    117117    protected long lastZoomTime = -1;
    118     /** Last zommed bounds */
     118    /** Last zoomed bounds */
    119119    protected int lastZoomArea = -1;
    120120
    121121    /**
    122122     * Zooms the current map view to the currently selected primitives.
    123123     * Does nothing if there either isn't a current map view or if there isn't a current data layer.
    124      *
    125124     */
    126125    public static void zoomToSelection() {
    127126        OsmData<?, ?, ?, ?> dataSet = MainApplication.getLayerManager().getActiveData();
     
    164163    private static int getModeShortcut(String mode) {
    165164        int shortcut = -1;
    166165
    167         // TODO: convert this to switch/case and make sure the parsing still works
    168         // CHECKSTYLE.OFF: LeftCurly
    169         // CHECKSTYLE.OFF: RightCurly
    170166        /* leave as single line for shortcut overview parsing! */
    171         if (mode.equals("data")) { shortcut = KeyEvent.VK_1; }
    172         else if (mode.equals("layer")) { shortcut = KeyEvent.VK_2; }
    173         else if (mode.equals("selection")) { shortcut = KeyEvent.VK_3; }
    174         else if (mode.equals("conflict")) { shortcut = KeyEvent.VK_4; }
    175         else if (mode.equals("download")) { shortcut = KeyEvent.VK_5; }
    176         else if (mode.equals("problem")) { shortcut = KeyEvent.VK_6; }
    177         else if (mode.equals("previous")) { shortcut = KeyEvent.VK_8; }
    178         else if (mode.equals("next")) { shortcut = KeyEvent.VK_9; }
    179         // CHECKSTYLE.ON: LeftCurly
    180         // CHECKSTYLE.ON: RightCurly
     167        switch (mode) {
     168            case "data":
     169                shortcut = KeyEvent.VK_1; break;
     170            case "layer":
     171                shortcut = KeyEvent.VK_2; break;
     172            case "selection":
     173                shortcut = KeyEvent.VK_3; break;
     174            case "conflict":
     175                shortcut = KeyEvent.VK_4; break;
     176            case "download":
     177                shortcut = KeyEvent.VK_5; break;
     178            case "problem":
     179                shortcut = KeyEvent.VK_6; break;
     180            case "previous":
     181                shortcut = KeyEvent.VK_8; break;
     182            case "next":
     183                shortcut = KeyEvent.VK_9; break;
     184        }
    181185
    182186        return shortcut;
    183187    }
  • 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 b  
    4242            + "("+DEG+"|o|deg)|"                // (3)
    4343            + "('|"+MIN+"|min)|"                // (4)
    4444            + "(\"|"+SEC+"|sec)|"               // (5)
    45             + "(,|;)|"                          // (6)
     45            + "([,;])|"                         // (6)
    4646            + "([NSEW"+N_TR+S_TR+E_TR+W_TR+"])|"// (7)
    4747            + "\\s+|"
    4848            + "(.+)", Pattern.CASE_INSENSITIVE);
  • 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 b  
    323323            } catch (PatternSyntaxException e) {
    324324                throw new SearchParseError(tr(rxErrorMsg, e.getPattern(), e.getIndex(), e.getMessage()), e);
    325325            } catch (IllegalArgumentException | StringIndexOutOfBoundsException e) {
    326                 // StringIndexOutOfBoundsException catched because of https://bugs.openjdk.java.net/browse/JI-9044959
     326                // StringIndexOutOfBoundsException caught because of https://bugs.openjdk.java.net/browse/JI-9044959
    327327                // See #13870: To remove after we switch to a version of Java which resolves this bug
    328328                throw new SearchParseError(tr(rxErrorMsgNoPos, regex, e.getMessage()), e);
    329329            }
     
    746746                if (mv != null) {
    747747                    String v1 = Normalizer.normalize(caseSensitive ? mv : mv.toLowerCase(Locale.ENGLISH), Normalizer.Form.NFC);
    748748                    String v2 = Normalizer.normalize(caseSensitive ? value : value.toLowerCase(Locale.ENGLISH), Normalizer.Form.NFC);
    749                     return v1.indexOf(v2) != -1;
     749                    return v1.contains(v2);
    750750                }
    751751            }
    752752            return false;
     
    813813                if (referenceValue != null) {
    814814                    v = Double.valueOf(referenceValue);
    815815                }
    816             } catch (NumberFormatException ignore) {
    817                 Logging.trace(ignore);
     816            } catch (NumberFormatException e) {
     817                Logging.trace(e);
    818818            }
    819819            this.referenceNumber = v;
    820820            this.compareMode = compareMode;
     
    10861086
    10871087                    value = Normalizer.normalize(value, Normalizer.Form.NFC);
    10881088
    1089                     if (key.indexOf(search) != -1 || value.indexOf(search) != -1)
     1089                    if (key.contains(search) || value.contains(search))
    10901090                        return true;
    10911091                }
    10921092            }
  • 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 b  
    231231        copyArray();
    232232        modCount++;
    233233        size = 0;
    234         for (int i = 0; i < data.length; i++) {
    235             data[i] = null;
    236         }
     234        Arrays.fill(data, null);
    237235    }
    238236
    239237    @Override
  • 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 b  
    268268     * @return A list of addr:housenumber equivalents
    269269     */
    270270    static List<String> expandHouseNumber(String houseNumber) {
    271         return Arrays.asList(houseNumber.split(",|;", -1));
     271        return Arrays.asList(houseNumber.split("[,;]", -1));
    272272    }
    273273
    274274    @Override
  • 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 b  
    4040    private static final Collection<String> KEYS_TO_CHECK = Arrays.asList("opening_hours", "collection_times", "service_times");
    4141    private static final BooleanProperty PREF_STRICT_MODE =
    4242            new BooleanProperty(ValidatorPrefHelper.PREFIX + "." + OpeningHourTest.class.getSimpleName() + "." + "strict", false);
    43     private final JCheckBox checkboxStrictMode = new JCheckBox(tr("Enable strict mode."));
     43    private final JCheckBox checkboxStrictMode = new JCheckBox(tr("Enable strict mode"));
    4444
    4545    /**
    4646     * Constructs a new {@code OpeningHourTest}.
  • 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 b  
    4747    /** Bag of all way segments */
    4848    private MultiMap<Pair<Node, Node>, WaySegment> nodePairs;
    4949
    50     private boolean onlyKnwonLinear;
     50    private boolean onlyKnownLinear;
    5151    private boolean includeOther;
    5252    private boolean ignoreLayer;
    5353
     
    8383        super.startTest(monitor);
    8484        nodePairs = new MultiMap<>(1000);
    8585        includeOther = isBeforeUpload ? ValidatorPrefHelper.PREF_OTHER_UPLOAD.get() : ValidatorPrefHelper.PREF_OTHER.get();
    86         onlyKnwonLinear = Config.getPref().getBoolean("overlapping-ways.only-known-linear", true);
     86        onlyKnownLinear = Config.getPref().getBoolean("overlapping-ways.only-known-linear", true);
    8787        ignoreLayer = Config.getPref().getBoolean("overlapping-ways.ignore-layer", false);
    8888    }
    8989
     
    192192                errortype = tr("Waterway shares segment with linear way");
    193193                type = OVERLAPPING_WATERWAY_LINEAR_WAY;
    194194                severity = Severity.WARNING;
    195             } else if (!includeOther || onlyKnwonLinear) {
     195            } else if (!includeOther || onlyKnownLinear) {
    196196                return;
    197197            } else if (countHighway > 0) {
    198198                errortype = tr("Highway shares segment with other way");
     
    269269        if (IGNORED.test(w))
    270270            return;
    271271
    272         if (onlyKnwonLinear && (w.concernsArea() || w.getInterestingTags().isEmpty()))
     272        if (onlyKnownLinear && (w.concernsArea() || w.getInterestingTags().isEmpty()))
    273273            return;
    274274
    275275        Node lastN = null;
  • 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 b  
    363363     */
    364364    public static JTree buildJTreeList() {
    365365        DefaultMutableTreeNode root = new DefaultMutableTreeNode(tr("Ignore list"));
    366         final Pattern elemId1Pattern = Pattern.compile(":(r|w|n)_");
     366        final Pattern elemId1Pattern = Pattern.compile(":([rwn])_");
    367367        final Pattern elemId2Pattern = Pattern.compile("^[0-9]+$");
    368368        for (Entry<String, String> e: ignoredErrors.entrySet()) {
    369369            String key = e.getKey();
     
    463463
    464464                String item = child.getUserObject().toString();
    465465                String entry = null;
    466                 if (item.matches("^\\[(r|w|n)_.*")) {
     466                if (item.matches("^\\[([rwn])_.*")) {
    467467                    // list of elements (produced with list.toString() method)
    468468                    entry = key + ":" + item.substring(1, item.lastIndexOf(']')).replace(", ", ":");
    469                 } else if (item.matches("^(r|w|n)_.*")) {
     469                } else if (item.matches("^([rwn])_.*")) {
    470470                    // single element
    471471                    entry = key + ":" + item;
    472472                } else if (item.matches("^[0-9]+(_.*|)$")) {
  • 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 b  
    441441        }
    442442
    443443        try (PreferencesWriter writer = new PreferencesWriter(
    444                 new PrintWriter(new File(prefFile + "_tmp"), StandardCharsets.UTF_8.name()), false, defaults)) {
     444                new PrintWriter(prefFile + "_tmp", StandardCharsets.UTF_8.name()), false, defaults)) {
    445445            writer.write(settings);
    446446        } catch (SecurityException e) {
    447447            throw new IOException(e);
  • 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 b  
    253253
    254254    /**
    255255     * Get projections this imagery layer supports natively.
    256      *
    257      * For example projection of tiles that are downloaded from a server. Layer
    258      * may support even more projections (by reprojecting the tiles), but with a
    259      * certain loss in image quality and performance.
     256     * <p/>
     257     * For example projection of tiles that are downloaded from a server. Layer may support even more
     258     * projections (by reprojecting the tiles), but with a certain loss in image quality and performance.
    260259     * @return projections this imagery layer supports natively; null if layer is projection agnostic.
    261260     */
    262261    public abstract Collection<String> getNativeProjections();
     
    643642         */
    644643        int maxYtiles = (int) Math.ceil((double) height / tileSize + 1);
    645644        int maxXtiles = (int) Math.ceil((double) width / tileSize + 1);
    646         int visibileTiles = maxXtiles * maxYtiles;
     645        int visibleTiles = maxXtiles * maxYtiles;
    647646        /**
    648647         * Take into account ZOOM_OFFSET to calculate real number of tiles and multiply by 7, to cover all tiles, that might be
    649648         * accessed when looking for tiles outside current zoom level.
     
    658657         * @see #drawInViewArea((Graphics2D, MapView, ProjectionBounds)
    659658         *
    660659         * Add +2 to maxYtiles / maxXtiles to add space in cache for extra tiles in current zoom level that are
    661          * download by overloadTiles(). This is not added in computation of visibileTiles as this unnecessarily grow the cache size
     660         * download by overloadTiles(). This is not added in computation of visibleTiles as this unnecessarily grow the cache size
    662661         * @see #overloadTiles()
    663662         */
    664663        int ret = (int) Math.ceil(
    665664                Math.pow(2d, ZOOM_OFFSET.get()) * // use offset to decide, how many tiles are visible
    666                 visibileTiles * 7 + // 7 to cover tiles from other zooms as described above
     665                visibleTiles * 7 + // 7 to cover tiles from other zooms as described above
    667666                ((maxYtiles + 2) * (maxXtiles +2))); // to add as many tiles as they will be accessed on current zoom level
    668         Logging.info("AbstractTileSourceLayer: estimated visibile tiles: {0}, estimated cache size: {1}", visibileTiles, ret);
     667        Logging.info("AbstractTileSourceLayer: estimated visible tiles: {0}, estimated cache size: {1}", visibleTiles, ret);
    669668        return ret;
    670669    }
    671670
     
    867866    /**
    868867     * Zoom out from map.
    869868     *
    870      * @return    true, if zoom increasing was successful, false othervise
     869     * @return    true, if zoom increasing was successful, false otherwise
    871870     */
    872871    public boolean decreaseZoomLevel() {
    873872        if (zoomDecreaseAllowed()) {
  • 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 b  
    66import java.awt.geom.Point2D;
    77import java.awt.geom.Rectangle2D;
    88import java.util.ArrayList;
    9 import java.util.Collections;
    109import java.util.Comparator;
    1110import java.util.Iterator;
    1211import java.util.List;
     
    8887        List<OffsetGlyph> offsetGlyphs = computeOffsetGlyphs(gvs,
    8988                middleOffset + (doRotateText ? 1 : -1) * nb.getWidth() / 2, doRotateText);
    9089
    91         // Order the glyphs along the line to ensure that they are drawn corretly.
    92         Collections.sort(offsetGlyphs, Comparator.comparing(OffsetGlyph::getOffset));
     90        // Order the glyphs along the line to ensure that they are drawn correctly.
     91        offsetGlyphs.sort(Comparator.comparing(OffsetGlyph::getOffset));
    9392
    9493        // Now translate all glyphs. This will modify the glyphs stored in gvs.
    9594        path.visitLine(new GlyphRotatingVisitor(offsetGlyphs, isDoubleTranslationBug));
  • 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 b  
    106106    }
    107107
    108108    private static List<String[]> getHeadersAsVector(Map<String, String> headers) {
    109         return headers.entrySet().stream().sorted(Comparator.comparing(Map.Entry::getKey))
     109        return headers.entrySet().stream().sorted(Map.Entry.comparingByKey())
    110110                .map(e -> new String[] {e.getKey(), e.getValue()}).collect(Collectors.toList());
    111111    }
    112112
  • 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 b  
    108108                }
    109109            }
    110110        }
    111         KeyboardUtils.getExtendedKeyCodes(InputContext.getInstance().getLocale()).entrySet()
    112             .forEach(e -> list.put(e.getKey(), e.getValue().toString()));
     111        KeyboardUtils.getExtendedKeyCodes(InputContext.getInstance().getLocale())
     112                .forEach((key, value) -> list.put(key, value.toString()));
    113113        list.put(Integer.valueOf(-1), "");
    114114        return list;
    115115    }
  • 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 b  
    8888        if (TYPE_CACHE.containsKey(types))
    8989            return TYPE_CACHE.get(types);
    9090        Set<TaggingPresetType> result = EnumSet.noneOf(TaggingPresetType.class);
    91         for (String type : Arrays.asList(types.split(",", -1))) {
     91        for (String type : types.split(",", -1)) {
    9292            try {
    9393                TaggingPresetType presetType = TaggingPresetType.fromString(type);
    9494                if (presetType != null) {
  • 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 b  
    12571257                                }
    12581258                                Utils.updateSystemProperty("java.net.preferIPv6Addresses", "true");
    12591259                                if (!wasv6) {
    1260                                     Logging.info(tr("Detected useable IPv6 network, preferring IPv6 over IPv4 after next restart."));
     1260                                    Logging.info(tr("Detected usable IPv6 network, preferring IPv6 over IPv4 after next restart."));
    12611261                                } else {
    1262                                     Logging.info(tr("Detected useable IPv6 network, preferring IPv6 over IPv4."));
     1262                                    Logging.info(tr("Detected usable IPv6 network, preferring IPv6 over IPv4."));
    12631263                                }
    12641264                            }
    12651265                            break; /* we're done */
     
    12711271                    Logging.trace(e);
    12721272                }
    12731273                if (wasv6 && !hasv6) {
    1274                     Logging.info(tr("Detected no useable IPv6 network, preferring IPv4 over IPv6 after next restart."));
     1274                    Logging.info(tr("Detected no usable IPv6 network, preferring IPv4 over IPv6 after next restart."));
    12751275                    Config.getPref().putBoolean("validated.ipv6", hasv6); // be sure it is stored before the restart!
    12761276                    RestartAction.restartJOSM();
    12771277                }
  • 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 b  
    7777        Collection<Collection<WayPoint>> currentTrack = new ArrayList<>();
    7878        Collection<WayPoint> waypoints = new ArrayList<>();
    7979        try (BufferedReader rd = new BufferedReader(new InputStreamReader(source, StandardCharsets.UTF_8))) {
    80             String line = null;
     80            String line;
    8181            do {
    8282                line = rd.readLine();
    8383                if (line != null) {
     
    124124    }
    125125
    126126    /**
    127      * Returns the number of coordinates that have been successfuly read.
    128      * @return the number of coordinates that have been successfuly read
     127     * Returns the number of coordinates that have been successfully read.
     128     * @return the number of coordinates that have been successfully read
    129129     */
    130130    public int getNumberOfCoordinates() {
    131131        return success;
  • 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 b  
    352352            while (entries.hasMoreElements()) {
    353353                ZipEntry entry = entries.nextElement();
    354354                // choose any file with correct extension. When more than one file, prefer the one which matches namepart
    355                 if (entry.getName().endsWith('.' + extension) && (resentry == null || entry.getName().indexOf(namepart) >= 0)) {
     355                if (entry.getName().endsWith('.' + extension) && (resentry == null || entry.getName().contains(namepart))) {
    356356                    resentry = entry;
    357357                }
    358358            }
  • 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 b  
    9797            GpxExtensionCollection layerExts = data.getExtensions().add("josm", "layerPreferences").getExtensions();
    9898            data.getLayerPrefs().entrySet()
    9999            .stream()
    100             .sorted(Comparator.comparing(Map.Entry::getKey))
     100            .sorted(Map.Entry.comparingByKey())
    101101            .forEach(entry -> {
    102102                GpxExtension e = layerExts.add("josm", "entry");
    103103                e.put("key", entry.getKey());
  • 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 b  
    33
    44import java.io.IOException;
    55import java.io.Reader;
     6import java.util.Arrays;
    67
    78import org.openstreetmap.josm.tools.Logging;
    89
     
    2728
    2829    static {
    2930        INVALID_CHARS = new boolean[0x20];
    30         for (int i = 0; i < INVALID_CHARS.length; ++i) {
    31             INVALID_CHARS[i] = true;
    32         }
     31        Arrays.fill(INVALID_CHARS, true);
    3332        INVALID_CHARS[0x9] = false; // tab
    3433        INVALID_CHARS[0xA] = false; // LF
    3534        INVALID_CHARS[0xD] = false; // CR
  • 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 b  
    319319        addTags(cs, "changeset", false); // also writes closing </changeset>
    320320    }
    321321
    322     protected static final Comparator<Entry<String, String>> byKeyComparator = Comparator.comparing(Entry::getKey);
     322    protected static final Comparator<Entry<String, String>> byKeyComparator = Entry.comparingByKey();
    323323
    324324    protected void addTags(Tagged osm, String tagname, boolean tagOpen) {
    325325        if (osm.hasKeys()) {
  • 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 b  
    270270            p = Period.parse(javaDur ? duration.substring(0, idx) : duration);
    271271        }
    272272        if (javaDur) {
    273             d = Duration.parse(javaPer ? 'P' + duration.substring(idx, duration.length()) : duration);
     273            d = Duration.parse(javaPer ? 'P' + duration.substring(idx) : duration);
    274274        } else if (!javaPer) {
    275275            d = Duration.parse(duration);
    276276        }
  • 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 b  
    6565                    return "";
    6666                }
    6767            }
    68             if ("nb".equals(code)) { /* OSM-Wiki has "no", but no "nb" */
    69                 return "No:";
    70             } else if ("sr@latin".equals(code)) { /* OSM-Wiki has "Sr-latn" and not Sr-latin */
    71                 return "Sr-latn:";
    72             } else if ("de".equals(code) || "es".equals(code) || "fr".equals(code)
    73                     || "it".equals(code) || "nl".equals(code) || "ru".equals(code)
    74                     || "ja".equals(code)) {
    75                 return code.toUpperCase(Locale.ENGLISH) + ":";
    76             } else {
    77                 return code.substring(0, 1).toUpperCase(Locale.ENGLISH) + code.substring(1) + ":";
     68            switch (code) {
     69                case "nb":          /* OSM-Wiki has "no", but no "nb" */
     70                    return "No:";
     71                case "sr@latin":    /* OSM-Wiki has "Sr-latn" and not Sr-latin */
     72                    return "Sr-latn:";
     73                case "de":
     74                case "es":
     75                case "fr":
     76                case "it":
     77                case "nl":
     78                case "ru":
     79                case "ja":
     80                    return code.toUpperCase(Locale.ENGLISH) + ":";
     81                default:
     82                    return code.substring(0, 1).toUpperCase(Locale.ENGLISH) + code.substring(1) + ":";
    7883            }
    7984        }
    8085
     
    159164     */
    160165    public static String getJavaLocaleCode(String localeName) {
    161166        if (localeName == null) return "en";
    162         if ("ca@valencia".equals(localeName)) {
    163             localeName = "ca__valencia";
    164         } else if ("sr@latin".equals(localeName)) {
    165             localeName = "sr__latin";
    166         } else if ("he".equals(localeName)) {
    167             localeName = "iw_IL";
    168         } else if ("id".equals(localeName)) {
    169             localeName = "in";
     167        switch (localeName) {
     168            case "ca@valencia":
     169                localeName = "ca__valencia"; break;
     170            case "sr@latin":
     171                localeName = "sr__latin"; break;
     172            case "he":
     173                localeName = "iw_IL"; break;
     174            case "id":
     175                localeName = "in"; break;
    170176        }
    171177        return localeName;
    172178    }