Changeset 2444 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2009-11-13T11:34:34+01:00 (15 years ago)
Author:
Gubaer
Message:

fixed #3908: Exception when updating a way
fixed a few I18n issues

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

Legend:

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

    r2433 r2444  
    22package org.openstreetmap.josm.actions;
    33
     4import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    45import static org.openstreetmap.josm.tools.I18n.tr;
    5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    66
    77import java.awt.event.ActionEvent;
     
    6767
    6868    /**
    69      * Updates the data for for the {@see OsmPrimitive}s with id <code>id</code>
     69     * Updates the data for the {@see OsmPrimitive}s with id <code>id</code>
    7070     * with the data currently kept on the server.
    7171     *
    72      * @param id  the id of a primitive in the {@see DataSet} of the current edit layser
     72     * @param id  the id of a primitive in the {@see DataSet} of the current edit layer
    7373     * @exception IllegalStateException thrown if there is no primitive with <code>id</code> in
    7474     *   the current dataset
     
    8989     */
    9090    public UpdateSelectionAction() {
    91         super(tr("Update selections"),
     91        super(tr("Update selection"),
    9292                "updateselection",
    9393                tr("Updates the currently selected objects from the server (re-downloads data)"),
     
    124124            JOptionPane.showMessageDialog(
    125125                    Main.parent,
    126                     tr("There are no selected primitives to update."),
     126                    tr("There are no selected objects to update."),
    127127                    tr("Selection empty"),
    128128                    JOptionPane.INFORMATION_MESSAGE
     
    145145
    146146        public UpdatePrimitivesTask(Collection<? extends OsmPrimitive> toUpdate) {
    147             super("Update primitives", false /* don't ignore exception*/);
     147            super(tr("Update objects"), false /* don't ignore exception*/);
    148148            canceled = false;
    149149            this.toUpdate = toUpdate;
     
    168168            if (ds != null) {
    169169                Main.map.mapView.getEditLayer().mergeFrom(ds);
     170                Main.map.mapView.getEditLayer().onPostDownloadFromServer();
    170171            }
    171172        }
     
    215216                DataSetMerger merger = new DataSetMerger(ds, theirDataSet);
    216217                merger.merge();
    217                 // a ways loaded with MultiFetch may be incomplete because at least one of its
     218                // a way loaded with MultiFetch may be incomplete because at least one of its
    218219                // nodes isn't present in the local data set. We therefore fully load all
    219220                // incomplete ways.
  • trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java

    r2443 r2444  
    135135    }
    136136
    137     protected OsmPrimitive getMergeTarget(OsmPrimitive mergeSource) {
     137    protected OsmPrimitive getMergeTarget(OsmPrimitive mergeSource) throws IllegalStateException{
    138138        Long targetId = mergedMap.get(mergeSource.getUniqueId());
    139139        if (targetId == null)
    140             throw new RuntimeException(tr("Missing merge target for way with id {0}", mergeSource.getUniqueId()));
     140            return null;
    141141        return targetDataSet.getPrimitiveById(targetId, mergeSource.getType());
    142142    }
     
    306306            childrenToMerge.add(source.getUniqueId());
    307307        } else if (target.isModified() && ! source.isModified() && target.getVersion() == source.getVersion()) {
    308             // my is same as other but mine is modified
    309             // => keep mine
     308            // target is same as source but target is modified
     309            // => keep target
    310310        } else if (! target.hasEqualSemanticAttributes(source)) {
    311             // my is modified and is not semantically equal with other. Can't automatically
     311            // target is modified and is not semantically equal with source. Can't automatically
    312312            // resolve the differences
    313313            // =>  create a conflict
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r2410 r2444  
    2323import org.openstreetmap.josm.data.osm.Node;
    2424import org.openstreetmap.josm.data.osm.OsmPrimitive;
     25import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    2526import org.openstreetmap.josm.data.osm.Relation;
    2627import org.openstreetmap.josm.data.osm.RelationMember;
     
    428429                                )
    429430                        );
    430                     n = new Node(id);
    431                     n.incomplete = true;
     431                    // create an incomplete node if necessary
     432                    //
     433                    n = (Node)ds.getPrimitiveById(id,OsmPrimitiveType.NODE);
     434                    if (n == null) {
     435                        n = new Node(id);
     436                        n.incomplete = true;
     437                        ds.addPrimitive(n);
     438                    }
    432439                    incomplete = true;
    433440                }
Note: See TracChangeset for help on using the changeset viewer.