Changeset 6230 in josm for trunk/src/org/openstreetmap


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

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

Legend:

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

    r6130 r6230  
    3838public final class AlignInCircleAction extends JosmAction {
    3939
     40    /**
     41     * Constructs a new {@code AlignInCircleAction}.
     42     */
    4043    public AlignInCircleAction() {
    4144        super(tr("Align Nodes in Circle"), "aligncircle", tr("Move the selected nodes into a circle."),
     
    151154            // First calculate the average point
    152155
    153             BigDecimal east = new BigDecimal(0);
    154             BigDecimal north = new BigDecimal(0);
     156            BigDecimal east = BigDecimal.ZERO;
     157            BigDecimal north = BigDecimal.ZERO;
    155158
    156159            for (Node n : nodes) {
  • 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.