Changeset 6447 in josm for trunk


Ignore:
Timestamp:
2013-12-06T21:39:44+01:00 (11 years ago)
Author:
Don-vip
Message:

fix #9365 - validator: test and remove layer=0

File:
1 edited

Legend:

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

    r6385 r6447  
    2323
    2424/**
    25  * Checks and corrects deprecated tags.
     25 * Checks and corrects deprecated and unnecessary tags.
    2626 * @since 4442
    2727 */
     
    140140                test("monitoring:river_level").
    141141                alternative("monitoring:water_level"));
     142        // see #9365 - Useless tag layer=0
     143        checks.add(new UnnecessaryTagCheck(2130).
     144                testAndRemove("layer", "0"));
    142145    }
    143146
     
    172175
    173176        private int code;
    174         private final List<Tag> test = new LinkedList<Tag>();
    175         private final List<Tag> change = new LinkedList<Tag>();
    176         private final List<Tag> alternatives = new LinkedList<Tag>();
     177        protected final List<Tag> test = new LinkedList<Tag>();
     178        protected final List<Tag> change = new LinkedList<Tag>();
     179        protected final List<Tag> alternatives = new LinkedList<Tag>();
    177180
    178181        public DeprecationCheck(int code) {
     
    242245        }
    243246    }
     247   
     248    private static class UnnecessaryTagCheck extends DeprecationCheck {
     249
     250        public UnnecessaryTagCheck(int code) {
     251            super(code);
     252        }
     253
     254        @Override
     255        String getDescription() {
     256            return tr("{0} is unnecessary", Utils.join(", ", test));
     257        }
     258    }
    244259
    245260    private class DeprecationError extends TestError {
Note: See TracChangeset for help on using the changeset viewer.