Ignore:
Timestamp:
2022-06-14T20:11:21+02:00 (3 years ago)
Author:
taylor.smock
Message:

see #22104: Remove usages of Node#getCoor where possible

This also accounts for cases where Node has the methods used later,
so a new LatLon is unnecessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysAction.java

    r35583 r35976  
    1616import org.openstreetmap.josm.command.SequenceCommand;
    1717import org.openstreetmap.josm.data.UndoRedoHandler;
     18import org.openstreetmap.josm.data.coor.ILatLon;
    1819import org.openstreetmap.josm.data.coor.LatLon;
    1920import org.openstreetmap.josm.data.osm.DataSet;
     
    8586        int c1=0,c2;
    8687        double latDif,lonDif;
    87         LatLon llc = nodeCommon.getCoor();
     88        ILatLon llc = nodeCommon;
    8889        for (Node n1 : nodesWay1) {
    89             LatLon ll1 = n1.getCoor();
    90             if (ll1 == null || llc == null) {
     90            ILatLon ll1 = n1;
     91            if (!ll1.isLatLonKnown() || !llc.isLatLonKnown()) {
    9192                Logging.warn("Null coordinates: {0} / {1}", n1, nodeCommon);
    9293                continue;
     
    106107                    continue;
    107108                }
    108                 LatLon ll2 = n2.getCoor();
     109                ILatLon ll2 = n2;
    109110                Node nodeOfGrid = new Node(new LatLon(ll2.lat()+latDif, ll2.lon()+lonDif));
    110111                cmds.add(new AddCommand(ds, nodeOfGrid));
Note: See TracChangeset for help on using the changeset viewer.