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


Ignore:
Timestamp:
2011-08-08T00:00:54+02:00 (13 years ago)
Author:
stoecker
Message:

fix #6357 - patch by simon04 - validator: false error warning - duplicated relations

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java

    r4234 r4290  
    176176    public void visit(Relation r)
    177177    {
    178         if( !r.isUsable() )
     178        if (!r.isUsable() || r.hasIncompleteMembers())
    179179            return;
    180180        List<RelationMember> rMembers=r.getMembers();
  • trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java

    r4209 r4290  
    300300
    301301            if (relation instanceof Relation) {
    302                 if (relationHasIncompleteMember((Relation) relation)) {
     302                if (((Relation) relation).hasIncompleteMembers()) {
    303303                    name += ", "+tr("incomplete");
    304304                }
     
    364364                return (r1.getMembersCount() > r2.getMembersCount())?1:-1;
    365365
    366             comp = Boolean.valueOf(relationHasIncompleteMember(r1)).compareTo(Boolean.valueOf(relationHasIncompleteMember(r2)));
     366            comp = Boolean.valueOf(r1.hasIncompleteMembers()).compareTo(Boolean.valueOf(r2.hasIncompleteMembers()));
    367367            if (comp != 0)
    368368                return comp;
     
    443443        }
    444444        return null;
    445     }
    446 
    447     private boolean relationHasIncompleteMember(Relation relation) {
    448         for (RelationMember m : relation.getMembers()) {
    449             if (m.getMember().isIncomplete())
    450                 return true;
    451         }
    452         return false;
    453445    }
    454446
Note: See TracChangeset for help on using the changeset viewer.