Changeset 6264 in josm for trunk/test


Ignore:
Timestamp:
2013-09-27T01:16:28+02:00 (6 years ago)
Author:
Don-vip
Message:

Sonar/FindBugs - Performance - Method concatenates strings using + in a loop

Location:
trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/functional/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergerTest.java

    r3034 r6264  
    2323            n1.put("key" + i, "value" + i);
    2424        }
    25         String note = "";
     25        StringBuilder note = new StringBuilder();
    2626        for (int i=0; i < 50; i++) {
    27             note += " A very long text ";
     27            note.append(" A very long text ");
    2828        }
    29         n1.put("note", note);
     29        n1.put("note", note.toString());
    3030        w1.addNode(new Node(2));
    3131        w1.addNode(new Node(3));
  • trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java

    r5556 r6264  
    4848    public void projReferenceTest() {
    4949        Projection swiss = Projections.getProjectionByCode("EPSG:21781"); // Swiss grid
    50         String errs = "";
     50        StringBuilder errs = new StringBuilder();
    5151        for (ProjData pd : data) {
    5252            EastNorth en2 = swiss.latlon2eastNorth(pd.ll);
    5353            if (Math.abs(pd.en.east() - en2.east()) > EPSILON || Math.abs(pd.en.north() - en2.north()) > EPSILON) {
    54                 errs += String.format("%s should be: %s but is: %s\n", pd.name, pd.en, en2);
    55             }
    56         }
    57         assertTrue(errs, errs.length() == 0);
     54                errs.append(String.format("%s should be: %s but is: %s\n", pd.name, pd.en, en2));
     55            }
     56        }
     57        assertTrue(errs.toString(), errs.length() == 0);
    5858    }
    5959
Note: See TracChangeset for help on using the changeset viewer.