Changeset 19106 in josm for trunk/scripts


Ignore:
Timestamp:
2024-06-13T21:18:45+02:00 (4 months ago)
Author:
taylor.smock
Message:

Cleanup some new PMD warnings from PMD 7.x (followup of r19101)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/SyncEditorLayerIndex.java

    r18989 r19106  
    108108    private static String optionEncoding;
    109109    private static boolean optionNoEli;
    110     private Map<String, String> skip = new HashMap<>();
    111     private Map<String, String> skipStart = new HashMap<>();
     110    private final Map<String, String> skip = new HashMap<>();
     111    private final Map<String, String> skipStart = new HashMap<>();
    112112
    113113    /**
     
    238238
    239239    void loadSkip() throws IOException {
    240         final Pattern pattern = Pattern.compile("^\\|\\| *(ELI|Ignore) *\\|\\| *\\{\\{\\{(.+)\\}\\}\\} *\\|\\|");
     240        final Pattern pattern = Pattern.compile("^\\|\\| *(ELI|Ignore) *\\|\\| *\\{\\{\\{(.+)}}} *\\|\\|");
    241241        try (BufferedReader fr = Files.newBufferedReader(Paths.get(ignoreInputFile), UTF_8)) {
    242242            String line;
     
    479479                    shapes += sep + "</shape>\n";
    480480                }
    481             } catch (IllegalArgumentException ignored) {
    482                 Logging.trace(ignored);
     481            } catch (IllegalArgumentException illegalArgumentException) {
     482                Logging.trace(illegalArgumentException);
    483483            }
    484484            if (!shapes.isEmpty()) {
     
    776776            if (m.matches()) {
    777777                Calendar cal = Calendar.getInstance();
    778                 cal.set(Integer.valueOf(m.group(2)),
    779                         m.group(4) == null ? 0 : Integer.valueOf(m.group(4))-1,
    780                         m.group(6) == null ? 1 : Integer.valueOf(m.group(6)));
     778                cal.set(Integer.parseInt(m.group(2)),
     779                        m.group(4) == null ? 0 : Integer.parseInt(m.group(4))-1,
     780                        m.group(6) == null ? 1 : Integer.parseInt(m.group(6)));
    781781                cal.add(Calendar.DAY_OF_MONTH, -1);
    782782                ed2 = m.group(1) + cal.get(Calendar.YEAR);
     
    12301230                } else {
    12311231                    try {
    1232                         URL jurl = new URL(u.replaceAll("\\{switch:[^\\}]*\\}", "x"));
     1232                        URL jurl = new URL(u.replaceAll("\\{switch:[^}]*}", "x"));
    12331233                        String domain = jurl.getHost();
    12341234                        int port = jurl.getPort();
     
    13751375        List<String> r = new ArrayList<>();
    13761376        List<String> u = getProjectionsUnstripped(e);
    1377         if (u != null) {
    1378             for (String p : u) {
    1379                 if (!oldproj.containsKey(p) && !("CRS:84".equals(p) && !(getUrlStripped(e).matches("(?i)version=1\\.3")))) {
    1380                     r.add(p);
    1381                 }
     1377        for (String p : u) {
     1378            if (!oldproj.containsKey(p) && !("CRS:84".equals(p) && !(getUrlStripped(e).matches("(?i)version=1\\.3")))) {
     1379                r.add(p);
    13821380            }
    13831381        }
Note: See TracChangeset for help on using the changeset viewer.