Changeset 34922 in osm for applications/editors/josm


Ignore:
Timestamp:
2019-03-20T16:13:04+01:00 (6 years ago)
Author:
gerdp
Message:

fix #17312: problem reverting changeset 67039034
First merge those relations which don't refer to other relations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java

    r34917 r34922  
    9797     *
    9898     */
    99     private void mergeWay(Way source) throws IllegalStateException {
     99    private void mergeWay(Way source) {
    100100        if (source.isIncomplete()) return;
    101101        if (!source.isVisible()) return;
     
    143143     * members in source
    144144     */
    145     private void mergeRelation(Relation source) throws IllegalStateException {
     145    private void mergeRelation(Relation source) {
    146146        if (source.isIncomplete()) return;
    147147        if (!source.isVisible()) return;
     
    178178            mergeWay(way);
    179179        }
     180        // first handle those relations which don't refer to other relations
    180181        for (Relation relation: sourceDataSet.getRelations()) {
    181             mergeRelation(relation);
     182            if (relation.getMemberPrimitives(Relation.class).isEmpty()) {
     183                mergeRelation(relation);
     184            }
     185        }
     186        // now the rest of the relations.
     187        for (Relation relation: sourceDataSet.getRelations()) {
     188            if (!relation.getMemberPrimitives(Relation.class).isEmpty()) {
     189                mergeRelation(relation);
     190            }
    182191        }
    183192    }
Note: See TracChangeset for help on using the changeset viewer.