Ignore:
Timestamp:
2014-02-07T01:03:57+01:00 (6 years ago)
Author:
bastiK
Message:

see #8902 - Small performance enhancements / coding style (patch by shinigami, updated, modified)

stringbuilder.diff: StringBuffer => StringBuilder

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

Legend:

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

    r6643 r6822  
    253253     */
    254254    public String getQueryString() {
    255         StringBuffer sb = new StringBuffer();
     255        StringBuilder sb = new StringBuilder();
    256256        if (uid != null) {
    257257            sb.append("user").append("=").append(uid);
  • trunk/src/org/openstreetmap/josm/io/NmeaReader.java

    r6798 r6822  
    179179            rd = new BufferedReader(new InputStreamReader(source));
    180180
    181             StringBuffer sb = new StringBuffer(1024);
     181            StringBuilder sb = new StringBuilder(1024);
    182182            int loopstart_char = rd.read();
    183183            ps = new NMEAParserState();
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r6792 r6822  
    322322     */
    323323    public String getBaseUrl() {
    324         StringBuffer rv = new StringBuffer(serverUrl);
     324        StringBuilder rv = new StringBuilder(serverUrl);
    325325        if (version != null) {
    326326            rv.append("/");
     
    603603     */
    604604    private String sendRequest(String requestMethod, String urlSuffix,String requestBody, ProgressMonitor monitor, boolean doAuthenticate, boolean fastFail) throws OsmTransferException {
    605         StringBuffer responseBody = new StringBuffer();
     605        StringBuilder responseBody = new StringBuilder();
    606606        int retries = fastFail ? 0 : getMaxRetries();
    607607
  • trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java

    r6361 r6822  
    135135        try {
    136136            progressMonitor.indeterminateSubTask(tr("Downloading from OSM Server..."));
    137             StringBuffer sb = new StringBuffer();
     137            StringBuilder sb = new StringBuilder();
    138138            sb.append(primitiveType.getAPIName())
    139139            .append("/").append(id).append("/ways");
     
    169169        try {
    170170            progressMonitor.subTask(tr("Contacting OSM Server..."));
    171             StringBuffer sb = new StringBuffer();
     171            StringBuilder sb = new StringBuilder();
    172172            sb.append(primitiveType.getAPIName())
    173173            .append("/").append(id).append("/relations");
  • trunk/src/org/openstreetmap/josm/io/OsmServerChangesetReader.java

    r6792 r6822  
    5757        try {
    5858            monitor.beginTask(tr("Reading changesets..."));
    59             StringBuffer sb = new StringBuffer();
     59            StringBuilder sb = new StringBuilder();
    6060            sb.append("changesets?").append(query.getQueryString());
    6161            InputStream in = getInputStream(sb.toString(), monitor.createSubTaskMonitor(1, true));
     
    9090        try {
    9191            monitor.beginTask(tr("Reading changeset {0} ...",id));
    92             StringBuffer sb = new StringBuffer();
     92            StringBuilder sb = new StringBuilder();
    9393            sb.append("changeset/").append(id);
    9494            InputStream in = getInputStream(sb.toString(), monitor.createSubTaskMonitor(1, true));
     
    134134                }
    135135                i++;
    136                 StringBuffer sb = new StringBuffer();
     136                StringBuilder sb = new StringBuilder();
    137137                sb.append("changeset/").append(id);
    138138                InputStream in = getInputStream(sb.toString(), monitor.createSubTaskMonitor(1, true));
     
    174174        try {
    175175            monitor.beginTask(tr("Downloading changeset content"));
    176             StringBuffer sb = new StringBuffer();
     176            StringBuilder sb = new StringBuilder();
    177177            sb.append("changeset/").append(id).append("/download");
    178178            InputStream in = getInputStream(sb.toString(), monitor.createSubTaskMonitor(1, true));
  • trunk/src/org/openstreetmap/josm/io/OsmServerHistoryReader.java

    r6792 r6822  
    6060        try {
    6161            progressMonitor.indeterminateSubTask(tr("Contacting OSM Server..."));
    62             StringBuffer sb = new StringBuffer();
     62            StringBuilder sb = new StringBuilder();
    6363            sb.append(primitiveType.getAPIName())
    6464            .append("/").append(id).append("/history");
  • trunk/src/org/openstreetmap/josm/io/OsmServerObjectReader.java

    r6792 r6822  
    119119        try {
    120120            progressMonitor.indeterminateSubTask(tr("Downloading OSM data..."));
    121             StringBuffer sb = new StringBuffer();
     121            StringBuilder sb = new StringBuilder();
    122122            sb.append(id.getType().getAPIName());
    123123            sb.append("/");
Note: See TracChangeset for help on using the changeset viewer.