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

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

Location:
trunk/src/org/openstreetmap/josm/io
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/NmeaReader.java

    r8378 r8384  
    270270                }
    271271
    272                 if ((latLon.lat()==0.0) && (latLon.lon()==0.0)) {
     272                if (LatLon.ZERO.equals(latLon)) {
    273273                    ps.zeroCoord++;
    274274                    return false;
     
    384384                        e[GPRMC.LENGTH_EAST.position]
    385385                );
    386                 if(latLon.lat()==0.0 && latLon.lon()==0.0) {
     386                if (LatLon.ZERO.equals(latLon)) {
    387387                    ps.zeroCoord++;
    388388                    return false;
  • trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java

    r8375 r8384  
    6565            elapsed = 1;
    6666        }
    67         float uploads_per_ms = (float)progress / elapsed;
    68         float uploads_left = list_size - progress;
    69         int ms_left = (int)(uploads_left / uploads_per_ms);
    70         int minutes_left = ms_left / MSECS_PER_MINUTE;
    71         int seconds_left = (ms_left / MSECS_PER_SECOND) % SECONDS_PER_MINUTE ;
    72         String time_left_str = Integer.toString(minutes_left) + ":";
     67        double uploads_per_ms = (double)progress / elapsed;
     68        double uploads_left = list_size - progress;
     69        long ms_left = (long)(uploads_left / uploads_per_ms);
     70        long minutes_left = ms_left / MSECS_PER_MINUTE;
     71        long seconds_left = (ms_left / MSECS_PER_SECOND) % SECONDS_PER_MINUTE ;
     72        String time_left_str = Long.toString(minutes_left) + ":";
    7373        if (seconds_left < 10) {
    7474            time_left_str += "0";
    7575        }
    76         return time_left_str + Integer.toString(seconds_left);
     76        return time_left_str + Long.toString(seconds_left);
    7777    }
    7878
  • trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java

    r7089 r8384  
    204204            el.setAttribute("name", layer.getName());
    205205            el.setAttribute("visible", Boolean.toString(layer.isVisible()));
    206             if (layer.getOpacity() != 1.0) {
     206            if (!Utils.equalsEpsilon(layer.getOpacity(), 1.0)) {
    207207                el.setAttribute("opacity", Double.toString(layer.getOpacity()));
    208208            }
Note: See TracChangeset for help on using the changeset viewer.