Ignore:
Timestamp:
2015-10-10T14:30:12+02:00 (6 years ago)
Author:
Don-vip
Message:

sonar - squid:S1643 - Strings should not be concatenated using '+' in a loop
sonar - squid:S1640 - Maps with keys that are enum values should be replaced with EnumMap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/WikiReader.java

    r8846 r8849  
    120120        boolean transl = false;
    121121        boolean skip = false;
    122         String b = "";
    123         String full = "";
     122        StringBuilder b = new StringBuilder();
     123        StringBuilder full = new StringBuilder();
    124124        for (String line = in.readLine(); line != null; line = in.readLine()) {
    125             full += line;
     125            full.append(line);
    126126            if (line.contains("<div id=\"searchable\">")) {
    127127                inside = true;
     
    142142                // add a border="0" attribute to images, otherwise the internal help browser
    143143                // will render a thick  border around images inside an <a> element
    144                 b += line.replaceAll("<img ", "<img border=\"0\" ")
     144                b.append(line.replaceAll("<img ", "<img border=\"0\" ")
    145145                         .replaceAll("<span class=\"icon\">.</span>", "")
    146146                         .replaceAll("href=\"/", "href=\"" + baseurl + '/')
    147                          .replaceAll(" />", ">")
    148                          + '\n';
     147                         .replaceAll(" />", ">"))
     148                         .append('\n');
    149149            } else if (transl && line.contains("</div>")) {
    150150                transl = false;
     
    157157        || b.indexOf(" does not exist. You can create it here.</p>") >= 0)
    158158            return "";
    159         if (b.isEmpty())
     159        if (b.length() == 0)
    160160            b = full;
    161161        return "<html><base href=\""+url.toExternalForm() +"\"> " + b + "</html>";
Note: See TracChangeset for help on using the changeset viewer.