Ignore:
Timestamp:
2014-09-05T01:50:02+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #10480 - False positive with lanes validation if source:lanes is present + fix headless exception seen in unit tests

File:
1 edited

Legend:

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

    r7308 r7497  
    11// License: GPL. See LICENSE file for details.
    22package org.openstreetmap.josm.data.validation.tests;
     3
     4import static org.openstreetmap.josm.tools.I18n.tr;
     5
     6import java.util.ArrayList;
     7import java.util.Collection;
     8import java.util.HashSet;
     9import java.util.Set;
     10import java.util.regex.Pattern;
    311
    412import org.openstreetmap.josm.Main;
     
    917import org.openstreetmap.josm.tools.Predicates;
    1018import org.openstreetmap.josm.tools.Utils;
    11 
    12 import java.util.Collection;
    13 import java.util.HashSet;
    14 import java.util.Set;
    15 import java.util.regex.Pattern;
    16 
    17 import static org.openstreetmap.josm.tools.I18n.tr;
    1819
    1920/**
     
    3536
    3637    protected void checkNumberOfLanesByKey(final OsmPrimitive p, String lanesKey, String message) {
    37         final Collection<String> keysForPattern = Utils.filter(p.keySet(),
    38                 Predicates.stringContainsPattern(Pattern.compile(":" + lanesKey + "$")));
     38        final Collection<String> keysForPattern = new ArrayList<>(Utils.filter(p.keySet(),
     39                Predicates.stringContainsPattern(Pattern.compile(":" + lanesKey + "$"))));
     40        keysForPattern.remove("source:lanes");
    3941        if (keysForPattern.size() < 1) {
    4042            // nothing to check
Note: See TracChangeset for help on using the changeset viewer.