Ignore:
Timestamp:
2017-03-02T01:59:40+01:00 (7 years ago)
Author:
Don-vip
Message:

sonar - pmd:UseStringBufferForStringAppends

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r11619 r11649  
    859859     */
    860860    public String getToolTipText() {
    861         String res = getName();
     861        StringBuilder res = new StringBuilder(getName());
    862862        boolean html = false;
    863         String date = getDate();
    864         if (date != null && !date.isEmpty()) {
    865             res += "<br>" + tr("Date of imagery: {0}", date);
     863        String dateStr = getDate();
     864        if (dateStr != null && !dateStr.isEmpty()) {
     865            res.append("<br>").append(tr("Date of imagery: {0}", dateStr));
    866866            html = true;
    867867        }
    868868        if (bestMarked) {
    869             res += "<br>" + tr("This imagery is marked as best in this region in other editors.");
     869            res.append("<br>").append(tr("This imagery is marked as best in this region in other editors."));
    870870            html = true;
    871871        }
    872872        String desc = getDescription();
    873873        if (desc != null && !desc.isEmpty()) {
    874             res += "<br>" + desc;
     874            res.append("<br>").append(desc);
    875875            html = true;
    876876        }
    877877        if (html) {
    878             res = "<html>" + res + "</html>";
    879         }
    880         return res;
     878            res.insert(0, "<html>").append("</html>");
     879        }
     880        return res.toString();
    881881    }
    882882
Note: See TracChangeset for help on using the changeset viewer.