Ignore:
Timestamp:
2017-12-17T01:25:46+01:00 (6 years ago)
Author:
Don-vip
Message:

enable PMD rule PreserveStackTrace + add missing jars to run new PMD rule designer

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/RenderingCLI.java

    r13204 r13207  
    231231                } catch (NumberFormatException nfe) {
    232232                    throw new IllegalArgumentException(
    233                             tr("Expected integer number for option {0}, but got ''{1}''", "--zoom", getopt.getOptarg()));
     233                            tr("Expected integer number for option {0}, but got ''{1}''", "--zoom", getopt.getOptarg()), nfe);
    234234                }
    235235                if (argZoom < 0)
     
    242242                        argBounds = new Bounds(getopt.getOptarg(), ",", Bounds.ParseMethod.LEFT_BOTTOM_RIGHT_TOP, false);
    243243                    } catch (IllegalArgumentException iae) { // NOPMD
    244                         throw new IllegalArgumentException(tr("Unable to parse {0} parameter: {1}", "--bounds", iae.getMessage()));
     244                        throw new IllegalArgumentException(tr("Unable to parse {0} parameter: {1}", "--bounds", iae.getMessage()), iae);
    245245                    }
    246246                }
     
    268268                    } catch (NumberFormatException nfe) {
    269269                        throw new IllegalArgumentException(
    270                                 tr("Expected floating point number for option {0}, but got ''{1}''", "--scale", getopt.getOptarg()));
     270                                tr("Expected floating point number for option {0}, but got ''{1}''", "--scale", getopt.getOptarg()), nfe);
    271271                    }
    272272                    break;
     
    282282                        argAnchor = new LatLon(lat, lon);
    283283                    } catch (IllegalArgumentException iae) { // NOPMD
    284                         throw new IllegalArgumentException(tr("In option {0}: {1}", "--anchor", iae.getMessage()));
     284                        throw new IllegalArgumentException(tr("In option {0}: {1}", "--anchor", iae.getMessage()), iae);
    285285                    }
    286286                    break;
     
    290290                    } catch (NumberFormatException nfe) {
    291291                        throw new IllegalArgumentException(
    292                                 tr("Expected floating point number for option {0}, but got ''{1}''", "--width-m", getopt.getOptarg()));
     292                                tr("Expected floating point number for option {0}, but got ''{1}''", "--width-m", getopt.getOptarg()), nfe);
    293293                    }
    294294                    if (argWidthM <= 0) throw new IllegalArgumentException(
     
    300300                    } catch (NumberFormatException nfe) {
    301301                        throw new IllegalArgumentException(
    302                                 tr("Expected floating point number for option {0}, but got ''{1}''", "--height-m", getopt.getOptarg()));
     302                                tr("Expected floating point number for option {0}, but got ''{1}''", "--height-m", getopt.getOptarg()), nfe);
    303303                    }
    304304                    if (argHeightM <= 0) throw new IllegalArgumentException(
     
    310310                    } catch (NumberFormatException nfe) {
    311311                        throw new IllegalArgumentException(
    312                                 tr("Expected integer number for option {0}, but got ''{1}''", "--width-px", getopt.getOptarg()));
     312                                tr("Expected integer number for option {0}, but got ''{1}''", "--width-px", getopt.getOptarg()), nfe);
    313313                    }
    314314                    if (argWidthPx <= 0) throw new IllegalArgumentException(
     
    320320                    } catch (NumberFormatException nfe) {
    321321                        throw new IllegalArgumentException(
    322                                 tr("Expected integer number for option {0}, but got ''{1}''", "--height-px", getopt.getOptarg()));
     322                                tr("Expected integer number for option {0}, but got ''{1}''", "--height-px", getopt.getOptarg()), nfe);
    323323                    }
    324324                    if (argHeightPx <= 0) throw new IllegalArgumentException(
     
    333333                    } catch (NumberFormatException nfe) {
    334334                        throw new IllegalArgumentException(
    335                                 tr("Expected integer number for option {0}, but got ''{1}''", "--max-image-size", getopt.getOptarg()));
     335                                tr("Expected integer number for option {0}, but got ''{1}''", "--max-image-size", getopt.getOptarg()), nfe);
    336336                    }
    337337                    if (argMaxImageSize < 0) throw new IllegalArgumentException(
     
    551551            return OsmReader.parseDataSet(Files.newInputStream(Paths.get(argInput)), null);
    552552        } catch (IllegalDataException e) {
    553             throw new IllegalDataException(tr("In .osm data file ''{0}'' - ", argInput) + e.getMessage());
     553            throw new IllegalDataException(tr("In .osm data file ''{0}'' - ", argInput) + e.getMessage(), e);
    554554        }
    555555    }
  • trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java

    r12620 r13207  
    328328                throw new OsmOAuthAuthorizationException(tr("Failed to authenticate user ''{0}'' with password ''***'' as OAuth user",
    329329                        userName));
    330         } catch (OsmOAuthAuthorizationException e) {
    331             Logging.debug(e);
    332             throw new OsmLoginFailedException(e.getCause());
    333         } catch (IOException e) {
     330        } catch (OsmOAuthAuthorizationException | IOException e) {
    334331            throw new OsmLoginFailedException(e);
    335332        } finally {
Note: See TracChangeset for help on using the changeset viewer.