Ignore:
Timestamp:
2016-05-11T04:44:00+02:00 (8 years ago)
Author:
Don-vip
Message:

sonar - squid:S2184 - Math operands should be cast before assignment

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

Legend:

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

    r10131 r10181  
    287287        case "download":
    288288
    289             if (lastZoomTime > 0 && System.currentTimeMillis() - lastZoomTime > Main.pref.getLong("zoom.bounds.reset.time", 10*1000)) {
     289            if (lastZoomTime > 0 && System.currentTimeMillis() - lastZoomTime > Main.pref.getLong("zoom.bounds.reset.time", 10L*1000L)) {
    290290                lastZoomTime = -1;
    291291            }
  • trunk/src/org/openstreetmap/josm/actions/JumpToAction.java

    r9062 r10181  
    187187
    188188            // 10 000 000 = 10 000 * 1000 = World * (km -> m)
    189             zm.setText(Double.toString(Math.round(10000000 * Math.pow(2, (-1) * zoomLvl))));
     189            zm.setText(Double.toString(Math.round(10000000d * Math.pow(2d, (-1d) * zoomLvl))));
    190190        }
    191191    }
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r9970 r10181  
    562562    private static void execCommands(List<Command> cmds, List<Node> newNodes) {
    563563        Main.main.undoRedo.add(new SequenceCommand(/* for correct i18n of plural forms - see #9110 */
    564                 trn("Dupe into {0} node", "Dupe into {0} nodes", newNodes.size() + 1, newNodes.size() + 1), cmds));
     564                trn("Dupe into {0} node", "Dupe into {0} nodes", newNodes.size() + 1L, newNodes.size() + 1L), cmds));
    565565        // select one of the new nodes
    566566        getCurrentDataSet().setSelected(newNodes.get(0));
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r10179 r10181  
    11421142        Point p2 = mv.getPoint(currentMouseEastNorth);
    11431143
    1144         double t = Math.atan2(p2.y-p1.y, p2.x-p1.x) + Math.PI;
     1144        double t = Math.atan2((double) p2.y - p1.y, (double) p2.x - p1.x) + Math.PI;
    11451145
    11461146        b.moveTo(p1.x, p1.y);
     
    14831483                if (absoluteFix) {
    14841484                    b.moveTo(p2.x, p2.y);
    1485                     b.lineTo(2*p1.x-p2.x, 2*p1.y-p2.y); // bi-directional line
     1485                    b.lineTo(2f*p1.x-p2.x, 2f*p1.y-p2.y); // bi-directional line
    14861486                } else {
    14871487                    b.moveTo(p2.x, p2.y);
Note: See TracChangeset for help on using the changeset viewer.