Ignore:
Timestamp:
2015-05-17T15:52:24+02:00 (9 years ago)
Author:
Don-vip
Message:

squid:S1244 - Floating point numbers should not be tested for equality

Location:
trunk/src/org/openstreetmap/josm/gui/layer/gpx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/DateFilterPanel.java

    r8378 r8384  
    4848        final Date startTime, endTime;
    4949        Date[] bounds = layer.data.getMinMaxTimeForAllTracks();
    50         startTime = (bounds==null) ? new GregorianCalendar(2000, 1, 1).getTime():bounds[0];
    51         endTime = (bounds==null) ? new Date() : bounds[1];
     50        startTime = (bounds.length == 0) ? new GregorianCalendar(2000, 1, 1).getTime():bounds[0];
     51        endTime = (bounds.length == 0) ? new Date() : bounds[1];
    5252
    5353        dateFrom.setDate(startTime);
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r8378 r8384  
    280280        if (colored == ColorMode.TIME) {
    281281            Date[] bounds = data.getMinMaxTimeForAllTracks();
    282             if (bounds!=null) {
     282            if (bounds.length >= 2) {
    283283                minval = bounds[0].getTime()/1000.0;
    284284                maxval = bounds[1].getTime()/1000.0;
    285285            } else {
    286                 minval = 0; maxval=now;
     286                minval = 0;
     287                maxval = now;
    287288            }
    288289            dateScale.setRange(minval, maxval);
     
    457458                    g.setColor(customColoringTransparent);
    458459                    // hdop cirles
    459                     int hdopp = mv.getPoint(new LatLon(trkPnt.getCoor().lat(), trkPnt.getCoor().lon() + 2*6*hdop*360/40000000)).x - screen.x;
     460                    int hdopp = mv.getPoint(new LatLon(
     461                            trkPnt.getCoor().lat(),
     462                            trkPnt.getCoor().lon() + 2*6*hdop*360/40000000d)).x - screen.x;
    460463                    g.drawArc(screen.x-hdopp/2, screen.y-hdopp/2, hdopp, hdopp, 0, 360);
    461464                }
Note: See TracChangeset for help on using the changeset viewer.