Changeset 15024 in josm
- Timestamp:
- 2019-04-27T12:33:28+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/MapCSSTagChecker.java
r14599 r15024 128 128 final MapCSSRuleIndex multipolygonRules = new MapCSSRuleIndex(); 129 129 130 IndexData(MultiMap<String, TagCheck> checks) {131 buildIndex(checks );132 } 133 134 private void buildIndex(MultiMap<String, TagCheck> checks ) {130 private IndexData(MultiMap<String, TagCheck> checks, boolean includeOtherSeverity) { 131 buildIndex(checks, includeOtherSeverity); 132 } 133 134 private void buildIndex(MultiMap<String, TagCheck> checks, boolean includeOtherSeverity) { 135 135 List<TagCheck> allChecks = new ArrayList<>(); 136 136 for (Set<TagCheck> cs : checks.values()) { … … 147 147 // optimization: filter rules for different primitive types 148 148 for (TagCheck c : allChecks) { 149 if (!includeOtherSeverity && Severity.OTHER == c.getSeverity() 150 && c.setClassExpressions.isEmpty()) { 151 // Ignore "information" level checks if not wanted, unless they also set a MapCSS class 152 continue; 153 } 154 149 155 for (Selector s : c.rule.selectors) { 150 156 // find the rightmost selector, this must be a GeneralSelector … … 837 843 final List<TestError> res = new ArrayList<>(); 838 844 if (indexData == null) 839 indexData = new IndexData(checks );845 indexData = new IndexData(checks, includeOtherSeverity); 840 846 841 847 MapCSSRuleIndex matchingRuleIndex = indexData.get(p); … … 852 858 TagCheck check = indexData.getCheck(r); 853 859 if (check != null) { 854 boolean ignoreError = Severity.OTHER == check.getSeverity() && !includeOtherSeverity;855 // Do not run "information" level checks if not wanted, unless they also set a MapCSS class856 if (ignoreError && check.setClassExpressions.isEmpty()) {857 continue;858 }859 860 if (r.declaration == lastDeclUsed) 860 861 continue; // don't apply one declaration more than once … … 862 863 863 864 r.declaration.execute(env); 864 if (! ignoreError && !check.errors.isEmpty()) {865 if (!check.errors.isEmpty()) { 865 866 final TestError error = check.getErrorForPrimitive(p, r.selector, env, new MapCSSTagCheckerAndRule(check.rule)); 866 867 if (error != null) { … … 1095 1096 super.setShowElements(true); 1096 1097 if (indexData == null) { 1097 indexData = new IndexData(checks );1098 indexData = new IndexData(checks, ValidatorPrefHelper.PREF_OTHER.get()); 1098 1099 } 1099 1100 }
Note:
See TracChangeset
for help on using the changeset viewer.