Changeset 12958 in josm


Ignore:
Timestamp:
2017-10-09T01:17:00+02:00 (2 weeks ago)
Author:
Don-vip
Message:

fix #14645 - distinguish crossing ways validator error subtypes to properly ignore the selected group only

File:
1 edited

Legend:

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

    r12865 r12958  
    3030 */
    3131public abstract class CrossingWays extends Test {
    32     protected static final int CROSSING_WAYS = 601;
    3332
    3433    static final String HIGHWAY = "highway";
     
    4140    private final Map<List<Way>, List<WaySegment>> seenWays = new HashMap<>(50);
    4241
     42    private final int code;
     43
    4344    /**
    4445     * General crossing ways test.
    4546     */
    4647    public static class Ways extends CrossingWays {
     48
     49        protected static final int CROSSING_WAYS = 601;
    4750
    4851        /**
     
    5053         */
    5154        public Ways() {
    52             super(tr("Crossing ways"));
     55            super(tr("Crossing ways"), CROSSING_WAYS);
    5356        }
    5457
     
    107110    public static class Boundaries extends CrossingWays {
    108111
     112        protected static final int CROSSING_BOUNDARIES = 602;
     113
    109114        /**
    110115         * Constructs a new crossing {@code Boundaries} test.
    111116         */
    112117        public Boundaries() {
    113             super(tr("Crossing boundaries"));
     118            super(tr("Crossing boundaries"), CROSSING_BOUNDARIES);
    114119        }
    115120
     
    142147     */
    143148    public static class Barrier extends CrossingWays {
     149
     150        protected static final int CROSSING_BARRIERS = 603;
    144151
    145152        /**
     
    147154         */
    148155        public Barrier() {
    149             super(tr("Crossing barriers"));
     156            super(tr("Crossing barriers"), CROSSING_BARRIERS);
    150157        }
    151158
     
    170177     */
    171178    public static class SelfCrossing extends CrossingWays {
     179
     180        protected static final int CROSSING_SELF = 604;
     181
    172182        CrossingWays.Ways normalTest = new Ways();
    173183        CrossingWays.Barrier barrierTest = new Barrier();
     
    178188         */
    179189        public SelfCrossing() {
    180             super(tr("Self crossing"));
     190            super(tr("Self crossing"), CROSSING_SELF);
    181191        }
    182192
     
    201211     * Constructs a new {@code CrossingWays} test.
    202212     * @param title The test title
    203      * @since 6691
    204      */
    205     public CrossingWays(String title) {
     213     * @param code The test code
     214     * @since 12958
     215     */
     216    public CrossingWays(String title, int code) {
    206217        super(title, tr("This test checks if two roads, railways, waterways or buildings crosses in the same layer, " +
    207218                "but are not connected by a node."));
     219        this.code = code;
    208220    }
    209221
     
    290302
    291303                        final String message = createMessage(es1.way, es2.way);
    292                         errors.add(TestError.builder(this, Severity.WARNING, CROSSING_WAYS)
     304                        errors.add(TestError.builder(this, Severity.WARNING, code)
    293305                                .message(message)
    294306                                .primitives(prims)
Note: See TracChangeset for help on using the changeset viewer.