Changeset 17223 in josm


Ignore:
Timestamp:
2020-10-17T14:32:30+02:00 (4 days ago)
Author:
GerdP
Message:

fix #19951: No warning when multipolygon preset is applied to node(s) only

  • Show "Multipolygon is not closed" also when relation doesn't contain any way
File:
1 edited

Legend:

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

    r17221 r17223  
    185185        int oldErrorsSize = errors.size();
    186186
     187        Map<Long, RelationMember> wayMap = r.getMembers().stream()
     188                .filter(RelationMember::isWay)
     189                .collect(Collectors.toMap(mem -> mem.getWay().getUniqueId(), mem -> mem, (a, b) -> b));
    187190        List<Node> openNodes = polygon.getOpenEnds();
    188         if (!openNodes.isEmpty()) {
     191        if (!openNodes.isEmpty() || wayMap.isEmpty()) {
    189192            errors.add(TestError.builder(this, Severity.ERROR, NON_CLOSED_WAY)
    190193                    .message(tr("Multipolygon is not closed"))
     
    194197        }
    195198
    196         Map<Long, RelationMember> wayMap = r.getMembers().stream()
    197                 .filter(RelationMember::isWay)
    198                 .collect(Collectors.toMap(mem -> mem.getWay().getUniqueId(), mem -> mem, (a, b) -> b));
    199199        // duplicate members were checked before
    200200        if (wayMap.isEmpty())
Note: See TracChangeset for help on using the changeset viewer.