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


Ignore:
Timestamp:
2019-09-24T15:03:53+02:00 (5 years ago)
Author:
simon04
Message:

fix #18163 - OverlappingWays: exclude tourism=camp_site

File:
1 edited

Legend:

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

    r14654 r15368  
    1616import java.util.Set;
    1717import java.util.TreeSet;
     18import java.util.function.Predicate;
    1819
    1920import org.openstreetmap.josm.data.osm.Node;
     
    5455                    "barrier", "building", "building:part", "historic:building", "demolished:building",
    5556                    "removed:building", "disused:building", "abandoned:building", "proposed:building", "man_made"));
     57    protected static final Predicate<OsmPrimitive> IGNORED = primitive ->
     58            IGNORED_KEYS.get().stream().anyMatch(primitive::hasKey) || primitive.hasTag("tourism", "camp_site");
    5659
    5760    /** Constructor */
     
    153156        for (TestError error : preliminaryErrors) {
    154157            if (error.getSeverity() == Severity.WARNING || error.getHighlighted().size() / error.getPrimitives().size() >= 3) {
    155                 boolean ignore = false;
    156                 for (String ignoredKey : IGNORED_KEYS.get()) {
    157                     if (error.getPrimitives().stream().anyMatch(p -> p.hasKey(ignoredKey))) {
    158                         ignore = true;
    159                         break;
    160                     }
    161                 }
     158                boolean ignore = error.getPrimitives().stream().anyMatch(IGNORED);
    162159                if (!ignore) {
    163160                    errors.add(error);
Note: See TracChangeset for help on using the changeset viewer.