Changeset 13678 in josm


Ignore:
Timestamp:
2018-04-25T01:16:49+02:00 (7 months ago)
Author:
Don-vip
Message:

see #16188 - rework new test

File:
1 edited

Legend:

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

    r13671 r13678  
    4242     */
    4343    private enum WayType {
    44         BUILDING, HIGHWAY, RESIDENTIAL_AREA, WATERWAY, WAY
     44        BUILDING, HIGHWAY, RESIDENTIAL_AREA, WATERWAY, WAY;
     45
     46        static WayType of(Way w) {
     47            if (isBuilding(w))
     48                return BUILDING;
     49            else if (w.hasKey(CrossingWays.HIGHWAY))
     50                return HIGHWAY;
     51            else if (isResidentialArea(w))
     52                return RESIDENTIAL_AREA;
     53            else if (w.hasKey(CrossingWays.WATERWAY))
     54                return WATERWAY;
     55            else
     56                return WAY;
     57        }
    4558    }
    4659
     
    104117        }
    105118
    106         private static WayType getWayType(Way w) {
    107             if (isBuilding(w))
    108                 return WayType.BUILDING;
    109             else if (w.hasKey(HIGHWAY))
    110                 return WayType.HIGHWAY;
    111             else if (isResidentialArea(w))
    112                 return WayType.RESIDENTIAL_AREA;
    113             else if (w.hasKey(WATERWAY))
    114                 return WayType.WATERWAY;
    115             else
    116                 return WayType.WAY;
    117         }
    118 
    119119        @Override
    120120        String createMessage(Way w1, Way w2) {
    121             WayType[] types = {getWayType(w1), getWayType(w2)};
     121            WayType[] types = {WayType.of(w1), WayType.of(w2)};
    122122            Arrays.sort(types);
    123123
Note: See TracChangeset for help on using the changeset viewer.