Changeset 11378 in josm for trunk/src/org


Ignore:
Timestamp:
2016-12-10T15:30:49+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S1226 - Method parameters, caught exceptions and foreach variables should not be reassigned

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r11361 r11378  
    507507     * Builds a path from a list of nodes
    508508     * @param polygon Nodes, forming a closed polygon
    509      * @param path path to add to; can be null, then a new path is created
     509     * @param path2d path to add to; can be null, then a new path is created
    510510     * @return the path (LatLon coordinates)
    511511     */
    512     public static Path2D buildPath2DLatLon(List<Node> polygon, Path2D path) {
    513         if (path == null) {
    514             path = new Path2D.Double();
    515         }
     512    public static Path2D buildPath2DLatLon(List<Node> polygon, Path2D path2d) {
     513        Path2D path = path2d != null ? path2d : new Path2D.Double();
    516514        boolean begin = true;
    517515        for (Node n : polygon) {
Note: See TracChangeset for help on using the changeset viewer.