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
Location:
trunk/src/org/openstreetmap/josm/command
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r8509 r8846  
    141141        String text;
    142142        if (objects.size() == 1 && tags.size() == 1) {
    143             OsmPrimitive primitive = objects.iterator().next();
     143            OsmPrimitive primitive = objects.get(0);
    144144            String msg = "";
    145145            Map.Entry<String, String> entry = tags.entrySet().iterator().next();
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java

    r8777 r8846  
    8585        if (objects.size() == 1) {
    8686            NameVisitor v = new NameVisitor();
    87             objects.iterator().next().accept(v);
    88             text += " "+tr(v.className)+" "+v.name;
     87            objects.get(0).accept(v);
     88            text += ' '+tr(v.className)+' '+v.name;
    8989        } else {
    90             text += " "+objects.size()+" "+trn("object", "objects", objects.size());
     90            text += ' '+objects.size()+' '+trn("object", "objects", objects.size());
    9191        }
    9292        return text;
Note: See TracChangeset for help on using the changeset viewer.