Changeset 17340 in josm for trunk


Ignore:
Timestamp:
2020-11-23T20:29:07+01:00 (4 years ago)
Author:
GerdP
Message:

fix #19792: Error during conflict resolution after complex import operation

  • ConflictResolver: initialize resolvedCompletely in populate()
  • fix typo in PropertiesMerger
  • create copies of lists in buildResolveCommand() implementations
  • revert r17273 (not needed)
Location:
trunk/src/org/openstreetmap/josm/gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java

    r13613 r17340  
    135135     */
    136136    public ConflictResolver() {
    137         resolvedCompletely = false;
    138137        build();
    139138        loadIcons();
     
    240239        setTheir(conflict.getTheir());
    241240        this.conflict = conflict;
     241        this.resolvedCompletely = false;
    242242        propertiesMerger.populate(conflict);
    243243
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModel.java

    r17333 r17340  
    5757        if (!isFrozen())
    5858            throw new IllegalArgumentException(tr("Merged nodes not frozen yet. Cannot build resolution command."));
    59         return new WayNodesConflictResolverCommand(conflict, getMergedEntries());
     59        return new WayNodesConflictResolverCommand(conflict, new ArrayList<>(getMergedEntries()));
    6060    }
    6161
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java

    r16438 r17340  
    464464    @Override
    465465    public void decideRemaining(MergeDecisionType decision) {
    466         if (!model.isDecidedCoord()) {
     466        if (!model.isDecidedDeletedState()) {
    467467            model.decideDeletedStateConflict(decision);
    468468        }
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java

    r11330 r17340  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.util.ArrayList;
    67import java.util.Map;
    78
     
    102103        if (!isFrozen())
    103104            throw new IllegalArgumentException(tr("Merged members not frozen yet. Cannot build resolution command"));
    104         return new RelationMemberConflictResolverCommand(conflict, getMergedEntries());
     105        return new RelationMemberConflictResolverCommand(conflict, new ArrayList<>(getMergedEntries()));
    105106    }
    106107}
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModel.java

    r16438 r17340  
    185185
    186186    public TagConflictResolveCommand buildResolveCommand(Conflict<? extends OsmPrimitive> conflict) {
    187         return new TagConflictResolveCommand(conflict, tagMergeItems);
     187        return new TagConflictResolveCommand(conflict, new ArrayList<>(tagMergeItems));
    188188    }
    189189
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r17273 r17340  
    518518                        resolver.populate(c);
    519519                        resolver.decideRemaining(type);
    520                         Command cmd = resolver.buildResolveCommand();
    521                         cmd.executeCommand(); // execute now, see #6529
    522                         commands.add(cmd);
     520                        commands.add(resolver.buildResolveCommand());
    523521                    }
    524522                }
    525523            }
    526             UndoRedoHandler.getInstance().add(new ResolveConflictsCommand(name, commands), false);
     524            UndoRedoHandler.getInstance().add(new SequenceCommand(name, commands));
    527525            refreshView();
    528         }
    529     }
    530 
    531     private static class ResolveConflictsCommand extends SequenceCommand {
    532         // just  a wrapper for already executed commands
    533         ResolveConflictsCommand(String name, Collection<Command> sequenz) {
    534             super(name, sequenz, true);
    535             setSequenceComplete(true);
    536526        }
    537527    }
Note: See TracChangeset for help on using the changeset viewer.