Ticket #24635: josm_24635.patch

File josm_24635.patch, 58.9 KB (added by gaben, 3 weeks ago)
  • nodist/pom.xml

    Subject: [PATCH] josm_24635
    ---
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/nodist/pom.xml b/nodist/pom.xml
    a b  
    1717        <sonar.host.url>https://josm.openstreetmap.de/sonar/</sonar.host.url>
    1818        <sonar.projectKey>JOSM</sonar.projectKey>
    1919        <jmockit.version>1.49.a</jmockit.version>
    20         <pmd.version>7.22.0</pmd.version>
     20        <pmd.version>7.27.0</pmd.version>
    2121        <jacoco.version>0.8.13</jacoco.version>
    2222        <checkstyle.version>10.26.1</checkstyle.version>
    2323        <spotbugs.version>4.9.8</spotbugs.version>
  • src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java b/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
    a b  
    10851085                osd.append(tr("\nDOP: {0}", entry.getExifGpsDop()));
    10861086            }
    10871087            if (entry.getExifGpsDatum() != null) {
    1088                 osd.append(tr("\nDatum: {0}", entry.getExifGpsDatum().toString()));
     1088                osd.append(tr("\nDatum: {0}", entry.getExifGpsDatum()));
    10891089            }
    10901090            if (entry.getExifGpsProcMethod() != null) {
    1091                 osd.append(tr("\nProc. method: {0}", entry.getExifGpsProcMethod().toString()));
     1091                osd.append(tr("\nProc. method: {0}", entry.getExifGpsProcMethod()));
    10921092            }
    10931093        }
    10941094        Optional.ofNullable(entry.getIptcCaption()).map(s -> tr("\nCaption: {0}", s)).ifPresent(osd::append);
  • src/org/openstreetmap/josm/data/validation/tests/PowerLines.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java b/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java
    a b  
    101101
    102102    @Override
    103103    public void visit(Node n) {
    104         if (!n.isConnectionNode() || n.referrers(Way.class).noneMatch(w -> isPowerLineOrCable(w)))
     104        if (!n.isConnectionNode() || n.referrers(Way.class).noneMatch(PowerLines::isPowerLineOrCable))
    105105            return;
    106106
    107107        List<Way> unrelatedParents = n.referrers(Way.class).filter(w -> !isPowerLineOrCable(w) && !isRelatedToPower(w))
  • src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java b/src/org/openstreetmap/josm/data/gpx/GpxImageEntry.java
    a b  
    99import java.net.URI;
    1010import java.nio.file.Files;
    1111import java.time.Instant;
    12 import java.util.Date;
    1312import java.util.List;
    1413import java.util.Objects;
    1514
    … …  
    351350        return null;
    352351    }
    353352
    354     private static Date getDefensiveDate(Instant date) {
    355         if (date == null)
    356             return null;
    357         return Date.from(date);
    358     }
    359 
    360353    @Override
    361354    public LatLon getExifCoor() {
    362355        return exifCoor;
  • src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java b/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
    a b  
    286286     * @throws IOException if any I/O error occurs
    287287     * @since 18365 (public, primarily for ValidatorCLI)
    288288     */
     289    @SuppressWarnings("PMD.UseTryWithResources") // zip.a is closed via Utils.close(), which swallows IOException
    289290    public synchronized ParseResult addMapCSS(String url, Consumer<String> assertionConsumer) throws ParseException, IOException {
    290291        CheckParameterUtil.ensureParameterNotNull(url, "url");
    291292        ParseResult result;
  • src/org/openstreetmap/josm/plugins/PluginClassLoader.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/plugins/PluginClassLoader.java b/src/org/openstreetmap/josm/plugins/PluginClassLoader.java
    a b  
    8888     * @param resolve {@code true} to resolve the class
    8989     * @return the class, if found, otherwise {@code null}
    9090     */
     91    @SuppressWarnings("PMD.CloseResource") // dependency class loaders are shared and live for the application lifetime
    9192    private Class<?> findClassInDependencies(String name, boolean resolve) {
    9293        for (PluginClassLoader dep : dependencies) {
    9394            try {
    … …  
    104105    }
    105106
    106107    @Override
     108    @SuppressWarnings("PMD.CloseResource") // dependency class loaders are shared and live for the application lifetime
    107109    public URL findResource(String name) {
    108110        URL resource = super.findResource(name);
    109111        if (resource == null) {
  • src/org/openstreetmap/josm/data/sources/ISourceType.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/sources/ISourceType.java b/src/org/openstreetmap/josm/data/sources/ISourceType.java
    a b  
    88 * @param <T> The source type (e.g., Imagery or otherwise -- should be the name of the class)
    99 * @since 16545
    1010 */
    11 @SuppressWarnings("PMD.ImplicitFunctionalInterface")
    1211public interface ISourceType<T extends Enum<T>> extends ICommonSource<T> {
    1312    /**
    1413     * Returns the unique string identifying this type.
  • src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java b/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReader.java
    a b  
    370370     * @throws SAXException if any XML error occurs
    371371     * @throws IOException if any I/O error occurs
    372372     */
     373    @SuppressWarnings("PMD.UseTryWithResources") // zip.a/zip.b are closed via Utils.close(), which swallows IOException
    373374    static Collection<TaggingPreset> readAll(String source, boolean validate, HashSetWithLast<TaggingPreset> all)
    374375            throws SAXException, IOException {
    375376        Collection<TaggingPreset> tp;
  • src/org/openstreetmap/josm/tools/date/DateUtils.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/tools/date/DateUtils.java b/src/org/openstreetmap/josm/tools/date/DateUtils.java
    a b  
    22package org.openstreetmap.josm.tools.date;
    33
    44import java.text.DateFormat;
    5 import java.text.ParsePosition;
    65import java.text.SimpleDateFormat;
    76import java.time.DateTimeException;
    87import java.time.Instant;
     8import java.time.LocalDateTime;
    99import java.time.ZoneId;
    1010import java.time.ZoneOffset;
    1111import java.time.ZonedDateTime;
    1212import java.time.format.DateTimeFormatter;
    1313import java.time.format.DateTimeFormatterBuilder;
     14import java.time.format.DateTimeParseException;
    1415import java.time.format.FormatStyle;
    1516import java.util.Date;
    1617import java.util.Locale;
    … …  
    5657     * @throws UncheckedParseException if the date does not match any of the supported date formats
    5758     * @throws DateTimeException if the value of any field is out of range, or if the day-of-month is invalid for the month-year
    5859     */
     60    @SuppressWarnings("PMD.ReplaceJavaUtilDate") // public API kept as Date for existing/plugin callers
    5961    public static Date fromString(String str) {
    6062        return new Date(tsFromString(str));
    6163    }
    … …  
    148150                ).toInstant();
    149151            } else {
    150152                // example date format "18-AUG-08 13:33:03"
    151                 SimpleDateFormat f = new SimpleDateFormat("dd-MMM-yy HH:mm:ss");
    152                 Date d = f.parse(str, new ParsePosition(0));
    153                 if (d != null)
    154                     return d.toInstant();
     153                try {
     154                    // Locale.ENGLISH for the month abbreviation (Locale.ROOT has no textual month names);
     155                    // system default zone matches the previous SimpleDateFormat behavior
     156                    return LocalDateTime.parse(str, DateTimeFormatter.ofPattern("dd-MMM-yy HH:mm:ss", Locale.ENGLISH))
     157                            .atZone(ZoneId.systemDefault()).toInstant();
     158                } catch (DateTimeParseException ignored) {
     159                    // not this format, fall through to the slow path below
     160                }
    155161            }
    156162
    157163            // slow path for fractional seconds different from millisecond precision
    … …  
    196202     * @param date The date to format
    197203     * @return The formatted date
    198204     */
     205    @SuppressWarnings("PMD.ReplaceJavaUtilDate") // public API kept as Date for existing/plugin callers
    199206    public static String fromDate(Date date) {
    200207        final ZonedDateTime temporal = date.toInstant().atZone(ZoneOffset.UTC);
    201208        return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(temporal);
    … …  
    207214     * @return cloned date, or null
    208215     * @since 11878
    209216     */
     217    @SuppressWarnings("PMD.ReplaceJavaUtilDate") // null-safe clone utility, inherently Date-typed
    210218    public static Date cloneDate(Date d) {
    211219        return d != null ? (Date) d.clone() : null;
    212220    }
    … …  
    298306     * @return The formatted date
    299307     * @since 7299
    300308     */
     309    @SuppressWarnings("PMD.ReplaceJavaUtilDate") // delegates to java.text.DateFormat, which requires a Date
    301310    public static String formatDate(Date date, int dateStyle) {
    302311        CheckParameterUtil.ensureParameterNotNull(date, "date");
    303312        return getDateFormat(dateStyle).format(date);
    … …  
    337346     * @return The formatted time
    338347     * @since 7299
    339348     */
     349    @SuppressWarnings("PMD.ReplaceJavaUtilDate") // delegates to java.text.DateFormat, which requires a Date
    340350    public static String formatTime(Date time, int timeStyle) {
    341351        CheckParameterUtil.ensureParameterNotNull(time, "time");
    342352        return getTimeFormat(timeStyle).format(time);
    … …  
    390400     * @return The formatted date/time
    391401     * @since 7299
    392402     */
     403    @SuppressWarnings("PMD.ReplaceJavaUtilDate") // delegates to java.text.DateFormat, which requires a Date
    393404    public static String formatDateTime(Date datetime, int dateStyle, int timeStyle) {
    394405        CheckParameterUtil.ensureParameterNotNull(datetime, "datetime");
    395406        return getDateTimeFormat(dateStyle, timeStyle).format(datetime);
  • src/org/openstreetmap/josm/data/validation/routines/InetAddressValidator.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/validation/routines/InetAddressValidator.java b/src/org/openstreetmap/josm/data/validation/routines/InetAddressValidator.java
    a b  
    101101                return false;
    102102            }
    103103
    104             int iIpSegment = 0;
     104            int iIpSegment;
    105105
    106106            try {
    107107                iIpSegment = Integer.parseInt(ipSegment);
    … …  
    180180                if (octet.length() > IPV6_MAX_HEX_DIGITS_PER_GROUP) {
    181181                    return false;
    182182                }
    183                 int octetInt = 0;
     183                int octetInt;
    184184                try {
    185185                    octetInt = Integer.parseInt(octet, BASE_16);
    186186                } catch (NumberFormatException e) {
  • src/org/openstreetmap/josm/plugins/PluginHandler.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/plugins/PluginHandler.java b/src/org/openstreetmap/josm/plugins/PluginHandler.java
    a b  
    830830     *
    831831     * @param plugins the plugins to add
    832832     */
     833    @SuppressWarnings("PMD.CloseResource") // the joined class loader is shared and lives for the application lifetime
    833834    private static void extendJoinedPluginResourceCL(Collection<PluginInformation> plugins) {
    834835        // iterate all plugins and collect all libraries of all plugins:
    835836        File pluginDir = Preferences.main().getPluginsDirectory();
    … …  
    935936     * Generate classloaders for a list of plugins
    936937     * @param toLoad The plugins to generate the classloaders for
    937938     */
    938     @SuppressWarnings("squid:S2095") // NOSONAR the classloaders and put in a map which we want to keep.
     939    @SuppressWarnings({"squid:S2095", "PMD.CloseResource"}) // NOSONAR the classloaders and put in a map which we want to keep.
    939940    private static void generateClassloaders(List<PluginInformation> toLoad) {
    940941        for (PluginInformation info : toLoad) {
    941942            PluginClassLoader cl = AccessController.doPrivileged((PrivilegedAction<PluginClassLoader>)
    … …  
    951952     * Resolve dependencies for a list of plugins
    952953     * @param toLoad The plugins to resolve dependencies for
    953954     */
    954     @SuppressWarnings("squid:S2095") // NOSONAR the classloaders are from a persistent map
     955    @SuppressWarnings({"squid:S2095", "PMD.CloseResource"}) // NOSONAR the classloaders are from a persistent map
    955956    private static void resolveDependencies(List<PluginInformation> toLoad) {
    956957        for (PluginInformation info : toLoad) {
    957958            PluginClassLoader cl = classLoaders.get(info.name);
  • src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java b/src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java
    a b  
    424424            }
    425425        }
    426426
    427         return Optional.ofNullable(authorityMatcher.group(PARSE_AUTHORITY_EXTRA)).orElse("").trim().isEmpty();
     427        return Optional.ofNullable(authorityMatcher.group(PARSE_AUTHORITY_EXTRA)).orElse("").isBlank();
    428428    }
    429429
    430430    /**
  • tools/pmd/josm-ruleset.xml

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/tools/pmd/josm-ruleset.xml b/tools/pmd/josm-ruleset.xml
    a b  
    1616    <exclude name="AvoidStringBufferField"/>
    1717    <exclude name="ConstantsInInterface"/>
    1818    <exclude name="GuardLogStatement"/>
    19     <exclude name="JUnit4TestShouldUseTestAnnotation" reason="False positive in src/org/openstreetmap/josm/data/validation/Test.java"/>
    2019    <exclude name="LiteralsFirstInComparisons" reason="Introduced in 6.24, some positives in source code at this time. Replaces PositionLiteralsFirstInComparisons."/>
    2120    <exclude name="LooseCoupling"/>
    2221    <exclude name="MethodReturnsInternalArray"/>
    2322    <exclude name="OneDeclarationPerLine"/>
    2423    <exclude name="ReplaceHashtableWithMap"/>
    25     <exclude name="SwitchStmtsShouldHaveDefault"/>
    2624    <exclude name="SystemPrintln"/>
    2725    <exclude name="UnusedAssignment" reason="Introduced in 6.26, some number of positives in source code at this time"/>
    28     <exclude name="UnusedPrivateMethod" reason="Broken since PMD 6.33, see https://github.com/pmd/pmd/issues/3468"/>
    29     <exclude name="UnusedPrivateField" reason="Broken in 7.2.x"/>
    3026    <exclude name="UseVarargs"/>
    3127  </rule>
    3228  <rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach">
    … …  
    136132    <exclude name="TooManyMethods"/>
    137133    <exclude name="UseObjectForClearerAPI"/>
    138134    <exclude name="UselessOverridingMethod"/>
    139     <exclude name="UseUtilityClass"/>
    140135  </rule>
    141136  <rule ref="category/java/design.xml/SignatureDeclareThrowsException">
    142137    <properties>
    … …  
    181176  <rule ref="category/java/performance.xml">
    182177    <exclude name="AvoidInstantiatingObjectsInLoops"/>
    183178    <exclude name="ConsecutiveLiteralAppends"/>
    184     <exclude name="InefficientEmptyStringCheck"/>
    185179    <exclude name="InsufficientStringBufferDeclaration" reason="PMD 6.40 has a bug where it doesn't properly count appended strings in if statements."/>
    186     <exclude name="TooFewBranchesForASwitchStatement"/>
    187     <exclude name="UseArrayListInsteadOfVector"/>
    188     <exclude name="UselessStringValueOf"/>
    189180    <exclude name="UseStringBufferForStringAppends"/>
    190181  </rule>
    191182
  • src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java b/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableCellRenderer.java
    a b  
    1919
    2020    protected void renderUploadComment(Changeset cs) {
    2121        String comment = cs.getComment();
    22         if (comment.trim().isEmpty()) {
     22        if (comment.isBlank()) {
    2323            setText(trc("changeset.upload-comment", "empty"));
    2424            setFont(UIManager.getFont("Table.font").deriveFont(Font.ITALIC));
    2525        } else {
  • src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java b/src/org/openstreetmap/josm/gui/conflict/tags/PasteTagsConflictResolverDialog.java
    a b  
    1717import java.beans.PropertyChangeListener;
    1818import java.util.ArrayList;
    1919import java.util.EnumMap;
    20 import java.util.HashMap;
    2120import java.util.List;
    2221import java.util.Map;
    2322import java.util.Map.Entry;
    … …  
    164163            Map<OsmPrimitiveType, Integer> targetStatistics) {
    165164        mode = Mode.RESOLVING_ONE_TAGCOLLECTION_ONLY;
    166165        tagsForAllPrimitives = tagsForAllPrimitives == null ? new TagCollection() : tagsForAllPrimitives;
    167         sourceStatistics = sourceStatistics == null ? new HashMap<>() : sourceStatistics;
    168         targetStatistics = targetStatistics == null ? new HashMap<>() : targetStatistics;
     166        sourceStatistics = sourceStatistics == null ? new EnumMap<>(OsmPrimitiveType.class) : sourceStatistics;
     167        targetStatistics = targetStatistics == null ? new EnumMap<>(OsmPrimitiveType.class) : targetStatistics;
    169168
    170169        // init the resolver
    171170        //
  • src/org/openstreetmap/josm/tools/template_engine/TemplateParser.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/tools/template_engine/TemplateParser.java b/src/org/openstreetmap/josm/tools/template_engine/TemplateParser.java
    a b  
    8080
    8181    private void skipWhitespace() throws ParseError {
    8282        Token token = tokenizer.lookAhead();
    83         if (token.getType() == TokenType.TEXT && token.getText().trim().isEmpty()) {
     83        if (token.getType() == TokenType.TEXT && token.getText().isBlank()) {
    8484            tokenizer.nextToken();
    8585        }
    8686    }
  • src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java b/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolver.java
    a b  
    190190    public Command buildTagApplyCommands(Collection<? extends OsmPrimitive> primitives) {
    191191        if (!cbTagRelations.isSelected())
    192192            return null;
    193         if (tfKey.getText().trim().isEmpty())
     193        if (tfKey.getText().isBlank())
    194194            return null;
    195         if (tfValue.getText().trim().isEmpty())
     195        if (tfValue.getText().isBlank())
    196196            return null;
    197197        if (Utils.isEmpty(primitives))
    198198            return null;
  • src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java b/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java
    a b  
    144144            // Retrieve the values from current rule visible on screen
    145145            NavigableSet<Integer> values = getNumericValues();
    146146            // Make sure current auto filter buttons remain visible even if no data is found, to allow user to disable them
    147             for (var currentAutoFilter : currentAutoFilters) {
     147            for (AutoFilter currentAutoFilter : currentAutoFilters) {
    148148                if (currentAutoFilter.getFilter().value != null) {
    149149                    values.add(currentAutoFilter.getFilter().value);
    150150                }
    … …  
    288288        int maxWidth = 16;
    289289        final AutoFilterButton keyButton = AutoFilterButton.forOsmKey(enabledRule.getKey());
    290290        addButton(keyButton, Integer.MIN_VALUE, i++);
    291         var valueList = new ArrayList<>(values.descendingSet());
     291        ArrayList<Integer> valueList = new ArrayList<>(values.descendingSet());
    292292        if (enabledRule.getNoValueFilter()) {
    293293            valueList.add(null);
    294294        }
    … …  
    330330        }
    331331        BBox bbox = MainApplication.getMap().mapView.getState().getViewArea().getLatLonBoundsBox().toBBox();
    332332        NavigableSet<Integer> values = new TreeSet<>();
    333         for (var primitiveList : List.of(ds.searchNodes(bbox), ds.searchWays(bbox), ds.searchRelations(bbox))) {
     333        for (List<? extends OsmPrimitive> primitiveList : List.of(ds.searchNodes(bbox), ds.searchWays(bbox), ds.searchRelations(bbox))) {
    334334            // add all values that are directly mentioned
    335335            primitiveList.forEach(o -> enabledRule.getTagValuesForPrimitive(o, true).forEach(values::add));
    336336            // only add integer values from value ranges, not fractional values
  • src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java b/src/org/openstreetmap/josm/gui/autofilter/AutoFilterRule.java
    a b  
    4848
    4949    private IntFunction<String> valueFormatter = Integer::toString;
    5050
    51     private boolean noValueFilter = false;
     51    private boolean noValueFilter;
    5252
    5353    /** The union of {@link #key} and the keys provided by {@link #setExtraKeys(List)}. */
    5454    private List<String> allKeys;
  • test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java b/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java
    a b  
    2727    @Test
    2828    void testFetchHelpTopicContentNominal() throws HelpContentReaderException {
    2929        String res = new HelpContentReader(HelpUtil.getWikiBaseUrl()).fetchHelpTopicContent(HelpBrowserTest.URL_1, false);
    30         assertFalse(res.trim().isEmpty());
     30        assertFalse(res.isBlank());
    3131    }
    3232}
  • src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java b/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
    a b  
    14181418                ExtendedSourceEntry last = null;
    14191419
    14201420                while ((line = reader.readLine()) != null && !canceled) {
    1421                     if (line.trim().isEmpty()) {
     1421                    if (line.isBlank()) {
    14221422                        continue; // skip empty lines
    14231423                    }
    14241424                    if (line.startsWith("\t")) {
  • src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/download/PlaceSelection.java b/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
    a b  
    192192        @Override
    193193        public void actionPerformed(ActionEvent e) {
    194194            String searchExpression = cbSearchExpression.getText();
    195             if (!isEnabled() || searchExpression.trim().isEmpty() || serverComboBox.getSelectedItem() == null)
     195            if (!isEnabled() || searchExpression.isBlank() || serverComboBox.getSelectedItem() == null)
    196196                return;
    197197            cbSearchExpression.addCurrentItemToHistory();
    198198            cbSearchExpression.getModel().prefs().save(HISTORY_KEY);
    … …  
    214214
    215215        protected final void updateState() {
    216216            String searchExpression = cbSearchExpression.getText();
    217             setEnabled(!searchExpression.trim().isEmpty());
     217            setEnabled(!searchExpression.isBlank());
    218218            isSearchMore = Objects.equals(lastSearchExpression, searchExpression) && !model.getData().isEmpty();
    219219            if (isSearchMore) {
    220220                putValue(NAME, tr("Search more..."));
  • src/org/openstreetmap/josm/gui/preferences/SubPreferenceSetting.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/preferences/SubPreferenceSetting.java b/src/org/openstreetmap/josm/gui/preferences/SubPreferenceSetting.java
    a b  
    77 * This preference setting's addGui method is called after the user clicked the parent tab
    88 * (returned by getTabPreferenceSetting).
    99 */
    10 @SuppressWarnings("PMD.ImplicitFunctionalInterface")
    1110public interface SubPreferenceSetting extends PreferenceSetting {
    1211
    1312    /**
  • src/org/openstreetmap/josm/gui/io/CredentialDialog.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/io/CredentialDialog.java b/src/org/openstreetmap/josm/gui/io/CredentialDialog.java
    a b  
    399399        @Override
    400400        public void keyPressed(KeyEvent e) {
    401401            if (e.getKeyChar() == KeyEvent.VK_ENTER) {
    402                 if (currentTF.getText().trim().isEmpty()) {
     402                if (currentTF.getText().isBlank()) {
    403403                    currentTF.selectAll();
    404                 } else if (nextTF.getText().trim().isEmpty()) {
     404                } else if (nextTF.getText().isBlank()) {
    405405                    nextTF.requestFocusInWindow();
    406406                    nextTF.selectAll();
    407407                } else {
  • src/org/openstreetmap/josm/io/session/GeoImageSessionExporter.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/session/GeoImageSessionExporter.java b/src/org/openstreetmap/josm/io/session/GeoImageSessionExporter.java
    a b  
    122122                addAttr("exif-gps-dop", entry.getExifGpsDop().toString(), imgElem, support);
    123123            }
    124124            if (entry.getExifGpsDatum() != null) {
    125                 addAttr("exif-gps-datum", entry.getExifGpsDatum().toString(), imgElem, support);
     125                addAttr("exif-gps-datum", entry.getExifGpsDatum(), imgElem, support);
    126126            }
    127127            if (entry.getExifGpsProcMethod() != null) {
    128                 addAttr("exif-gps-procmethod", entry.getExifGpsProcMethod().toString(), imgElem, support);
     128                addAttr("exif-gps-procmethod", entry.getExifGpsProcMethod(), imgElem, support);
    129129            }
    130130            if (entry.hasNewGpsData()) {
    131131                addAttr("is-new-gps-data", Boolean.toString(entry.hasNewGpsData()), imgElem, support);
  • src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java b/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java
    a b  
    3838     *            {@link org.apache.commons.io.output.CloseShieldOutputStream} when calling this method to
    3939     *            avoid potential future issues)
    4040     */
    41     @SuppressWarnings("squid:S2095") // All the closeables in this method will close the input OutputStream.
     41    @SuppressWarnings({"squid:S2095", "PMD.CloseResource"}) // All the closeables in this method will close the input OutputStream.
    4242    public static void exportData(DataSet data, OutputStream out) {
    4343        // This writer will close out when it is closed
    4444        Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8);
  • src/org/openstreetmap/josm/gui/dialogs/changeset/query/TimeValidator.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/changeset/query/TimeValidator.java b/src/org/openstreetmap/josm/gui/dialogs/changeset/query/TimeValidator.java
    a b  
    4343
    4444    @Override
    4545    public boolean isValid() {
    46         if (getComponent().getText().trim().isEmpty())
     46        if (getComponent().getText().isBlank())
    4747            return true;
    4848        return getTime() != null;
    4949    }
    … …  
    9191     * @return the time
    9292     */
    9393    public LocalTime getTime() {
    94         if (getComponent().getText().trim().isEmpty())
     94        if (getComponent().getText().isBlank())
    9595            return LocalTime.MIDNIGHT;
    9696
    9797        for (final FormatStyle format: FormatStyle.values()) {
  • src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java b/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
    a b  
    203203
    204204        protected void validate() {
    205205            String value = tfUrl.getText();
    206             if (value.trim().isEmpty()) {
     206            if (value.isBlank()) {
    207207                feedbackNone();
    208208                return;
    209209            }
  • src/org/openstreetmap/josm/data/projection/proj/ClassProjFactory.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/projection/proj/ClassProjFactory.java b/src/org/openstreetmap/josm/data/projection/proj/ClassProjFactory.java
    a b  
    2020
    2121    @Override
    2222    public Proj createInstance() {
    23         Proj proj = null;
     23        Proj proj;
    2424        try {
    2525            proj = projClass.getConstructor().newInstance();
    2626        } catch (ReflectiveOperationException e) {
  • src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java b/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
    a b  
    338338    /**
    339339     * Extracted interface of {@link EditTagDialog}.
    340340     */
    341     @SuppressWarnings("PMD.ImplicitFunctionalInterface")
    342341    protected interface IEditTagDialog extends IExtendedDialog {
    343342        /**
    344343         * Edit tags of multiple selected objects according to selected ComboBox values
  • test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java b/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
    a b  
    122122            Pattern projPattern = Pattern.compile("<(.+?)>(.*)<>");
    123123            RefEntry curEntry = null;
    124124            while ((line = in.readLine()) != null) {
    125                 if (line.startsWith("#") || line.trim().isEmpty()) {
     125                if (line.startsWith("#") || line.isBlank()) {
    126126                    continue;
    127127                }
    128128                if (line.startsWith("<")) {
  • src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java b/src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java
    a b  
    7979
    8080    @Override
    8181    // The new closable resources in this method will close the input OutputStream
    82     @SuppressWarnings("squid:S2095")
     82    @SuppressWarnings({"squid:S2095", "PMD.CloseResource"})
    8383    protected void addDataFile(OutputStream out) {
    8484        Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8);
    8585        GpxWriter w = new GpxWriter(new PrintWriter(writer));
  • src/org/openstreetmap/josm/gui/widgets/DefaultTextComponentValidator.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/widgets/DefaultTextComponentValidator.java b/src/org/openstreetmap/josm/gui/widgets/DefaultTextComponentValidator.java
    a b  
    2626
    2727    @Override
    2828    public boolean isValid() {
    29         return !getComponent().getText().trim().isEmpty();
     29        return !getComponent().getText().isBlank();
    3030    }
    3131
    3232    @Override
  • src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java b/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
    a b  
    202202
    203203        // remember update interval
    204204        //
    205         int days = 0;
     205        int days;
    206206        try {
    207207            days = Integer.parseInt(tfUpdateInterval.getText().trim());
    208208            if (days <= 0) {
  • src/org/openstreetmap/josm/actions/DownloadReferrersAction.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java b/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java
    a b  
    6969    protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
    7070        updateEnabledStateOnModifiableSelection(selection);
    7171        if (isEnabled() && !Utils.isEmpty(selection)
    72                 && DownloadPolicy.BLOCKED.equals(selection.iterator().next().getDataSet().getDownloadPolicy())) {
     72                && selection.iterator().next().getDataSet().getDownloadPolicy() == DownloadPolicy.BLOCKED) {
    7373            setEnabled(false);
    7474        }
    7575    }
  • src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java b/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java
    a b  
    9595    }
    9696
    9797    // The new closable resources in this method will close the input OutputStream
    98     @SuppressWarnings("squid:S2095")
     98    @SuppressWarnings({"squid:S2095", "PMD.CloseResource"})
    9999    protected void addDataFile(OutputStream out) {
    100100        Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8);
    101101        MarkerWriter w = new MarkerWriter(new PrintWriter(writer));
  • src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java b/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java
    a b  
    145145
    146146        @Override
    147147        public void validate() {
    148             double value = 0;
     148            double value;
    149149            try {
    150150                value = JosmDecimalFormatSymbolsProvider.parseDouble(getComponent().getText());
    151151            } catch (NumberFormatException ex) {
    … …  
    183183
    184184        @Override
    185185        public void validate() {
    186             double value = 0;
     186            double value;
    187187            try {
    188188                value = JosmDecimalFormatSymbolsProvider.parseDouble(getComponent().getText());
    189189            } catch (NumberFormatException ex) {
  • src/org/openstreetmap/josm/data/vector/VectorPrimitive.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/vector/VectorPrimitive.java b/src/org/openstreetmap/josm/data/vector/VectorPrimitive.java
    a b  
    9898        this.mappaintCacheIdx = dataSet.getMappaintCacheIndex();
    9999    }
    100100
     101    @Override
    101102    public void clearCachedStyle() {
    102103        this.mappaintStyle.clear();
    103104    }
  • src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java b/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
    a b  
    336336                handler.setSender(sender);
    337337                handler.handle();
    338338                sendHeader(out, "200 OK", handler.getContentType(), false);
    339                 out.write("Content-length: " + handler.getContent().getBytes().length
     339                out.write("Content-length: " + handler.getContent().getBytes(RESPONSE_CHARSET).length
    340340                        + "\r\n");
    341341                out.write("\r\n");
    342342                out.write(handler.getContent());
  • src/org/openstreetmap/josm/tools/TextAnalyzer.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/tools/TextAnalyzer.java b/src/org/openstreetmap/josm/tools/TextAnalyzer.java
    a b  
    7878            } else if (c == '\\') {
    7979                esc = true;
    8080            } else if (c == '\"' && !quotesStarted) { // opening "
    81                 if (!s.toString().trim().isEmpty()) { // we had   ||some text"||
     81                if (!s.toString().isBlank()) { // we had   ||some text"||
    8282                    s.append(c); // just add ", not open
    8383                } else {
    8484                    s.delete(0, s.length()); // forget that empty characters and start reading "....
  • src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java b/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java
    a b  
    232232
    233233        @Override
    234234        public boolean isValid() {
    235             if (getComponent().getText().trim().isEmpty())
     235            if (getComponent().getText().isBlank())
    236236                return false;
    237237            return Utils.isValidUrl(getComponent().getText().trim());
    238238        }
    239239
    240240        @Override
    241241        public void validate() {
    242             if (getComponent().getText().trim().isEmpty()) {
     242            if (getComponent().getText().isBlank()) {
    243243                feedbackInvalid(tr("OSM API URL must not be empty. Please enter the OSM API URL."));
    244244                return;
    245245            }
  • src/org/openstreetmap/josm/io/OsmApi.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/OsmApi.java b/src/org/openstreetmap/josm/io/OsmApi.java
    a b  
    958958        String encodedMessage = Utils.encodeUrl(closeMessage);
    959959        StringBuilder urlBuilder = noteStringBuilder(note)
    960960            .append("/close");
    961         if (!encodedMessage.trim().isEmpty()) {
     961        if (!encodedMessage.isBlank()) {
    962962            urlBuilder.append("?text=")
    963963                    .append(encodedMessage);
    964964        }
    … …  
    979979        String encodedMessage = Utils.encodeUrl(reactivateMessage);
    980980        StringBuilder urlBuilder = noteStringBuilder(note)
    981981            .append("/reopen");
    982         if (!encodedMessage.trim().isEmpty()) {
     982        if (!encodedMessage.isBlank()) {
    983983            urlBuilder.append("?text=")
    984984                    .append(encodedMessage);
    985985        }
  • src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java b/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
    a b  
    111111         */
    112112        public String getDisplay() {
    113113            if (info.getSource() != null) {
    114                 if (info.getCategory() == NamedColorProperty.COLOR_CATEGORY_MAPPAINT)
     114                if (info.getCategory().equals(NamedColorProperty.COLOR_CATEGORY_MAPPAINT))
    115115                    return tr("Paint style {0}: {1}", tr(I18n.escape(info.getSource())), tr(info.getName()));
    116116                else
    117117                    return tr(I18n.escape(info.getSource())) + " - " + tr(I18n.escape(info.getName()));
  • src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java b/src/org/openstreetmap/josm/gui/layer/imagery/TileSourceDisplaySettings.java
    a b  
    8080    /**
    8181     * Create a new {@link TileSourceDisplaySettings}
    8282     */
    83     @SuppressWarnings("PMD.UnnecessaryVarargsArrayCreation") // See https://github.com/pmd/pmd/issues/5069
    8483    public TileSourceDisplaySettings() {
    8584        this(new String[] {PREFERENCE_PREFIX});
    8685    }
  • src/org/openstreetmap/josm/io/DefaultProxySelector.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/DefaultProxySelector.java b/src/org/openstreetmap/josm/io/DefaultProxySelector.java
    a b  
    111111
    112112    protected int parseProxyPortValue(String property, String value) {
    113113        if (value == null) return 0;
    114         int port = 0;
     114        int port;
    115115        try {
    116116            port = Integer.parseInt(value);
    117117        } catch (NumberFormatException e) {
  • src/org/openstreetmap/josm/io/BoundingBoxDownloader.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java b/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
    a b  
    1616import org.openstreetmap.josm.data.gpx.IGpxTrack;
    1717import org.openstreetmap.josm.data.notes.Note;
    1818import org.openstreetmap.josm.data.osm.DataSet;
     19import org.openstreetmap.josm.data.osm.RelationMember;
    1920import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2021import org.openstreetmap.josm.spi.preferences.Config;
    2122import org.openstreetmap.josm.tools.CheckParameterUtil;
    … …  
    233234                ds.getNodes().stream().filter(n -> bounds.stream().anyMatch(b -> b.contains(n)))
    234235                        .forEach(i -> i.setReferrersDownloaded(true));
    235236                ds.getWays().forEach(i -> i.setReferrersDownloaded(true));
    236                 ds.getRelations().stream().filter(r -> r.getMembers().stream().noneMatch(rm -> rm.isRelation()))
     237                ds.getRelations().stream().filter(r -> r.getMembers().stream().noneMatch(RelationMember::isRelation))
    237238                        .forEach(i -> i.setReferrersDownloaded(true));
    238239            }
    239240            return ds;
  • src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java b/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
    a b  
    10231023                    .build());
    10241024            withErrors.put(p, "LV");
    10251025        }
    1026         if (value.trim().isEmpty() && !withErrors.contains(p, "EV")) {
     1026        if (value.isBlank() && !withErrors.contains(p, "EV")) {
    10271027            errors.add(TestError.builder(this, Severity.WARNING, EMPTY_VALUES)
    10281028                    .message(tr("Tags with empty values"), s, key)
    10291029                    .primitives(p)
  • src/org/openstreetmap/josm/actions/JumpToAction.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/actions/JumpToAction.java b/src/org/openstreetmap/josm/actions/JumpToAction.java
    a b  
    173173            final int option = new JumpToPositionDialog(buttons, panel).showDialog().getValue();
    174174
    175175            if (option != 1) return;
    176             if (place.hasFocus() && !place.getText().trim().isEmpty()) {
     176            if (place.hasFocus() && !place.getText().isBlank()) {
    177177                try {
    178178                    List<NameFinder.SearchResult> searchResults = NameFinder.queryNominatim(place.getText());
    179179                    if (!searchResults.isEmpty()) {
  • src/org/openstreetmap/josm/tools/TextTagParser.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/tools/TextTagParser.java b/src/org/openstreetmap/josm/tools/TextTagParser.java
    a b  
    5858        String k;
    5959        String v;
    6060        for (String line: lines) {
    61             if (line.trim().isEmpty()) continue; // skip empty lines
     61            if (line.isBlank()) continue; // skip empty lines
    6262            Matcher m = p.matcher(line);
    6363            if (m.matches()) {
    6464                 k = Utils.removeWhiteSpaces(m.group(1));
  • src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Layer.java

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Layer.java b/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Layer.java
    a b  
    9898     * @param records The records to convert to a layer
    9999     * @throws IOException - if an IO error occurs
    100100     */
     101    @SuppressWarnings("PMD.CloseResource") // records are closed in the cleanup loop below; close() only releases the byte array
    101102    public Layer(Collection<ProtobufRecord> records) throws IOException {
    102103        // Do the unique required fields first
    103104        Map<Integer, List<ProtobufRecord>> sorted = new HashMap<>(records.size());