Changeset 12948 in josm


Ignore:
Timestamp:
2017-10-08T16:26:22+02:00 (11 days ago)
Author:
Don-vip
Message:

fix #15032 - MapCSS classes are not set if defined in information-level rules

File:
1 edited

Legend:

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

    r12883 r12948  
    22package org.openstreetmap.josm.data.validation.tests;
    33
    4 import static org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.FixCommand.evaluateObject;
    54import static org.openstreetmap.josm.tools.I18n.tr;
    65
     
    692691        for (Set<TagCheck> schecks : checksCol) {
    693692            for (TagCheck check : schecks) {
    694                 if (Severity.OTHER.equals(check.getSeverity()) && !includeOtherSeverity) {
     693                boolean ignoreError = Severity.OTHER.equals(check.getSeverity()) && !includeOtherSeverity;
     694                // Do not run "information" level checks if not wanted, unless they also set a MapCSS class
     695                if (ignoreError && check.setClassExpressions.isEmpty()) {
    695696                    continue;
    696697                }
     
    698699                if (selector != null) {
    699700                    check.rule.declaration.execute(env);
    700                     final TestError error = check.getErrorForPrimitive(p, selector, env, new MapCSSTagCheckerAndRule(check.rule));
    701                     if (error != null) {
    702                         r.add(error);
     701                    if (!ignoreError) {
     702                        final TestError error = check.getErrorForPrimitive(p, selector, env, new MapCSSTagCheckerAndRule(check.rule));
     703                        if (error != null) {
     704                            r.add(error);
     705                        }
    703706                    }
    704707                }
Note: See TracChangeset for help on using the changeset viewer.