Changeset 3965 in josm


Ignore:
Timestamp:
2011-03-09T00:03:07+01:00 (8 years ago)
Author:
mjulius
Message:

fix #6074 - Update failure
It is not an error if a primitive on the server is invisible while the local copy is not if the latter one is modified.
Catch DataIntegrityProblemException when merging.

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r3719 r3965  
    309309            // take. We take target.
    310310            //
    311         } else if (target.isVisible() != source.isVisible() && target.getVersion() == source.getVersion())
    312             // Same version, but different "visible" attribute. It indicates a serious problem in datasets.
     311        } else if (!target.isModified() && !source.isModified() && target.isVisible() != source.isVisible() && target.getVersion() == source.getVersion())
     312            // Same version, but different "visible" attribute and neither of them are modified.
     313            // It indicates a serious problem in datasets.
    313314            // For example, datasets can be fetched from different OSM servers or badly hand-modified.
    314315            // We shouldn't merge that datasets.
  • trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    r3801 r3965  
    4747import org.openstreetmap.josm.data.gpx.ImmutableGpxTrack;
    4848import org.openstreetmap.josm.data.gpx.WayPoint;
     49import org.openstreetmap.josm.data.osm.DataIntegrityProblemException;
    4950import org.openstreetmap.josm.data.osm.DataSet;
    5051import org.openstreetmap.josm.data.osm.DataSetMerger;
     
    6566import org.openstreetmap.josm.data.validation.TestError;
    6667import org.openstreetmap.josm.gui.HelpAwareOptionPane;
     68import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    6769import org.openstreetmap.josm.gui.MapView;
    68 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
    6970import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
    7071import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
     
    299300    public void mergeFrom(final DataSet from) {
    300301        final DataSetMerger visitor = new DataSetMerger(data,from);
    301         visitor.merge();
     302        try {
     303            visitor.merge();
     304        } catch (DataIntegrityProblemException e) {
     305            JOptionPane.showMessageDialog(
     306                    Main.parent,
     307                    e.getMessage(),
     308                    tr("Error"),
     309                    JOptionPane.ERROR_MESSAGE
     310            );
     311            return;
     312
     313        }
    302314
    303315        Area a = data.getDataSourceArea();
Note: See TracChangeset for help on using the changeset viewer.