Ignore:
Timestamp:
2016-10-15T00:17:47+02:00 (8 years ago)
Author:
simon04
Message:

fix #13799 - Use builder pattern for TestError

File:
1 edited

Legend:

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

    r10715 r11129  
    140140                    }
    141141
    142                     preliminaryErrors.add(new TestError(this,
    143                             type < OVERLAPPING_HIGHWAY_AREA ? Severity.WARNING : Severity.OTHER,
    144                                     errortype, type, prims, duplicated));
     142                    Severity severity = type < OVERLAPPING_HIGHWAY_AREA ? Severity.WARNING : Severity.OTHER;
     143                    preliminaryErrors.add(TestError.builder(this, severity, type)
     144                            .message(errortype)
     145                            .primitives(prims)
     146                            .highlightWaySegments(duplicated)
     147                            .build());
    145148                    seenWays.put(currentWays, duplicated);
    146149                } else { /* way seen, mark highlight layer only */
     
    202205        final Set<WaySegment> duplicateWaySegment = checkDuplicateWaySegment(w);
    203206        if (duplicateWaySegment != null) {
    204             errors.add(new TestError(this, Severity.ERROR, tr("Way contains segment twice"),
    205                     DUPLICATE_WAY_SEGMENT, Collections.singleton(w), duplicateWaySegment));
     207            errors.add(TestError.builder(this, Severity.ERROR, DUPLICATE_WAY_SEGMENT)
     208                    .message(tr("Way contains segment twice"))
     209                    .primitives(w)
     210                    .highlightWaySegments(duplicateWaySegment)
     211                    .build());
    206212            return;
    207213        }
Note: See TracChangeset for help on using the changeset viewer.