Ignore:
Timestamp:
2015-10-10T01:40:42+02:00 (9 years ago)
Author:
Don-vip
Message:

sonar - fb-contrib - minor performance improvements:

  • Method passes constant String of length 1 to character overridden method
  • Method needlessly boxes a boolean constant
  • Method uses iterator().next() on a List to get the first item
  • Method converts String to boxed primitive using excessive boxing
  • Method converts String to primitive using excessive boxing
  • Method creates array using constants
  • Class defines List based fields but uses them like Sets
File:
1 edited

Legend:

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

    r8840 r8846  
    720720                subdir = "";
    721721            } else if (!subdir.isEmpty() && !subdir.endsWith("/")) {
    722                 subdir += "/";
     722                subdir += '/';
    723723            }
    724724            String[] extensions;
     
    742742                    /* cache separately */
    743743                    if (dirs != null && !dirs.isEmpty()) {
    744                         cacheName = "id:" + id + ":" + fullName;
     744                        cacheName = "id:" + id + ':' + fullName;
    745745                        if (archive != null) {
    746                             cacheName += ":" + archive.getName();
     746                            cacheName += ':' + archive.getName();
    747747                        }
    748748                    }
     
    838838                    bytes = Utils.decodeUrl(data).getBytes(StandardCharsets.UTF_8);
    839839                } catch (IllegalArgumentException ex) {
    840                     Main.warn("Unable to decode URL data part: "+ex.getMessage() + " (" + data + ")");
     840                    Main.warn("Unable to decode URL data part: "+ex.getMessage() + " (" + data + ')');
    841841                    return null;
    842842                }
     
    898898            } else {
    899899                final String fn_md5 = Utils.md5Hex(fn);
    900                 url = b + fn_md5.substring(0, 1) + "/" + fn_md5.substring(0, 2) + "/" + fn;
     900                url = b + fn_md5.substring(0, 1) + '/' + fn_md5.substring(0, 2) + "/" + fn;
    901901            }
    902902            result = getIfAvailableHttp(url, type);
     
    922922                inArchiveDir = "";
    923923            } else if (!inArchiveDir.isEmpty()) {
    924                 inArchiveDir += "/";
     924                inArchiveDir += '/';
    925925            }
    926926            String entryName = inArchiveDir + fullName;
     
    11421142        }
    11431143        if (GraphicsEnvironment.isHeadless()) {
    1144             Main.warn("Cursors are not available in headless mode. Returning null for '"+name+"'");
     1144            Main.warn("Cursors are not available in headless mode. Returning null for '"+name+'\'');
    11451145            return null;
    11461146        }
Note: See TracChangeset for help on using the changeset viewer.