-
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
|
|
| 17 | 17 | <sonar.host.url>https://josm.openstreetmap.de/sonar/</sonar.host.url> |
| 18 | 18 | <sonar.projectKey>JOSM</sonar.projectKey> |
| 19 | 19 | <jmockit.version>1.49.a</jmockit.version> |
| 20 | | <pmd.version>7.22.0</pmd.version> |
| | 20 | <pmd.version>7.27.0</pmd.version> |
| 21 | 21 | <jacoco.version>0.8.13</jacoco.version> |
| 22 | 22 | <checkstyle.version>10.26.1</checkstyle.version> |
| 23 | 23 | <spotbugs.version>4.9.8</spotbugs.version> |
-
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
|
|
| 1085 | 1085 | osd.append(tr("\nDOP: {0}", entry.getExifGpsDop())); |
| 1086 | 1086 | } |
| 1087 | 1087 | if (entry.getExifGpsDatum() != null) { |
| 1088 | | osd.append(tr("\nDatum: {0}", entry.getExifGpsDatum().toString())); |
| | 1088 | osd.append(tr("\nDatum: {0}", entry.getExifGpsDatum())); |
| 1089 | 1089 | } |
| 1090 | 1090 | if (entry.getExifGpsProcMethod() != null) { |
| 1091 | | osd.append(tr("\nProc. method: {0}", entry.getExifGpsProcMethod().toString())); |
| | 1091 | osd.append(tr("\nProc. method: {0}", entry.getExifGpsProcMethod())); |
| 1092 | 1092 | } |
| 1093 | 1093 | } |
| 1094 | 1094 | Optional.ofNullable(entry.getIptcCaption()).map(s -> tr("\nCaption: {0}", s)).ifPresent(osd::append); |
-
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
|
|
| 101 | 101 | |
| 102 | 102 | @Override |
| 103 | 103 | 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)) |
| 105 | 105 | return; |
| 106 | 106 | |
| 107 | 107 | List<Way> unrelatedParents = n.referrers(Way.class).filter(w -> !isPowerLineOrCable(w) && !isRelatedToPower(w)) |
-
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
|
|
| 9 | 9 | import java.net.URI; |
| 10 | 10 | import java.nio.file.Files; |
| 11 | 11 | import java.time.Instant; |
| 12 | | import java.util.Date; |
| 13 | 12 | import java.util.List; |
| 14 | 13 | import java.util.Objects; |
| 15 | 14 | |
| … |
… |
|
| 351 | 350 | return null; |
| 352 | 351 | } |
| 353 | 352 | |
| 354 | | private static Date getDefensiveDate(Instant date) { |
| 355 | | if (date == null) |
| 356 | | return null; |
| 357 | | return Date.from(date); |
| 358 | | } |
| 359 | | |
| 360 | 353 | @Override |
| 361 | 354 | public LatLon getExifCoor() { |
| 362 | 355 | return exifCoor; |
-
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
|
|
| 286 | 286 | * @throws IOException if any I/O error occurs |
| 287 | 287 | * @since 18365 (public, primarily for ValidatorCLI) |
| 288 | 288 | */ |
| | 289 | @SuppressWarnings("PMD.UseTryWithResources") // zip.a is closed via Utils.close(), which swallows IOException |
| 289 | 290 | public synchronized ParseResult addMapCSS(String url, Consumer<String> assertionConsumer) throws ParseException, IOException { |
| 290 | 291 | CheckParameterUtil.ensureParameterNotNull(url, "url"); |
| 291 | 292 | ParseResult result; |
-
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
|
|
| 88 | 88 | * @param resolve {@code true} to resolve the class |
| 89 | 89 | * @return the class, if found, otherwise {@code null} |
| 90 | 90 | */ |
| | 91 | @SuppressWarnings("PMD.CloseResource") // dependency class loaders are shared and live for the application lifetime |
| 91 | 92 | private Class<?> findClassInDependencies(String name, boolean resolve) { |
| 92 | 93 | for (PluginClassLoader dep : dependencies) { |
| 93 | 94 | try { |
| … |
… |
|
| 104 | 105 | } |
| 105 | 106 | |
| 106 | 107 | @Override |
| | 108 | @SuppressWarnings("PMD.CloseResource") // dependency class loaders are shared and live for the application lifetime |
| 107 | 109 | public URL findResource(String name) { |
| 108 | 110 | URL resource = super.findResource(name); |
| 109 | 111 | if (resource == null) { |
-
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
|
|
| 8 | 8 | * @param <T> The source type (e.g., Imagery or otherwise -- should be the name of the class) |
| 9 | 9 | * @since 16545 |
| 10 | 10 | */ |
| 11 | | @SuppressWarnings("PMD.ImplicitFunctionalInterface") |
| 12 | 11 | public interface ISourceType<T extends Enum<T>> extends ICommonSource<T> { |
| 13 | 12 | /** |
| 14 | 13 | * Returns the unique string identifying this type. |
-
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
|
|
| 370 | 370 | * @throws SAXException if any XML error occurs |
| 371 | 371 | * @throws IOException if any I/O error occurs |
| 372 | 372 | */ |
| | 373 | @SuppressWarnings("PMD.UseTryWithResources") // zip.a/zip.b are closed via Utils.close(), which swallows IOException |
| 373 | 374 | static Collection<TaggingPreset> readAll(String source, boolean validate, HashSetWithLast<TaggingPreset> all) |
| 374 | 375 | throws SAXException, IOException { |
| 375 | 376 | Collection<TaggingPreset> tp; |
-
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
|
|
| 2 | 2 | package org.openstreetmap.josm.tools.date; |
| 3 | 3 | |
| 4 | 4 | import java.text.DateFormat; |
| 5 | | import java.text.ParsePosition; |
| 6 | 5 | import java.text.SimpleDateFormat; |
| 7 | 6 | import java.time.DateTimeException; |
| 8 | 7 | import java.time.Instant; |
| | 8 | import java.time.LocalDateTime; |
| 9 | 9 | import java.time.ZoneId; |
| 10 | 10 | import java.time.ZoneOffset; |
| 11 | 11 | import java.time.ZonedDateTime; |
| 12 | 12 | import java.time.format.DateTimeFormatter; |
| 13 | 13 | import java.time.format.DateTimeFormatterBuilder; |
| | 14 | import java.time.format.DateTimeParseException; |
| 14 | 15 | import java.time.format.FormatStyle; |
| 15 | 16 | import java.util.Date; |
| 16 | 17 | import java.util.Locale; |
| … |
… |
|
| 56 | 57 | * @throws UncheckedParseException if the date does not match any of the supported date formats |
| 57 | 58 | * @throws DateTimeException if the value of any field is out of range, or if the day-of-month is invalid for the month-year |
| 58 | 59 | */ |
| | 60 | @SuppressWarnings("PMD.ReplaceJavaUtilDate") // public API kept as Date for existing/plugin callers |
| 59 | 61 | public static Date fromString(String str) { |
| 60 | 62 | return new Date(tsFromString(str)); |
| 61 | 63 | } |
| … |
… |
|
| 148 | 150 | ).toInstant(); |
| 149 | 151 | } else { |
| 150 | 152 | // 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 | } |
| 155 | 161 | } |
| 156 | 162 | |
| 157 | 163 | // slow path for fractional seconds different from millisecond precision |
| … |
… |
|
| 196 | 202 | * @param date The date to format |
| 197 | 203 | * @return The formatted date |
| 198 | 204 | */ |
| | 205 | @SuppressWarnings("PMD.ReplaceJavaUtilDate") // public API kept as Date for existing/plugin callers |
| 199 | 206 | public static String fromDate(Date date) { |
| 200 | 207 | final ZonedDateTime temporal = date.toInstant().atZone(ZoneOffset.UTC); |
| 201 | 208 | return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(temporal); |
| … |
… |
|
| 207 | 214 | * @return cloned date, or null |
| 208 | 215 | * @since 11878 |
| 209 | 216 | */ |
| | 217 | @SuppressWarnings("PMD.ReplaceJavaUtilDate") // null-safe clone utility, inherently Date-typed |
| 210 | 218 | public static Date cloneDate(Date d) { |
| 211 | 219 | return d != null ? (Date) d.clone() : null; |
| 212 | 220 | } |
| … |
… |
|
| 298 | 306 | * @return The formatted date |
| 299 | 307 | * @since 7299 |
| 300 | 308 | */ |
| | 309 | @SuppressWarnings("PMD.ReplaceJavaUtilDate") // delegates to java.text.DateFormat, which requires a Date |
| 301 | 310 | public static String formatDate(Date date, int dateStyle) { |
| 302 | 311 | CheckParameterUtil.ensureParameterNotNull(date, "date"); |
| 303 | 312 | return getDateFormat(dateStyle).format(date); |
| … |
… |
|
| 337 | 346 | * @return The formatted time |
| 338 | 347 | * @since 7299 |
| 339 | 348 | */ |
| | 349 | @SuppressWarnings("PMD.ReplaceJavaUtilDate") // delegates to java.text.DateFormat, which requires a Date |
| 340 | 350 | public static String formatTime(Date time, int timeStyle) { |
| 341 | 351 | CheckParameterUtil.ensureParameterNotNull(time, "time"); |
| 342 | 352 | return getTimeFormat(timeStyle).format(time); |
| … |
… |
|
| 390 | 400 | * @return The formatted date/time |
| 391 | 401 | * @since 7299 |
| 392 | 402 | */ |
| | 403 | @SuppressWarnings("PMD.ReplaceJavaUtilDate") // delegates to java.text.DateFormat, which requires a Date |
| 393 | 404 | public static String formatDateTime(Date datetime, int dateStyle, int timeStyle) { |
| 394 | 405 | CheckParameterUtil.ensureParameterNotNull(datetime, "datetime"); |
| 395 | 406 | return getDateTimeFormat(dateStyle, timeStyle).format(datetime); |
-
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
|
|
| 101 | 101 | return false; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | | int iIpSegment = 0; |
| | 104 | int iIpSegment; |
| 105 | 105 | |
| 106 | 106 | try { |
| 107 | 107 | iIpSegment = Integer.parseInt(ipSegment); |
| … |
… |
|
| 180 | 180 | if (octet.length() > IPV6_MAX_HEX_DIGITS_PER_GROUP) { |
| 181 | 181 | return false; |
| 182 | 182 | } |
| 183 | | int octetInt = 0; |
| | 183 | int octetInt; |
| 184 | 184 | try { |
| 185 | 185 | octetInt = Integer.parseInt(octet, BASE_16); |
| 186 | 186 | } catch (NumberFormatException e) { |
-
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
|
|
| 830 | 830 | * |
| 831 | 831 | * @param plugins the plugins to add |
| 832 | 832 | */ |
| | 833 | @SuppressWarnings("PMD.CloseResource") // the joined class loader is shared and lives for the application lifetime |
| 833 | 834 | private static void extendJoinedPluginResourceCL(Collection<PluginInformation> plugins) { |
| 834 | 835 | // iterate all plugins and collect all libraries of all plugins: |
| 835 | 836 | File pluginDir = Preferences.main().getPluginsDirectory(); |
| … |
… |
|
| 935 | 936 | * Generate classloaders for a list of plugins |
| 936 | 937 | * @param toLoad The plugins to generate the classloaders for |
| 937 | 938 | */ |
| 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. |
| 939 | 940 | private static void generateClassloaders(List<PluginInformation> toLoad) { |
| 940 | 941 | for (PluginInformation info : toLoad) { |
| 941 | 942 | PluginClassLoader cl = AccessController.doPrivileged((PrivilegedAction<PluginClassLoader>) |
| … |
… |
|
| 951 | 952 | * Resolve dependencies for a list of plugins |
| 952 | 953 | * @param toLoad The plugins to resolve dependencies for |
| 953 | 954 | */ |
| 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 |
| 955 | 956 | private static void resolveDependencies(List<PluginInformation> toLoad) { |
| 956 | 957 | for (PluginInformation info : toLoad) { |
| 957 | 958 | PluginClassLoader cl = classLoaders.get(info.name); |
-
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
|
|
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | | return Optional.ofNullable(authorityMatcher.group(PARSE_AUTHORITY_EXTRA)).orElse("").trim().isEmpty(); |
| | 427 | return Optional.ofNullable(authorityMatcher.group(PARSE_AUTHORITY_EXTRA)).orElse("").isBlank(); |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | /** |
-
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
|
|
| 16 | 16 | <exclude name="AvoidStringBufferField"/> |
| 17 | 17 | <exclude name="ConstantsInInterface"/> |
| 18 | 18 | <exclude name="GuardLogStatement"/> |
| 19 | | <exclude name="JUnit4TestShouldUseTestAnnotation" reason="False positive in src/org/openstreetmap/josm/data/validation/Test.java"/> |
| 20 | 19 | <exclude name="LiteralsFirstInComparisons" reason="Introduced in 6.24, some positives in source code at this time. Replaces PositionLiteralsFirstInComparisons."/> |
| 21 | 20 | <exclude name="LooseCoupling"/> |
| 22 | 21 | <exclude name="MethodReturnsInternalArray"/> |
| 23 | 22 | <exclude name="OneDeclarationPerLine"/> |
| 24 | 23 | <exclude name="ReplaceHashtableWithMap"/> |
| 25 | | <exclude name="SwitchStmtsShouldHaveDefault"/> |
| 26 | 24 | <exclude name="SystemPrintln"/> |
| 27 | 25 | <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"/> |
| 30 | 26 | <exclude name="UseVarargs"/> |
| 31 | 27 | </rule> |
| 32 | 28 | <rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach"> |
| … |
… |
|
| 136 | 132 | <exclude name="TooManyMethods"/> |
| 137 | 133 | <exclude name="UseObjectForClearerAPI"/> |
| 138 | 134 | <exclude name="UselessOverridingMethod"/> |
| 139 | | <exclude name="UseUtilityClass"/> |
| 140 | 135 | </rule> |
| 141 | 136 | <rule ref="category/java/design.xml/SignatureDeclareThrowsException"> |
| 142 | 137 | <properties> |
| … |
… |
|
| 181 | 176 | <rule ref="category/java/performance.xml"> |
| 182 | 177 | <exclude name="AvoidInstantiatingObjectsInLoops"/> |
| 183 | 178 | <exclude name="ConsecutiveLiteralAppends"/> |
| 184 | | <exclude name="InefficientEmptyStringCheck"/> |
| 185 | 179 | <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"/> |
| 189 | 180 | <exclude name="UseStringBufferForStringAppends"/> |
| 190 | 181 | </rule> |
| 191 | 182 | |
-
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
|
|
| 19 | 19 | |
| 20 | 20 | protected void renderUploadComment(Changeset cs) { |
| 21 | 21 | String comment = cs.getComment(); |
| 22 | | if (comment.trim().isEmpty()) { |
| | 22 | if (comment.isBlank()) { |
| 23 | 23 | setText(trc("changeset.upload-comment", "empty")); |
| 24 | 24 | setFont(UIManager.getFont("Table.font").deriveFont(Font.ITALIC)); |
| 25 | 25 | } else { |
-
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
|
|
| 17 | 17 | import java.beans.PropertyChangeListener; |
| 18 | 18 | import java.util.ArrayList; |
| 19 | 19 | import java.util.EnumMap; |
| 20 | | import java.util.HashMap; |
| 21 | 20 | import java.util.List; |
| 22 | 21 | import java.util.Map; |
| 23 | 22 | import java.util.Map.Entry; |
| … |
… |
|
| 164 | 163 | Map<OsmPrimitiveType, Integer> targetStatistics) { |
| 165 | 164 | mode = Mode.RESOLVING_ONE_TAGCOLLECTION_ONLY; |
| 166 | 165 | 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; |
| 169 | 168 | |
| 170 | 169 | // init the resolver |
| 171 | 170 | // |
-
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
|
|
| 80 | 80 | |
| 81 | 81 | private void skipWhitespace() throws ParseError { |
| 82 | 82 | Token token = tokenizer.lookAhead(); |
| 83 | | if (token.getType() == TokenType.TEXT && token.getText().trim().isEmpty()) { |
| | 83 | if (token.getType() == TokenType.TEXT && token.getText().isBlank()) { |
| 84 | 84 | tokenizer.nextToken(); |
| 85 | 85 | } |
| 86 | 86 | } |
-
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
|
|
| 190 | 190 | public Command buildTagApplyCommands(Collection<? extends OsmPrimitive> primitives) { |
| 191 | 191 | if (!cbTagRelations.isSelected()) |
| 192 | 192 | return null; |
| 193 | | if (tfKey.getText().trim().isEmpty()) |
| | 193 | if (tfKey.getText().isBlank()) |
| 194 | 194 | return null; |
| 195 | | if (tfValue.getText().trim().isEmpty()) |
| | 195 | if (tfValue.getText().isBlank()) |
| 196 | 196 | return null; |
| 197 | 197 | if (Utils.isEmpty(primitives)) |
| 198 | 198 | return null; |
-
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
|
|
| 144 | 144 | // Retrieve the values from current rule visible on screen |
| 145 | 145 | NavigableSet<Integer> values = getNumericValues(); |
| 146 | 146 | // 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) { |
| 148 | 148 | if (currentAutoFilter.getFilter().value != null) { |
| 149 | 149 | values.add(currentAutoFilter.getFilter().value); |
| 150 | 150 | } |
| … |
… |
|
| 288 | 288 | int maxWidth = 16; |
| 289 | 289 | final AutoFilterButton keyButton = AutoFilterButton.forOsmKey(enabledRule.getKey()); |
| 290 | 290 | addButton(keyButton, Integer.MIN_VALUE, i++); |
| 291 | | var valueList = new ArrayList<>(values.descendingSet()); |
| | 291 | ArrayList<Integer> valueList = new ArrayList<>(values.descendingSet()); |
| 292 | 292 | if (enabledRule.getNoValueFilter()) { |
| 293 | 293 | valueList.add(null); |
| 294 | 294 | } |
| … |
… |
|
| 330 | 330 | } |
| 331 | 331 | BBox bbox = MainApplication.getMap().mapView.getState().getViewArea().getLatLonBoundsBox().toBBox(); |
| 332 | 332 | 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))) { |
| 334 | 334 | // add all values that are directly mentioned |
| 335 | 335 | primitiveList.forEach(o -> enabledRule.getTagValuesForPrimitive(o, true).forEach(values::add)); |
| 336 | 336 | // only add integer values from value ranges, not fractional values |
-
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
|
|
| 48 | 48 | |
| 49 | 49 | private IntFunction<String> valueFormatter = Integer::toString; |
| 50 | 50 | |
| 51 | | private boolean noValueFilter = false; |
| | 51 | private boolean noValueFilter; |
| 52 | 52 | |
| 53 | 53 | /** The union of {@link #key} and the keys provided by {@link #setExtraKeys(List)}. */ |
| 54 | 54 | private List<String> allKeys; |
-
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
|
|
| 27 | 27 | @Test |
| 28 | 28 | void testFetchHelpTopicContentNominal() throws HelpContentReaderException { |
| 29 | 29 | String res = new HelpContentReader(HelpUtil.getWikiBaseUrl()).fetchHelpTopicContent(HelpBrowserTest.URL_1, false); |
| 30 | | assertFalse(res.trim().isEmpty()); |
| | 30 | assertFalse(res.isBlank()); |
| 31 | 31 | } |
| 32 | 32 | } |
-
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
|
|
| 1418 | 1418 | ExtendedSourceEntry last = null; |
| 1419 | 1419 | |
| 1420 | 1420 | while ((line = reader.readLine()) != null && !canceled) { |
| 1421 | | if (line.trim().isEmpty()) { |
| | 1421 | if (line.isBlank()) { |
| 1422 | 1422 | continue; // skip empty lines |
| 1423 | 1423 | } |
| 1424 | 1424 | if (line.startsWith("\t")) { |
-
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
|
|
| 192 | 192 | @Override |
| 193 | 193 | public void actionPerformed(ActionEvent e) { |
| 194 | 194 | String searchExpression = cbSearchExpression.getText(); |
| 195 | | if (!isEnabled() || searchExpression.trim().isEmpty() || serverComboBox.getSelectedItem() == null) |
| | 195 | if (!isEnabled() || searchExpression.isBlank() || serverComboBox.getSelectedItem() == null) |
| 196 | 196 | return; |
| 197 | 197 | cbSearchExpression.addCurrentItemToHistory(); |
| 198 | 198 | cbSearchExpression.getModel().prefs().save(HISTORY_KEY); |
| … |
… |
|
| 214 | 214 | |
| 215 | 215 | protected final void updateState() { |
| 216 | 216 | String searchExpression = cbSearchExpression.getText(); |
| 217 | | setEnabled(!searchExpression.trim().isEmpty()); |
| | 217 | setEnabled(!searchExpression.isBlank()); |
| 218 | 218 | isSearchMore = Objects.equals(lastSearchExpression, searchExpression) && !model.getData().isEmpty(); |
| 219 | 219 | if (isSearchMore) { |
| 220 | 220 | putValue(NAME, tr("Search more...")); |
-
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
|
|
| 7 | 7 | * This preference setting's addGui method is called after the user clicked the parent tab |
| 8 | 8 | * (returned by getTabPreferenceSetting). |
| 9 | 9 | */ |
| 10 | | @SuppressWarnings("PMD.ImplicitFunctionalInterface") |
| 11 | 10 | public interface SubPreferenceSetting extends PreferenceSetting { |
| 12 | 11 | |
| 13 | 12 | /** |
-
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
|
|
| 399 | 399 | @Override |
| 400 | 400 | public void keyPressed(KeyEvent e) { |
| 401 | 401 | if (e.getKeyChar() == KeyEvent.VK_ENTER) { |
| 402 | | if (currentTF.getText().trim().isEmpty()) { |
| | 402 | if (currentTF.getText().isBlank()) { |
| 403 | 403 | currentTF.selectAll(); |
| 404 | | } else if (nextTF.getText().trim().isEmpty()) { |
| | 404 | } else if (nextTF.getText().isBlank()) { |
| 405 | 405 | nextTF.requestFocusInWindow(); |
| 406 | 406 | nextTF.selectAll(); |
| 407 | 407 | } else { |
-
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
|
|
| 122 | 122 | addAttr("exif-gps-dop", entry.getExifGpsDop().toString(), imgElem, support); |
| 123 | 123 | } |
| 124 | 124 | if (entry.getExifGpsDatum() != null) { |
| 125 | | addAttr("exif-gps-datum", entry.getExifGpsDatum().toString(), imgElem, support); |
| | 125 | addAttr("exif-gps-datum", entry.getExifGpsDatum(), imgElem, support); |
| 126 | 126 | } |
| 127 | 127 | if (entry.getExifGpsProcMethod() != null) { |
| 128 | | addAttr("exif-gps-procmethod", entry.getExifGpsProcMethod().toString(), imgElem, support); |
| | 128 | addAttr("exif-gps-procmethod", entry.getExifGpsProcMethod(), imgElem, support); |
| 129 | 129 | } |
| 130 | 130 | if (entry.hasNewGpsData()) { |
| 131 | 131 | addAttr("is-new-gps-data", Boolean.toString(entry.hasNewGpsData()), imgElem, support); |
-
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
|
|
| 38 | 38 | * {@link org.apache.commons.io.output.CloseShieldOutputStream} when calling this method to |
| 39 | 39 | * avoid potential future issues) |
| 40 | 40 | */ |
| 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. |
| 42 | 42 | public static void exportData(DataSet data, OutputStream out) { |
| 43 | 43 | // This writer will close out when it is closed |
| 44 | 44 | Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8); |
-
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
|
|
| 43 | 43 | |
| 44 | 44 | @Override |
| 45 | 45 | public boolean isValid() { |
| 46 | | if (getComponent().getText().trim().isEmpty()) |
| | 46 | if (getComponent().getText().isBlank()) |
| 47 | 47 | return true; |
| 48 | 48 | return getTime() != null; |
| 49 | 49 | } |
| … |
… |
|
| 91 | 91 | * @return the time |
| 92 | 92 | */ |
| 93 | 93 | public LocalTime getTime() { |
| 94 | | if (getComponent().getText().trim().isEmpty()) |
| | 94 | if (getComponent().getText().isBlank()) |
| 95 | 95 | return LocalTime.MIDNIGHT; |
| 96 | 96 | |
| 97 | 97 | for (final FormatStyle format: FormatStyle.values()) { |
-
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
|
|
| 203 | 203 | |
| 204 | 204 | protected void validate() { |
| 205 | 205 | String value = tfUrl.getText(); |
| 206 | | if (value.trim().isEmpty()) { |
| | 206 | if (value.isBlank()) { |
| 207 | 207 | feedbackNone(); |
| 208 | 208 | return; |
| 209 | 209 | } |
-
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
|
|
| 20 | 20 | |
| 21 | 21 | @Override |
| 22 | 22 | public Proj createInstance() { |
| 23 | | Proj proj = null; |
| | 23 | Proj proj; |
| 24 | 24 | try { |
| 25 | 25 | proj = projClass.getConstructor().newInstance(); |
| 26 | 26 | } catch (ReflectiveOperationException e) { |
-
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
|
|
| 338 | 338 | /** |
| 339 | 339 | * Extracted interface of {@link EditTagDialog}. |
| 340 | 340 | */ |
| 341 | | @SuppressWarnings("PMD.ImplicitFunctionalInterface") |
| 342 | 341 | protected interface IEditTagDialog extends IExtendedDialog { |
| 343 | 342 | /** |
| 344 | 343 | * Edit tags of multiple selected objects according to selected ComboBox values |
-
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
|
|
| 122 | 122 | Pattern projPattern = Pattern.compile("<(.+?)>(.*)<>"); |
| 123 | 123 | RefEntry curEntry = null; |
| 124 | 124 | while ((line = in.readLine()) != null) { |
| 125 | | if (line.startsWith("#") || line.trim().isEmpty()) { |
| | 125 | if (line.startsWith("#") || line.isBlank()) { |
| 126 | 126 | continue; |
| 127 | 127 | } |
| 128 | 128 | if (line.startsWith("<")) { |
-
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
|
|
| 79 | 79 | |
| 80 | 80 | @Override |
| 81 | 81 | // The new closable resources in this method will close the input OutputStream |
| 82 | | @SuppressWarnings("squid:S2095") |
| | 82 | @SuppressWarnings({"squid:S2095", "PMD.CloseResource"}) |
| 83 | 83 | protected void addDataFile(OutputStream out) { |
| 84 | 84 | Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8); |
| 85 | 85 | GpxWriter w = new GpxWriter(new PrintWriter(writer)); |
-
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
|
|
| 26 | 26 | |
| 27 | 27 | @Override |
| 28 | 28 | public boolean isValid() { |
| 29 | | return !getComponent().getText().trim().isEmpty(); |
| | 29 | return !getComponent().getText().isBlank(); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | @Override |
-
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
|
|
| 202 | 202 | |
| 203 | 203 | // remember update interval |
| 204 | 204 | // |
| 205 | | int days = 0; |
| | 205 | int days; |
| 206 | 206 | try { |
| 207 | 207 | days = Integer.parseInt(tfUpdateInterval.getText().trim()); |
| 208 | 208 | if (days <= 0) { |
-
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
|
|
| 69 | 69 | protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { |
| 70 | 70 | updateEnabledStateOnModifiableSelection(selection); |
| 71 | 71 | if (isEnabled() && !Utils.isEmpty(selection) |
| 72 | | && DownloadPolicy.BLOCKED.equals(selection.iterator().next().getDataSet().getDownloadPolicy())) { |
| | 72 | && selection.iterator().next().getDataSet().getDownloadPolicy() == DownloadPolicy.BLOCKED) { |
| 73 | 73 | setEnabled(false); |
| 74 | 74 | } |
| 75 | 75 | } |
-
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
|
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | // The new closable resources in this method will close the input OutputStream |
| 98 | | @SuppressWarnings("squid:S2095") |
| | 98 | @SuppressWarnings({"squid:S2095", "PMD.CloseResource"}) |
| 99 | 99 | protected void addDataFile(OutputStream out) { |
| 100 | 100 | Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8); |
| 101 | 101 | MarkerWriter w = new MarkerWriter(new PrintWriter(writer)); |
-
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
|
|
| 145 | 145 | |
| 146 | 146 | @Override |
| 147 | 147 | public void validate() { |
| 148 | | double value = 0; |
| | 148 | double value; |
| 149 | 149 | try { |
| 150 | 150 | value = JosmDecimalFormatSymbolsProvider.parseDouble(getComponent().getText()); |
| 151 | 151 | } catch (NumberFormatException ex) { |
| … |
… |
|
| 183 | 183 | |
| 184 | 184 | @Override |
| 185 | 185 | public void validate() { |
| 186 | | double value = 0; |
| | 186 | double value; |
| 187 | 187 | try { |
| 188 | 188 | value = JosmDecimalFormatSymbolsProvider.parseDouble(getComponent().getText()); |
| 189 | 189 | } catch (NumberFormatException ex) { |
-
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
|
|
| 98 | 98 | this.mappaintCacheIdx = dataSet.getMappaintCacheIndex(); |
| 99 | 99 | } |
| 100 | 100 | |
| | 101 | @Override |
| 101 | 102 | public void clearCachedStyle() { |
| 102 | 103 | this.mappaintStyle.clear(); |
| 103 | 104 | } |
-
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
|
|
| 336 | 336 | handler.setSender(sender); |
| 337 | 337 | handler.handle(); |
| 338 | 338 | 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 |
| 340 | 340 | + "\r\n"); |
| 341 | 341 | out.write("\r\n"); |
| 342 | 342 | out.write(handler.getContent()); |
-
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
|
|
| 78 | 78 | } else if (c == '\\') { |
| 79 | 79 | esc = true; |
| 80 | 80 | } else if (c == '\"' && !quotesStarted) { // opening " |
| 81 | | if (!s.toString().trim().isEmpty()) { // we had ||some text"|| |
| | 81 | if (!s.toString().isBlank()) { // we had ||some text"|| |
| 82 | 82 | s.append(c); // just add ", not open |
| 83 | 83 | } else { |
| 84 | 84 | s.delete(0, s.length()); // forget that empty characters and start reading ".... |
-
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
|
|
| 232 | 232 | |
| 233 | 233 | @Override |
| 234 | 234 | public boolean isValid() { |
| 235 | | if (getComponent().getText().trim().isEmpty()) |
| | 235 | if (getComponent().getText().isBlank()) |
| 236 | 236 | return false; |
| 237 | 237 | return Utils.isValidUrl(getComponent().getText().trim()); |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | @Override |
| 241 | 241 | public void validate() { |
| 242 | | if (getComponent().getText().trim().isEmpty()) { |
| | 242 | if (getComponent().getText().isBlank()) { |
| 243 | 243 | feedbackInvalid(tr("OSM API URL must not be empty. Please enter the OSM API URL.")); |
| 244 | 244 | return; |
| 245 | 245 | } |
-
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
|
|
| 958 | 958 | String encodedMessage = Utils.encodeUrl(closeMessage); |
| 959 | 959 | StringBuilder urlBuilder = noteStringBuilder(note) |
| 960 | 960 | .append("/close"); |
| 961 | | if (!encodedMessage.trim().isEmpty()) { |
| | 961 | if (!encodedMessage.isBlank()) { |
| 962 | 962 | urlBuilder.append("?text=") |
| 963 | 963 | .append(encodedMessage); |
| 964 | 964 | } |
| … |
… |
|
| 979 | 979 | String encodedMessage = Utils.encodeUrl(reactivateMessage); |
| 980 | 980 | StringBuilder urlBuilder = noteStringBuilder(note) |
| 981 | 981 | .append("/reopen"); |
| 982 | | if (!encodedMessage.trim().isEmpty()) { |
| | 982 | if (!encodedMessage.isBlank()) { |
| 983 | 983 | urlBuilder.append("?text=") |
| 984 | 984 | .append(encodedMessage); |
| 985 | 985 | } |
-
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
|
|
| 111 | 111 | */ |
| 112 | 112 | public String getDisplay() { |
| 113 | 113 | if (info.getSource() != null) { |
| 114 | | if (info.getCategory() == NamedColorProperty.COLOR_CATEGORY_MAPPAINT) |
| | 114 | if (info.getCategory().equals(NamedColorProperty.COLOR_CATEGORY_MAPPAINT)) |
| 115 | 115 | return tr("Paint style {0}: {1}", tr(I18n.escape(info.getSource())), tr(info.getName())); |
| 116 | 116 | else |
| 117 | 117 | return tr(I18n.escape(info.getSource())) + " - " + tr(I18n.escape(info.getName())); |
-
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
|
|
| 80 | 80 | /** |
| 81 | 81 | * Create a new {@link TileSourceDisplaySettings} |
| 82 | 82 | */ |
| 83 | | @SuppressWarnings("PMD.UnnecessaryVarargsArrayCreation") // See https://github.com/pmd/pmd/issues/5069 |
| 84 | 83 | public TileSourceDisplaySettings() { |
| 85 | 84 | this(new String[] {PREFERENCE_PREFIX}); |
| 86 | 85 | } |
-
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
|
|
| 111 | 111 | |
| 112 | 112 | protected int parseProxyPortValue(String property, String value) { |
| 113 | 113 | if (value == null) return 0; |
| 114 | | int port = 0; |
| | 114 | int port; |
| 115 | 115 | try { |
| 116 | 116 | port = Integer.parseInt(value); |
| 117 | 117 | } catch (NumberFormatException e) { |
-
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
|
|
| 16 | 16 | import org.openstreetmap.josm.data.gpx.IGpxTrack; |
| 17 | 17 | import org.openstreetmap.josm.data.notes.Note; |
| 18 | 18 | import org.openstreetmap.josm.data.osm.DataSet; |
| | 19 | import org.openstreetmap.josm.data.osm.RelationMember; |
| 19 | 20 | import org.openstreetmap.josm.gui.progress.ProgressMonitor; |
| 20 | 21 | import org.openstreetmap.josm.spi.preferences.Config; |
| 21 | 22 | import org.openstreetmap.josm.tools.CheckParameterUtil; |
| … |
… |
|
| 233 | 234 | ds.getNodes().stream().filter(n -> bounds.stream().anyMatch(b -> b.contains(n))) |
| 234 | 235 | .forEach(i -> i.setReferrersDownloaded(true)); |
| 235 | 236 | 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)) |
| 237 | 238 | .forEach(i -> i.setReferrersDownloaded(true)); |
| 238 | 239 | } |
| 239 | 240 | return ds; |
-
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
|
|
| 1023 | 1023 | .build()); |
| 1024 | 1024 | withErrors.put(p, "LV"); |
| 1025 | 1025 | } |
| 1026 | | if (value.trim().isEmpty() && !withErrors.contains(p, "EV")) { |
| | 1026 | if (value.isBlank() && !withErrors.contains(p, "EV")) { |
| 1027 | 1027 | errors.add(TestError.builder(this, Severity.WARNING, EMPTY_VALUES) |
| 1028 | 1028 | .message(tr("Tags with empty values"), s, key) |
| 1029 | 1029 | .primitives(p) |
-
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
|
|
| 173 | 173 | final int option = new JumpToPositionDialog(buttons, panel).showDialog().getValue(); |
| 174 | 174 | |
| 175 | 175 | if (option != 1) return; |
| 176 | | if (place.hasFocus() && !place.getText().trim().isEmpty()) { |
| | 176 | if (place.hasFocus() && !place.getText().isBlank()) { |
| 177 | 177 | try { |
| 178 | 178 | List<NameFinder.SearchResult> searchResults = NameFinder.queryNominatim(place.getText()); |
| 179 | 179 | if (!searchResults.isEmpty()) { |
-
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
|
|
| 58 | 58 | String k; |
| 59 | 59 | String v; |
| 60 | 60 | for (String line: lines) { |
| 61 | | if (line.trim().isEmpty()) continue; // skip empty lines |
| | 61 | if (line.isBlank()) continue; // skip empty lines |
| 62 | 62 | Matcher m = p.matcher(line); |
| 63 | 63 | if (m.matches()) { |
| 64 | 64 | k = Utils.removeWhiteSpaces(m.group(1)); |
-
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
|
|
| 98 | 98 | * @param records The records to convert to a layer |
| 99 | 99 | * @throws IOException - if an IO error occurs |
| 100 | 100 | */ |
| | 101 | @SuppressWarnings("PMD.CloseResource") // records are closed in the cleanup loop below; close() only releases the byte array |
| 101 | 102 | public Layer(Collection<ProtobufRecord> records) throws IOException { |
| 102 | 103 | // Do the unique required fields first |
| 103 | 104 | Map<Integer, List<ProtobufRecord>> sorted = new HashMap<>(records.size()); |