Changeset 15350 in josm for trunk


Ignore:
Timestamp:
2019-09-14T17:03:53+02:00 (5 years ago)
Author:
Don-vip
Message:

see #18116 - findbugs - RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

File:
1 edited

Legend:

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

    r15349 r15350  
    2121
    2222import org.openstreetmap.josm.actions.downloadtasks.DownloadTaskList;
    23 import org.openstreetmap.josm.data.Bounds;
    2423import org.openstreetmap.josm.data.coor.LatLon;
    2524import org.openstreetmap.josm.data.osm.DataSet;
     
    9190            DataSet ds = MainApplication.getLayerManager().getEditDataSet();
    9291            if (ds != null) {
    93                 Collection<Bounds> existing = ds.getDataSourceBounds();
    94                 if (existing != null) {
    95                     double p = LatLon.MAX_SERVER_PRECISION;
    96                     LatLon min = new LatLon(bounds.getY()+p, bounds.getX()+p);
    97                     LatLon max = new LatLon(bounds.getY()+bounds.getHeight()-p, bounds.getX()+bounds.getWidth()-p);
    98                     if (existing.stream().anyMatch(current -> (current.contains(min) && current.contains(max)))) {
    99                         return; // skip this one, already downloaded
    100                     }
     92                double p = LatLon.MAX_SERVER_PRECISION;
     93                LatLon min = new LatLon(bounds.getY()+p, bounds.getX()+p);
     94                LatLon max = new LatLon(bounds.getY()+bounds.getHeight()-p, bounds.getX()+bounds.getWidth()-p);
     95                if (ds.getDataSourceBounds().stream().anyMatch(current -> (current.contains(min) && current.contains(max)))) {
     96                    return; // skip this one, already downloaded
    10197                }
    10298            }
Note: See TracChangeset for help on using the changeset viewer.