Changeset 18243 in josm for trunk/src/org


Ignore:
Timestamp:
2021-10-03T13:24:18+02:00 (3 years ago)
Author:
Don-vip
Message:

see #21144 - see #21334 - add debug logs + fix coverity 1464077 (Logically dead code: nextWp cannot be null with the isLast branch, but Eclipse doesn't see it)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java

    r18237 r18243  
    150150            ret += matchPoints(images, prevWp, prevWpTime, prevWp, prevWpTime, offset, false, trkTagTime, null, dirpos);
    151151        }
     152        Logging.debug("Correlated {0} total points", ret);
    152153        return ret;
    153154    }
     
    211212            long offset, boolean interpolate, int tagTime, WayPoint nextWp, GpxImageDirectionPositionSettings dirpos) {
    212213
    213         int ret = 0;
    214214        final boolean isLast = nextWp == null;
    215215
     
    222222        }
    223223
     224        if (Logging.isDebugEnabled()) {
     225            Logging.debug("Correlating images for i={1} - curWp={2}/{3} - prevWp={4}/{5} - nextWp={6} - tagTime={7} - interpolate={8}",
     226                    i, curWp, curWpTime, prevWp, prevWpTime, nextWp, tagTime, interpolate);
     227        }
     228
    224229        // no photos match
    225         if (i < 0)
     230        if (i < 0) {
     231            Logging.debug("Correlated nothing, no photos match");
    226232            return 0;
    227 
     233        }
     234
     235        int ret = 0;
    228236        Double speed = null;
    229237        Double prevElevation = null;
     
    273281            // This code gives a simple linear interpolation of the coordinates between current and
    274282            // previous track point assuming a constant speed in between
    275             LatLon nextCoorForDirection = nextWp != null ? nextWp.getCoor() : null;
     283            @SuppressWarnings("null")
     284            LatLon nextCoorForDirection = nextWp.getCoor();
    276285            while (i >= 0) {
    277286                final GpxImageEntry curImg = images.get(i);
     
    318327            }
    319328        }
     329        Logging.debug("Correlated {0} image(s)", ret);
    320330        return ret;
    321331    }
Note: See TracChangeset for help on using the changeset viewer.