Ignore:
Timestamp:
2013-09-11T00:41:49+02:00 (11 years ago)
Author:
Don-vip
Message:

Sonar - Don't create instances of already existing BigInteger ZERO

File:
1 edited

Legend:

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

    r6113 r6230  
    654654    }
    655655
     656    /**
     657     * Compute the centroid of nodes
     658     * @param nodes Nodes for which the centroid is wanted
     659     * @return the centroid of nodes
     660     */
    656661    public static EastNorth getCentroid(List<Node> nodes) {
    657         // Compute the centroid of nodes
    658 
    659         BigDecimal area = new BigDecimal(0);
    660         BigDecimal north = new BigDecimal(0);
    661         BigDecimal east = new BigDecimal(0);
     662
     663        BigDecimal area = BigDecimal.ZERO;
     664        BigDecimal north = BigDecimal.ZERO;
     665        BigDecimal east = BigDecimal.ZERO;
    662666
    663667        // See http://en.wikipedia.org/w/index.php?title=Centroid&oldid=294224857#Centroid_of_polygon for the equation used here
Note: See TracChangeset for help on using the changeset viewer.