Ignore:
Timestamp:
2018-12-31T19:36:59+01:00 (10 months ago)
Author:
Don-vip
Message:

fix various SonarQube issues

File:
1 edited

Legend:

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

    r13647 r14624  
    1010import java.util.Collections;
    1111import java.util.List;
     12import java.util.stream.Collectors;
    1213
     14import org.openstreetmap.josm.spi.preferences.Config;
    1315import org.openstreetmap.josm.tools.Logging;
    1416import org.openstreetmap.josm.tools.Platform;
     
    7476    }
    7577
     78    private static List<File> visit(String prefSuffix, String... defaults) {
     79        return Config.getPref().getList("ntv2.proj4.grid.dir." + prefSuffix, Arrays.asList(defaults))
     80                               .stream().map(File::new).collect(Collectors.toList());
     81    }
     82
    7683    @Override
    7784    public List<File> visitUnixoid() {
    78         return Arrays.asList(new File("/usr/local/share/proj"), new File("/usr/share/proj"));
     85        return visit("unix", "/usr/local/share/proj", "/usr/share/proj");
    7986    }
    8087
    8188    @Override
    8289    public List<File> visitWindows() {
    83         return Arrays.asList(new File("C:\\PROJ\\NAD"));
     90        return visit("windows", "C:\\PROJ\\NAD");
    8491    }
    8592
Note: See TracChangeset for help on using the changeset viewer.