Ticket #17041: 16041-overlapping-ways.patch

File 16041-overlapping-ways.patch, 1.0 KB (added by GerdP, 6 months ago)
  • src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java

     
    193193                duplicateWaySegments.add(segment);
    194194            }
    195195        }
    196         if (duplicateWaySegments.size() > 1) {
    197             return duplicateWaySegments;
    198         } else {
    199             return null;
    200         }
     196        return duplicateWaySegments;
    201197    }
    202198
    203199    @Override
     
    204200    public void visit(Way w) {
    205201
    206202        final Set<WaySegment> duplicateWaySegment = checkDuplicateWaySegment(w);
    207         if (duplicateWaySegment != null) {
     203        if (!duplicateWaySegment.isEmpty()) {
    208204            errors.add(TestError.builder(this, Severity.ERROR, DUPLICATE_WAY_SEGMENT)
    209205                    .message(tr("Way contains segment twice"))
    210206                    .primitives(w)