Changeset 11620 in josm


Ignore:
Timestamp:
2017-02-25T20:47:05+01:00 (7 years ago)
Author:
Don-vip
Message:

checkstyle - enable CatchParameterName rule

Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/JumpToAction.java

    r11343 r11620  
    195195            double zoomLvl = Double.parseDouble(zm.getText());
    196196            url.setText(OsmUrlToBounds.getURL(dlat, dlon, (int) zoomLvl));
    197         } catch (NumberFormatException x) {
    198             Main.debug(x.getMessage());
     197        } catch (NumberFormatException e) {
     198            Main.debug(e.getMessage());
    199199        }
    200200    }
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r11498 r11620  
    282282                    .append(paramCleanup(entry.getValue().getValue().toString())).append('\n');
    283283            }
    284         } catch (Exception x) {
    285             Main.error(x);
     284        } catch (Exception ex) {
     285            Main.error(ex);
    286286        }
    287287
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r11557 r11620  
    349349
    350350                    oldMousePos = ms.mousePos;
    351                 } catch (ConcurrentModificationException x) {
    352                     Main.warn(x);
     351                } catch (ConcurrentModificationException ex) {
     352                    Main.warn(ex);
    353353                } finally {
    354354                    if (ds != null) {
  • trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java

    r10378 r11620  
    141141            try {
    142142                values[i] = Double.parseDouble(latlon[i].getText());
    143             } catch (NumberFormatException x) {
     143            } catch (NumberFormatException ex) {
    144144                return null;
    145145            }
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r11553 r11620  
    291291                    data.storageFile = sel;
    292292
    293                 } catch (SAXException x) {
    294                     Main.error(x);
     293                } catch (SAXException ex) {
     294                    Main.error(ex);
    295295                    JOptionPane.showMessageDialog(
    296296                            Main.parent,
    297                             tr("Error while parsing {0}", sel.getName())+": "+x.getMessage(),
     297                            tr("Error while parsing {0}", sel.getName())+": "+ex.getMessage(),
    298298                            tr("Error"),
    299299                            JOptionPane.ERROR_MESSAGE
    300300                    );
    301301                    return;
    302                 } catch (IOException x) {
    303                     Main.error(x);
     302                } catch (IOException ex) {
     303                    Main.error(ex);
    304304                    JOptionPane.showMessageDialog(
    305305                            Main.parent,
    306                             tr("Could not read \"{0}\"", sel.getName())+'\n'+x.getMessage(),
     306                            tr("Could not read \"{0}\"", sel.getName())+'\n'+ex.getMessage(),
    307307                            tr("Error"),
    308308                            JOptionPane.ERROR_MESSAGE
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java

    r11037 r11620  
    452452            dirExif = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class);
    453453            dirGps = metadata.getFirstDirectoryOfType(GpsDirectory.class);
    454         } catch (CompoundException | IOException p) {
    455             Main.warn(p);
     454        } catch (CompoundException | IOException ex) {
     455            Main.warn(ex);
    456456            setExifCoor(null);
    457457            setPos(null);
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ThumbsLoader.java

    r11535 r11620  
    150150            try {
    151151                Thread.sleep(10);
    152             } catch (InterruptedException ie) {
     152            } catch (InterruptedException e) {
    153153                Main.warn("InterruptedException while drawing thumb");
    154154                Thread.currentThread().interrupt();
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r10611 r11620  
    155155            try {
    156156                OsmApi.getOsmApi().initialize(null);
    157             } catch (OsmTransferCanceledException | OsmApiInitializationException x) {
    158                 Main.warn(x);
     157            } catch (OsmTransferCanceledException | OsmApiInitializationException ex) {
     158                Main.warn(ex);
    159159            }
    160160        }
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java

    r11452 r11620  
    141141                    aibutton.addActionListener(e -> auto_increment_selected = buttonvalue);
    142142                    pnl.add(aibutton, GBC.std());
    143                 } catch (ParseException x) {
     143                } catch (ParseException ex) {
    144144                    Main.error("Cannot parse auto-increment value of '" + ai + "' into an integer");
    145145                }
  • trunk/src/org/openstreetmap/josm/io/FileWatcher.java

    r11589 r11620  
    113113            try {
    114114                key = watcher.take();
    115             } catch (InterruptedException x) {
     115            } catch (InterruptedException ex) {
    116116                Thread.currentThread().interrupt();
    117117                return;
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r11553 r11620  
    205205            new GpxWriter(fo).write(gpxData);
    206206            fo.flush();
    207         } catch (IOException x) {
    208             Main.error(x);
    209             JOptionPane.showMessageDialog(Main.parent, tr("Error while exporting {0}:\n{1}", fn, x.getMessage()),
     207        } catch (IOException ex) {
     208            Main.error(ex);
     209            JOptionPane.showMessageDialog(Main.parent, tr("Error while exporting {0}:\n{1}", fn, ex.getMessage()),
    210210                    tr("Error"), JOptionPane.ERROR_MESSAGE);
    211211        }
  • trunk/src/org/openstreetmap/josm/io/NameFinder.java

    r11452 r11620  
    238238                    data.add(currentResult);
    239239                }
    240             } catch (NumberFormatException x) {
    241                 Main.error(x); // SAXException does not chain correctly
    242                 throw new SAXException(x.getMessage(), x);
    243             } catch (NullPointerException x) {
    244                 Main.error(x); // SAXException does not chain correctly
    245                 throw new SAXException(tr("Null pointer exception, possibly some missing tags."), x);
     240            } catch (NumberFormatException ex) {
     241                Main.error(ex); // SAXException does not chain correctly
     242                throw new SAXException(ex.getMessage(), ex);
     243            } catch (NullPointerException ex) {
     244                Main.error(ex); // SAXException does not chain correctly
     245                throw new SAXException(tr("Null pointer exception, possibly some missing tags."), ex);
    246246            }
    247247        }
  • trunk/src/org/openstreetmap/josm/io/NmeaReader.java

    r11553 r11620  
    415415            return true;
    416416
    417         } catch (RuntimeException x) {
     417        } catch (RuntimeException ex) {
    418418            // out of bounds and such
    419             Main.debug(x);
     419            Main.debug(ex);
    420420            ps.malformed++;
    421421            ps.pWp = null;
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java

    r10627 r11620  
    103103                Socket request = server.accept();
    104104                RequestProcessor.processRequest(request);
    105             } catch (SocketException se) {
     105            } catch (SocketException e) {
    106106                if (!server.isClosed()) {
    107                     Main.error(se);
     107                    Main.error(e);
    108108                } else {
    109109                    // stop the thread automatically if server is stopped
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java

    r11312 r11620  
    417417                }
    418418                RequestProcessor.processRequest(request);
    419             } catch (SocketException se) {
     419            } catch (SocketException e) {
    420420                if (!server.isClosed()) {
    421                     Main.error(se);
     421                    Main.error(e);
    422422                }
    423423            } catch (IOException ioe) {
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r11381 r11620  
    602602                zipFile = new ZipFile(sessionFile, StandardCharsets.UTF_8);
    603603                return getZipInputStream(zipFile);
    604             } catch (ZipException ze) {
    605                 throw new IOException(ze);
     604            } catch (ZipException ex) {
     605                throw new IOException(ex);
    606606            }
    607607        } else {
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r11399 r11620  
    12271227                parser.parse(new InputSource(is));
    12281228            }
    1229         } catch (SAXReturnException r) {
    1230             Main.trace(r);
    1231             return r.getResult();
     1229        } catch (SAXReturnException e) {
     1230            Main.trace(e);
     1231            return e.getResult();
    12321232        } catch (IOException | SAXException | ParserConfigurationException e) {
    12331233            Main.warn("Parsing " + base + fn + " failed:\n" + e);
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r11329 r11620  
    4141                url = Utils.decodeUrl(url);
    4242            }
    43         } catch (IllegalArgumentException x) {
    44             Main.error(x);
     43        } catch (IllegalArgumentException ex) {
     44            Main.error(ex);
    4545        }
    4646        Bounds b = parseShortLink(url);
     
    8282                        z == null ? 18 : Integer.parseInt(z));
    8383            }
    84         } catch (NumberFormatException | NullPointerException | ArrayIndexOutOfBoundsException x) {
    85             Main.error(x);
     84        } catch (NumberFormatException | NullPointerException | ArrayIndexOutOfBoundsException ex) {
     85            Main.error(ex);
    8686        }
    8787        return b;
  • trunk/src/org/openstreetmap/josm/tools/date/DateUtils.java

    r11288 r11620  
    5050        try {
    5151            fact = DatatypeFactory.newInstance();
    52         } catch (DatatypeConfigurationException ce) {
    53             Main.error(ce);
     52        } catch (DatatypeConfigurationException e) {
     53            Main.error(e);
    5454        }
    5555        XML_DATE = fact;
    5656    }
    5757
     58    /**
     59     * Constructs a new {@code DateUtils}.
     60     */
    5861    protected DateUtils() {
    5962        // Hide default constructor for utils classes
  • trunk/tools/checkstyle/josm_checks.xml

    r11587 r11620  
    1616    <module name="BooleanExpressionComplexity">
    1717      <property name="max" value="6"/>
     18    </module>
     19    <module name="CatchParameterName">
     20      <property name="format" value="^(e[1-9]?|t|ex[1-9]?|[a-z][a-z][a-zA-Z]+)$"/>
    1821    </module>
    1922    <module name="FileContentsHolder"/>
Note: See TracChangeset for help on using the changeset viewer.