Changeset 11462 in josm for trunk/src/org


Ignore:
Timestamp:
2017-01-12T23:28:57+01:00 (8 years ago)
Author:
Don-vip
Message:

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

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r11397 r11462  
    270270            else if (mode == Mode.translate_node)
    271271                rv = new StringBuilder(tr("Move the node along one of the segments, then release the mouse button."));
    272             else if (mode == Mode.extrude)
    273                 rv = new StringBuilder(tr("Draw a rectangle of the desired size, then release the mouse button."));
    274             else if (mode == Mode.create_new)
     272            else if (mode == Mode.extrude || mode == Mode.create_new)
    275273                rv = new StringBuilder(tr("Draw a rectangle of the desired size, then release the mouse button."));
    276274            else {
  • trunk/src/org/openstreetmap/josm/data/validation/tests/WayConnectedToArea.java

    r11129 r11462  
    6363
    6464    private void testForError(Way w, Node wayNode, OsmPrimitive p) {
    65         if (wayNode.isOutsideDownloadArea()) {
    66             return;
    67         } else if (wayNode.getReferrers().stream().anyMatch(p1 -> p1.hasTag("route", "ferry"))) {
     65        if (wayNode.isOutsideDownloadArea()
     66                || wayNode.getReferrers().stream().anyMatch(p1 -> p1.hasTag("route", "ferry"))) {
    6867            return;
    6968        } else if (isArea(p)) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java

    r10717 r11462  
    244244                        indices.add(decision.getPos());
    245245                    }
    246                     if (roles.size() != 1) {
    247                         // roles to not patch, leave undecided
    248                         continue;
    249                     } else if (!isCollectionOfConsecutiveNumbers(indices)) {
    250                         // not consecutive members in relation, leave undecided
     246                    if (roles.size() != 1 || !isCollectionOfConsecutiveNumbers(indices)) {
     247                        // roles to not patch or not consecutive members in relation, leave undecided
    251248                        continue;
    252249                    }
Note: See TracChangeset for help on using the changeset viewer.