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


Ignore:
Timestamp:
2016-02-25T00:50:30+01:00 (8 years ago)
Author:
Don-vip
Message:

findbugs

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

Legend:

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

    r9067 r9880  
    202202            double distanceFirst = firstPosition.distance(refPoint);
    203203            double distanceSecond = secondPosition.distance(refPoint);
    204             double difference =  distanceFirst - distanceSecond;
    205 
    206             if (difference > 0.0) return 1;
    207             if (difference < 0.0) return -1;
    208             return 0;
     204            return Double.compare(distanceFirst, distanceSecond);
    209205        }
    210206    }
  • trunk/src/org/openstreetmap/josm/data/osm/NodePositionComparator.java

    r8393 r9880  
    2020            return 0;
    2121
    22         double dLat = n1.getCoor().lat() - n2.getCoor().lat();
    23         if (dLat > 0)
    24             return 1;
    25         if (dLat < 0)
    26             return -1;
    27         double dLon = n1.getCoor().lon() - n2.getCoor().lon();
    28         if (dLon == 0)
    29             return 0;
    30         return dLon > 0 ? 1 : -1;
     22        int dLat = Double.compare(n1.getCoor().lat(), n2.getCoor().lat());
     23        return dLat != 0 ? dLat : Double.compare(n1.getCoor().lon(), n2.getCoor().lon());
    3124    }
    3225}
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r9850 r9880  
    14781478
    14791479        Pair<Timezone, Offset> splitOutTimezone() {
    1480             // In hours, rounded to two decimal places
    1481             double tz = (withoutDayOffset().getSeconds() * 100L / 3600.0) / 100.0;
     1480            // In hours
     1481            double tz = withoutDayOffset().getSeconds() / 3600.0;
    14821482
    14831483            // Due to imprecise clocks we might get a "+3:28" timezone, which should obviously be 3:30 with
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityAction.java

    r9804 r9880  
    100100        @Override
    101101        public int compare(TrackLength l0, TrackLength l1) {
    102             if (l0.value < l1.value)
    103                 return -1;
    104             else if (l0.value > l1.value)
    105                 return 1;
    106             return 0;
     102            return Double.compare(l0.value, l1.value);
    107103        }
    108104    }
Note: See TracChangeset for help on using the changeset viewer.