Ignore:
Timestamp:
2017-04-15T01:38:46+02:00 (7 years ago)
Author:
Don-vip
Message:

sonar - squid:S1192 - String literals should not be duplicated

File:
1 edited

Legend:

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

    r11621 r11913  
    22package org.openstreetmap.josm.data.validation.tests;
    33
     4import static org.openstreetmap.josm.data.validation.tests.CrossingWays.HIGHWAY;
     5import static org.openstreetmap.josm.data.validation.tests.CrossingWays.RAILWAY;
    46import static org.openstreetmap.josm.tools.I18n.tr;
    57
     
    5759        @Override
    5860        public boolean isPrimitiveUsable(OsmPrimitive p) {
    59             return super.isPrimitiveUsable(p) && p.hasKey("highway");
     61            return super.isPrimitiveUsable(p) && p.hasKey(HIGHWAY);
    6062        }
    6163    }
     
    181183                        continue;
    182184                    }
    183                     if (en.hasTag("highway", "turning_circle", "bus_stop")
     185                    if (en.hasTag(HIGHWAY, "turning_circle", "bus_stop")
    184186                            || en.hasTag("amenity", "parking_entrance")
    185                             || en.hasTag("railway", "buffer_stop")
     187                            || en.hasTag(RAILWAY, "buffer_stop")
    186188                            || en.isKeyTrue("noexit")
    187189                            || en.hasKey("entrance", "barrier")) {
     
    302304        MyWaySegment(Way w, Node n1, Node n2) {
    303305            this.w = w;
    304             String railway = w.get("railway");
    305             String highway = w.get("highway");
     306            String railway = w.get(RAILWAY);
     307            String highway = w.get(HIGHWAY);
    306308            this.isAbandoned = "abandoned".equals(railway) || w.isKeyTrue("disused");
    307309            this.highway = (highway != null || railway != null) && !isAbandoned;
     
    449451                && !w.hasKey("addr:interpolation")
    450452                // similarly for public transport platforms
    451                 && !w.hasTag("highway", "platform") && !w.hasTag("railway", "platform")
     453                && !w.hasTag(HIGHWAY, "platform") && !w.hasTag(RAILWAY, "platform")
    452454                ) {
    453455            ways.addAll(getWaySegments(w));
    454456            QuadBuckets<Node> set = endnodes;
    455             if (w.hasKey("highway", "railway")) {
     457            if (w.hasKey(HIGHWAY, RAILWAY)) {
    456458                set = endnodesHighway;
    457459            }
Note: See TracChangeset for help on using the changeset viewer.