Ignore:
Timestamp:
2015-02-15T19:12:55+01:00 (10 years ago)
Author:
donvip
Message:

[josm_merge_overlap] fix #josm11092 - CCE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/hack/MyRelationMemberConflictResolverModel.java

    r30782 r30988  
    3030        return NUM_CONFLICTS_PROP;
    3131    }
    32    
     32
    3333    @Override
    3434    protected void populate(Relation relation, OsmPrimitive primitive) {
     
    3838    /**
    3939     * Populates the model with the members of the relation <code>relation</code>
    40      * referring to <code>primitive</code>.
     40     * referring to <code>way</code>.
    4141     *
    4242     * @param relation the parent relation
    43      * @param primitive the child primitive
     43     * @param way the child way
    4444     */
    45     protected void populate(Relation relation, OsmPrimitive primitive, Map<Way, Way> oldWays) {
     45    protected void populate(Relation relation, Way way, Map<Way, Way> oldWays) {
    4646        for (int i =0; i<relation.getMembersCount();i++) {
    47             if (MergeOverlapAction.getOld(relation.getMember(i).getWay(), oldWays) == MergeOverlapAction.getOld((Way)primitive, oldWays)) {
     47                RelationMember mb = relation.getMember(i);
     48            if (mb.isWay() && MergeOverlapAction.getOld(mb.getWay(), oldWays) == MergeOverlapAction.getOld(way, oldWays)) {
    4849                decisions.add(new RelationMemberConflictDecision(relation, i));
    4950            }
     
    6263     *
    6364     * @param relations  the parent relations. Empty list assumed if null.
    64      * @param memberPrimitives the child primitives. Empty list assumed if null.
     65     * @param memberWays the child ways. Empty list assumed if null.
    6566     */
    66     public void populate(Collection<Relation> relations, Collection<? extends OsmPrimitive> memberPrimitives, Map<Way, Way> oldWays) {
     67    public void populate(Collection<Relation> relations, Collection<Way> memberWays, Map<Way, Way> oldWays) {
    6768        decisions.clear();
    6869        relations = relations == null ? new LinkedList<Relation>() : relations;
    69         memberPrimitives = memberPrimitives == null ? new LinkedList<OsmPrimitive>() : memberPrimitives;
     70        memberWays = memberWays == null ? new LinkedList<Way>() : memberWays;
    7071        for (Relation r : relations) {
    71             for (OsmPrimitive p: memberPrimitives) {
    72                 populate(r, p, oldWays);
     72            for (Way w : memberWays) {
     73                populate(r, w, oldWays);
    7374            }
    7475        }
     
    9899                case KEEP:
    99100                    if (newPrimitive instanceof Way) {
    100                         modifiedRelation.addMember(new RelationMember(decision.getRole(), 
     101                        modifiedRelation.addMember(new RelationMember(decision.getRole(),
    101102                                MergeOverlapAction.getOld((Way)newPrimitive, oldWays)));
    102103                    } else {
Note: See TracChangeset for help on using the changeset viewer.