Ignore:
Timestamp:
2016-03-12T19:18:29+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - Add parentheses to make the operator precedence explicit + add unit tests

File:
1 edited

Legend:

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

    r9230 r9968  
    7676        protected boolean isHeterogeneousSource() {
    7777            int count = 0;
    78             count = !getSourcePrimitivesByType(OsmPrimitiveType.NODE).isEmpty() ? count + 1 : count;
    79             count = !getSourcePrimitivesByType(OsmPrimitiveType.WAY).isEmpty() ? count + 1 : count;
    80             count = !getSourcePrimitivesByType(OsmPrimitiveType.RELATION).isEmpty() ? count + 1 : count;
     78            count = !getSourcePrimitivesByType(OsmPrimitiveType.NODE).isEmpty() ? (count + 1) : count;
     79            count = !getSourcePrimitivesByType(OsmPrimitiveType.WAY).isEmpty() ? (count + 1) : count;
     80            count = !getSourcePrimitivesByType(OsmPrimitiveType.RELATION).isEmpty() ? (count + 1) : count;
    8181            return count > 1;
    8282        }
Note: See TracChangeset for help on using the changeset viewer.