Ignore:
Timestamp:
2014-04-19T00:36:43+02:00 (12 years ago)
Author:
Don-vip
Message:

sonar - place Strings literals on the left side when checking for equality (can avoid NPEs)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    r6920 r6990  
    206206            depth++;
    207207            try {
    208                 if (qName.equals("searchresults")) {
     208                if ("searchresults".equals(qName)) {
    209209                    // do nothing
    210                 } else if (qName.equals("named") && (depth == 2)) {
     210                } else if ("named".equals(qName) && (depth == 2)) {
    211211                    currentResult = new PlaceSelection.SearchResult();
    212212                    currentResult.name = atts.getValue("name");
     
    219219                    currentResult.zoom = Integer.parseInt(atts.getValue("zoom"));
    220220                    data.add(currentResult);
    221                 } else if (qName.equals("description") && (depth == 3)) {
     221                } else if ("description".equals(qName) && (depth == 3)) {
    222222                    description = new StringBuffer();
    223                 } else if (qName.equals("named") && (depth == 4)) {
     223                } else if ("named".equals(qName) && (depth == 4)) {
    224224                    // this is a "named" place in the nearest places list.
    225225                    String info = atts.getValue("info");
     
    227227                        currentResult.nearestPlace = atts.getValue("name");
    228228                    }
    229                 } else if (qName.equals("place") && atts.getValue("lat") != null) {
     229                } else if ("place".equals(qName) && atts.getValue("lat") != null) {
    230230                    currentResult = new PlaceSelection.SearchResult();
    231231                    currentResult.name = atts.getValue("display_name");
     
    258258        @Override
    259259        public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
    260             if (qName.equals("description") && description != null) {
     260            if ("description".equals(qName) && description != null) {
    261261                currentResult.description = description.toString();
    262262                description = null;
Note: See TracChangeset for help on using the changeset viewer.