Changeset 2277 in josm for trunk/src


Ignore:
Timestamp:
2009-10-12T07:42:36+02:00 (15 years ago)
Author:
Gubaer
Message:

Fixed problem with synchronizing ways

File:
1 edited

Legend:

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

    r2273 r2277  
    2525import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2626import org.openstreetmap.josm.io.MultiFetchServerObjectReader;
     27import org.openstreetmap.josm.io.OsmServerObjectReader;
    2728import org.openstreetmap.josm.io.OsmTransferException;
    2829import org.openstreetmap.josm.tools.Shortcut;
     
    7980        OsmPrimitive primitive = getEditLayer().data.getPrimitiveById(id, type);
    8081        if (primitive == null)
    81             throw new IllegalStateException(tr("Didn't find a primitive with id {0} in the current dataset", id));
     82            throw new IllegalStateException(tr("Didn''t find an object with id {0} in the current dataset", id));
    8283        updatePrimitives(Collections.singleton(primitive));
    8384    }
     
    212213                MergeVisitor merger = new MergeVisitor(ds, theirDataSet);
    213214                merger.merge();
     215                // a ways loaded with MultiFetch may be incomplete because at least one of its
     216                // nodes isn't present in the local data set. We therefore fully load all
     217                // incomplete ways.
     218                //
     219                for (Way w: ds.ways) {
     220                    if (w.incomplete) {
     221                        OsmServerObjectReader reader = new OsmServerObjectReader(w.getId(), OsmPrimitiveType.WAY, true /* full */);
     222                        theirDataSet = reader.parseOsm(progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
     223                        merger = new MergeVisitor(ds, theirDataSet);
     224                        merger.merge();
     225                    }
     226                }
    214227            } catch(Exception e) {
    215228                if (canceled)
Note: See TracChangeset for help on using the changeset viewer.