Ignore:
Timestamp:
2017-02-19T23:52:08+01:00 (7 years ago)
Author:
Don-vip
Message:

checkstyle - enable BooleanExpressionComplexity / 6

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java

    r9246 r11587  
    77
    88import org.openstreetmap.josm.data.coor.EastNorth;
     9import org.openstreetmap.josm.data.osm.Node;
    910import org.openstreetmap.josm.data.osm.RelationMember;
    1011import org.openstreetmap.josm.data.osm.Way;
     
    2829
    2930    static Direction roundaboutType(Way w) {
    30         if (w != null &&
    31                 "roundabout".equals(w.get("junction")) &&
    32                 w.getNodesCount() < 200 &&
    33                 w.getNodesCount() > 2 &&
    34                 w.getNode(0) != null &&
    35                 w.getNode(1) != null &&
    36                 w.getNode(2) != null &&
    37                 w.isClosed()) {
    38             /** do some simple determinant / cross pruduct test on the first 3 nodes
    39                 to see, if the roundabout goes clock wise or ccw */
    40             EastNorth en1 = w.getNode(0).getEastNorth();
    41             EastNorth en2 = w.getNode(1).getEastNorth();
    42             EastNorth en3 = w.getNode(2).getEastNorth();
    43             if (en1 != null && en2 != null && en3 != null) {
    44                 en1 = en2.subtract(en1);
    45                 en2 = en3.subtract(en2);
    46                 return en1.north() * en2.east() - en2.north() * en1.east() > 0 ? ROUNDABOUT_LEFT : ROUNDABOUT_RIGHT;
     31        if (w != null && "roundabout".equals(w.get("junction"))) {
     32            int nodesCount = w.getNodesCount();
     33            if (nodesCount > 2 && nodesCount < 200) {
     34                Node n1 = w.getNode(0);
     35                Node n2 = w.getNode(1);
     36                Node n3 = w.getNode(2);
     37                if (n1 != null && n2 != null && n3 != null && w.isClosed()) {
     38                    /** do some simple determinant / cross pruduct test on the first 3 nodes
     39                        to see, if the roundabout goes clock wise or ccw */
     40                    EastNorth en1 = n1.getEastNorth();
     41                    EastNorth en2 = n2.getEastNorth();
     42                    EastNorth en3 = n3.getEastNorth();
     43                    if (en1 != null && en2 != null && en3 != null) {
     44                        en1 = en2.subtract(en1);
     45                        en2 = en3.subtract(en2);
     46                        return en1.north() * en2.east() - en2.north() * en1.east() > 0 ? ROUNDABOUT_LEFT : ROUNDABOUT_RIGHT;
     47                    }
     48                }
    4749            }
    4850        }
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r11566 r11587  
    13521352     */
    13531353    private void checkCache() {
     1354        // CHECKSTYLE.OFF: BooleanExpressionComplexity
    13541355        if ((computeCacheMaxLineLengthUsed != maxLineLength)
    13551356                || (computeCacheColored != colored)
     
    13611362                || (computeCacheHeatMapDrawGain != heatMapDrawGain))
    13621363                || (computeCacheHeatMapDrawLowerLimit != heatMapDrawLowerLimit)
    1363       ) {
     1364        ) {
     1365            // CHECKSTYLE.ON: BooleanExpressionComplexity
    13641366            computeCacheMaxLineLengthUsed = maxLineLength;
    13651367            computeCacheInSync = false;
Note: See TracChangeset for help on using the changeset viewer.