Ignore:
Timestamp:
2017-01-12T01:24:40+01:00 (3 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib:SEO_SUBOPTIMAL_EXPRESSION_ORDER - Performance - Method orders expressions in a conditional in a sub optimal way

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/NameFinder.java

    r11016 r11452  
    197197                if ("searchresults".equals(qName)) {
    198198                    // do nothing
    199                 } else if ("named".equals(qName) && (depth == 2)) {
     199                } else if (depth == 2 && "named".equals(qName)) {
    200200                    currentResult = new SearchResult();
    201201                    currentResult.name = atts.getValue("name");
     
    208208                    currentResult.zoom = Integer.parseInt(atts.getValue("zoom"));
    209209                    data.add(currentResult);
    210                 } else if ("description".equals(qName) && (depth == 3)) {
     210                } else if (depth == 3 && "description".equals(qName)) {
    211211                    description = new StringBuilder();
    212                 } else if ("named".equals(qName) && (depth == 4)) {
     212                } else if (depth == 4 && "named".equals(qName)) {
    213213                    // this is a "named" place in the nearest places list.
    214214                    String info = atts.getValue("info");
     
    252252        @Override
    253253        public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
    254             if ("description".equals(qName) && description != null) {
     254            if (description != null && "description".equals(qName)) {
    255255                currentResult.description = description.toString();
    256256                description = null;
  • trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java

    r11386 r11452  
    291291                break;
    292292            case MIRROR:
    293                 if ("mirror".equals(qName) && mirrorEntry != null) {
     293                if (mirrorEntry != null && "mirror".equals(qName)) {
    294294                    entry.addMirror(mirrorEntry);
    295295                    mirrorEntry = null;
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r11366 r11452  
    251251    protected void buttonAction(int buttonIndex, ActionEvent evt) {
    252252        // if layer all layers were closed, ignore all actions
    253         if (Main.getLayerManager().getEditDataSet() != null && buttonIndex != 2) {
     253        if (buttonIndex != 2 && Main.getLayerManager().getEditDataSet() != null) {
    254254            TableModel tm = propertyTable.getModel();
    255255            for (int i = 0; i < tm.getRowCount(); i++) {
Note: See TracChangeset for help on using the changeset viewer.