Changeset 8364 in josm for trunk


Ignore:
Timestamp:
2015-05-16T14:21:27+02:00 (4 years ago)
Author:
Don-vip
Message:

fix Findbugs violation - ICAST: Integral division result cast to double

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r8348 r8364  
    883883        if (useWiderHighlight) s+=widerHighlight;
    884884        while(s >= size) {
    885             int r = (int) Math.floor(s/2);
     885            int r = (int) Math.floor(s/2d);
    886886            g.fillRoundRect(p.x-r, p.y-r, s, s, r, r);
    887887            s -= highlightStep;
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r8345 r8364  
    370370        if (null == p)
    371371            return new Point();
    372         double x = (p.east()-center.east())/scale + getWidth()/2;
    373         double y = (center.north()-p.north())/scale + getHeight()/2;
     372        double x = (p.east()-center.east())/scale + getWidth()/2d;
     373        double y = (center.north()-p.north())/scale + getHeight()/2d;
    374374        return new Point2D.Double(x, y);
    375375    }
  • trunk/src/org/openstreetmap/josm/tools/ExifReader.java

    r8244 r8364  
    207207        case 8:
    208208            q = -1;
    209             ax = width / 2;
    210             ay = width / 2;
     209            ax = width / 2d;
     210            ay = width / 2d;
    211211            break;
    212212        case 3:
    213213            q = 2;
    214             ax = width / 2;
    215             ay = height / 2;
     214            ax = width / 2d;
     215            ay = height / 2d;
    216216            break;
    217217        case 6:
    218218            q = 1;
    219             ax = height / 2;
    220             ay = height / 2;
     219            ax = height / 2d;
     220            ay = height / 2d;
    221221            break;
    222222        default:
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r8345 r8364  
    291291    public static String getURL(double dlat, double dlon, int zoom) {
    292292        // Truncate lat and lon to something more sensible
    293         int decimals = (int) Math.pow(10, zoom / 3);
     293        int decimals = (int) Math.pow(10, zoom / 3d);
    294294        double lat = Math.round(dlat * decimals);
    295295        lat /= decimals;
Note: See TracChangeset for help on using the changeset viewer.