Ignore:
Timestamp:
2020-06-14T20:19:59+02:00 (4 years ago)
Author:
simon04
Message:

see #19334 - https://errorprone.info/bugpattern/StringSplitter

Location:
trunk/src/org/openstreetmap/josm/data/projection
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java

    r16626 r16643  
    358358
    359359        Pattern keyPattern = Pattern.compile("\\+(?<key>[a-zA-Z0-9_]+)(=(?<value>.*))?");
    360         String[] parts = Utils.WHITE_SPACES_PATTERN.split(trimmedPref);
     360        String[] parts = Utils.WHITE_SPACES_PATTERN.split(trimmedPref, -1);
    361361        for (String part : parts) {
    362362            Matcher m = keyPattern.matcher(part);
     
    511511     */
    512512    public Datum parseToWGS84(String paramList, Ellipsoid ellps) throws ProjectionConfigurationException {
    513         String[] numStr = paramList.split(",");
     513        String[] numStr = paramList.split(",", -1);
    514514
    515515        if (numStr.length != 3 && numStr.length != 7)
     
    621621     */
    622622    public static Bounds parseBounds(String boundsStr) throws ProjectionConfigurationException {
    623         String[] numStr = boundsStr.split(",");
     623        String[] numStr = boundsStr.split(",", -1);
    624624        if (numStr.length != 4)
    625625            throw new ProjectionConfigurationException(tr("Unexpected number of arguments for parameter ''+bounds'' (must be 4)"));
  • trunk/src/org/openstreetmap/josm/data/projection/ProjectionCLI.java

    r15716 r16643  
    166166
    167167    private EastNorth parseEastNorth(String s, ToDoubleFunction<String> parser) {
    168         String[] en = s.split("[;, ]+");
     168        String[] en = s.split("[;, ]+", -1);
    169169        if (en.length != 2)
    170170            throw new IllegalArgumentException(tr("Expected two coordinates, separated by white space, found {0} in ''{1}''", en.length, s));
Note: See TracChangeset for help on using the changeset viewer.