Ignore:
Timestamp:
2026-10-01T17:54:30+02:00 (4 weeks ago)
Author:
gaben
Message:

see #24635 - fix PMD violations

  • use String.isBlank() instead of trim().isEmpty(),
  • method references,
  • EnumMap for enum keys
  • drop redundant initializers/toString() calls and unused annotations,
  • remove unused private getDefensiveDate()
  • use an explicit charset for Content-length
Location:
trunk/src/org/openstreetmap/josm/data/validation/tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java

    r19374 r19629  
    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");
  • trunk/src/org/openstreetmap/josm/data/validation/tests/PowerLines.java

    r19619 r19629  
    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
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java

    r19437 r19629  
    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)
Note: See TracChangeset for help on using the changeset viewer.