Changeset 8127 in josm for trunk


Ignore:
Timestamp:
2015-03-08T23:58:53+01:00 (10 years ago)
Author:
Don-vip
Message:

fix Sonar issue squid:S2111 - "BigDecimal(double)" should not be used

File:
1 edited

Legend:

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

    r7864 r8127  
    763763
    764764            if (n0 != null && n1 != null && n0.isValid() && n1.isValid()) {
    765                 BigDecimal x0 = new BigDecimal(n0.east());
    766                 BigDecimal y0 = new BigDecimal(n0.north());
    767                 BigDecimal x1 = new BigDecimal(n1.east());
    768                 BigDecimal y1 = new BigDecimal(n1.north());
     765                BigDecimal x0 = BigDecimal.valueOf(n0.east());
     766                BigDecimal y0 = BigDecimal.valueOf(n0.north());
     767                BigDecimal x1 = BigDecimal.valueOf(n1.east());
     768                BigDecimal y1 = BigDecimal.valueOf(n1.north());
    769769
    770770                BigDecimal k = x0.multiply(y1, MathContext.DECIMAL128).subtract(y0.multiply(x1, MathContext.DECIMAL128));
Note: See TracChangeset for help on using the changeset viewer.