Ignore:
Timestamp:
2017-04-12T22:22:52+02:00 (8 years ago)
Author:
Don-vip
Message:

PMD - fix some InefficientEmptyStringCheck (new in PMD 5.5.5)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/routines/UrlValidator.java

    r11747 r11889  
    2424import java.util.HashSet;
    2525import java.util.Locale;
     26import java.util.Optional;
    2627import java.util.Set;
    2728import java.util.regex.Matcher;
     
    428429        }
    429430
    430         String extra = authorityMatcher.group(PARSE_AUTHORITY_EXTRA);
    431         if (extra != null && !extra.trim().isEmpty()) {
    432             return false;
    433         }
    434 
    435         return true;
     431        return Optional.ofNullable(authorityMatcher.group(PARSE_AUTHORITY_EXTRA)).orElse("").trim().isEmpty();
    436432    }
    437433
Note: See TracChangeset for help on using the changeset viewer.