Changeset 15989 in josm for trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
- Timestamp:
- 2020-03-01T23:36:09+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r15988 r15989 50 50 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction; 51 51 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule; 52 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleIndex; 52 53 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 53 54 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector; … … 73 74 */ 74 75 public class MapCSSTagChecker extends Test.TagTest { 75 private MapCSS TagCheckerIndex indexData;76 private MapCSSStyleIndex indexData; 76 77 final Map<MapCSSRule, MapCSSTagCheckerAndRule> ruleToCheckMap = new HashMap<>(); 77 78 private final Set<OsmPrimitive> tested = new HashSet<>(); 78 79 private static final Map<IPrimitive, Area> mpAreaCache = new HashMap<>(); 80 static final boolean ALL_TESTS = true; 81 static final boolean ONLY_SELECTED_TESTS = false; 79 82 80 83 /** … … 622 625 } 623 626 624 static MapCSSTagCheckerIndex createMapCSSTagCheckerIndex(MultiMap<String, TagCheck> checks, boolean includeOtherSeverity, boolean allTests) { 625 final MapCSSTagCheckerIndex index = new MapCSSTagCheckerIndex(); 627 private static boolean hasSameDeclaration(MapCSSRule rule1, final MapCSSRule rule2) { 628 return Objects.equals(rule1.declaration, rule2.declaration); 629 } 630 631 static MapCSSStyleIndex createMapCSSTagCheckerIndex(MultiMap<String, TagCheck> checks, boolean includeOtherSeverity, boolean allTests) { 632 final MapCSSStyleIndex index = new MapCSSStyleIndex(); 626 633 final Stream<MapCSSRule> ruleStream = checks.values().stream() 627 634 .flatMap(Collection::stream) … … 643 650 final List<TestError> res = new ArrayList<>(); 644 651 if (indexData == null) { 645 indexData = MapCSSTagCheckerIndex.createMapCSSTagCheckerIndex(checks, includeOtherSeverity, MapCSSTagCheckerIndex.ALL_TESTS);652 indexData = createMapCSSTagCheckerIndex(checks, includeOtherSeverity, ALL_TESTS); 646 653 } 647 654 … … 850 857 super.setShowElements(true); 851 858 if (indexData == null) { 852 indexData = MapCSSTagCheckerIndex.createMapCSSTagCheckerIndex(checks, includeOtherSeverityChecks(), MapCSSTagCheckerIndex.ALL_TESTS);859 indexData = createMapCSSTagCheckerIndex(checks, includeOtherSeverityChecks(), ALL_TESTS); 853 860 } 854 861 tested.clear(); … … 864 871 // rebuild index with a reduced set of rules (those that use ChildOrParentSelector) and thus may have left selectors 865 872 // matching the previously tested elements 866 indexData = MapCSSTagCheckerIndex.createMapCSSTagCheckerIndex(checks, includeOtherSeverityChecks(), MapCSSTagCheckerIndex.ONLY_SELECTED_TESTS);873 indexData = createMapCSSTagCheckerIndex(checks, includeOtherSeverityChecks(), ONLY_SELECTED_TESTS); 867 874 868 875 Set<OsmPrimitive> surrounding = new HashSet<>();
Note:
See TracChangeset
for help on using the changeset viewer.