Changeset 29561 in osm for applications


Ignore:
Timestamp:
2013-05-06T03:28:50+02:00 (11 years ago)
Author:
donvip
Message:

[josm_reverter] fix #josm8660 - False positive conflict detection with nodes

File:
1 edited

Legend:

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

    r29559 r29561  
    282282    }
    283283
    284     private static boolean hasEqualSemanticAttributes(OsmPrimitive current,HistoryOsmPrimitive history) {
     284    private boolean hasEqualSemanticAttributes(OsmPrimitive current,HistoryOsmPrimitive history) {
    285285        if (!current.getKeys().equals(history.getTags())) return false;
    286286        switch (current.getType()) {
     
    288288            LatLon currentCoor = ((Node)current).getCoor();
    289289            LatLon historyCoor = ((HistoryNode)history).getCoords();
    290             return currentCoor == historyCoor || (currentCoor != null && historyCoor != null && currentCoor.equals(historyCoor));
     290            if (currentCoor == historyCoor || (currentCoor != null && historyCoor != null && currentCoor.equals(historyCoor)))
     291                return true;
     292            // Handle case where a deleted note has been restored to avoid false conflicts (fix #josm8660)
     293            if (currentCoor != null && historyCoor == null) {
     294                LatLon previousCoor = ((Node)nds.getPrimitiveById(history.getPrimitiveId())).getCoor();
     295                return previousCoor != null && previousCoor.equals(currentCoor);
     296            }
     297            return false;
    291298        case CLOSEDWAY:
    292299        case WAY:
Note: See TracChangeset for help on using the changeset viewer.