Ignore:
Timestamp:
2017-04-12T22:22:52+02:00 (3 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/projection/CustomProjection.java

    r11858 r11889  
    344344    public static Map<String, String> parseParameterList(String pref, boolean ignoreUnknownParameter) throws ProjectionConfigurationException {
    345345        Map<String, String> parameters = new HashMap<>();
    346         if (pref.trim().isEmpty()) {
     346        String trimmedPref = pref.trim();
     347        if (trimmedPref.isEmpty()) {
    347348            return parameters;
    348349        }
    349350
    350351        Pattern keyPattern = Pattern.compile("\\+(?<key>[a-zA-Z0-9_]+)(=(?<value>.*))?");
    351         String[] parts = Utils.WHITE_SPACES_PATTERN.split(pref.trim());
     352        String[] parts = Utils.WHITE_SPACES_PATTERN.split(trimmedPref);
    352353        for (String part : parts) {
    353354            Matcher m = keyPattern.matcher(part);
     
    488489    }
    489490
     491    /**
     492     * Parse {@code towgs84} parameter.
     493     * @param paramList List of parameter arguments (expected: 3 or 7)
     494     * @param ellps ellipsoid
     495     * @return parsed datum ({@link ThreeParameterDatum} or {@link SevenParameterDatum})
     496     * @throws ProjectionConfigurationException if the arguments cannot be parsed
     497     */
    490498    public Datum parseToWGS84(String paramList, Ellipsoid ellps) throws ProjectionConfigurationException {
    491499        String[] numStr = paramList.split(",");
Note: See TracChangeset for help on using the changeset viewer.