Changeset 11970 in josm


Ignore:
Timestamp:
2017-04-22T01:54:36+02:00 (7 years ago)
Author:
Don-vip
Message:

sonar - squid:S1871 - Two branches in the same conditional structure should not have exactly the same implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/ComputeStyleListWorker.java

    r11914 r11970  
    139139        StyleElementList sl = styles.get(osm, circum, nc);
    140140        for (StyleElement s : sl) {
    141             if (drawMultipolygon && drawArea && (s instanceof AreaElement || s instanceof AreaIconElement)
    142                     && (flags & StyledMapRenderer.FLAG_DISABLED) == 0) {
    143                 output.add(new StyleRecord(s, osm, flags));
    144             } else if ((drawMultipolygon && drawArea && s instanceof TextElement) || (drawRestriction && s instanceof NodeElement)) {
     141            if (drawAreaElement(flags, s) ||
     142               (drawMultipolygon && drawArea && s instanceof TextElement) ||
     143               (drawRestriction && s instanceof NodeElement)) {
    145144                output.add(new StyleRecord(s, osm, flags));
    146145            }
    147146        }
     147    }
     148
     149    private boolean drawAreaElement(int flags, StyleElement s) {
     150        return drawMultipolygon && drawArea && (s instanceof AreaElement || s instanceof AreaIconElement)
     151                && (flags & StyledMapRenderer.FLAG_DISABLED) == 0;
    148152    }
    149153
Note: See TracChangeset for help on using the changeset viewer.