Ignore:
Timestamp:
2015-10-10T01:40:42+02:00 (5 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/data/coor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/CachedLatLon.java

    r8357 r8846  
    6363    @Override
    6464    public String toString() {
    65         return "CachedLatLon[lat="+lat()+",lon="+lon()+"]";
     65        return "CachedLatLon[lat="+lat()+",lon="+lon()+']';
    6666    }
    6767}
  • trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java

    r8557 r8846  
    162162    }
    163163
    164     @Override public String toString() {
    165         return "EastNorth[e="+x+", n="+y+"]";
     164    @Override
     165    public String toString() {
     166        return "EastNorth[e="+x+", n="+y+']';
    166167    }
    167168
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r8540 r8846  
    151151        }
    152152
    153         return sDegrees + "\u00B0" + sMinutes + "\'" + sSeconds + "\"";
     153        return sDegrees + '\u00B0' + sMinutes + '\'' + sSeconds + '\"';
    154154    }
    155155
     
    173173        }
    174174
    175         return sDegrees + "\u00B0" + sMinutes + "\'";
     175        return sDegrees + '\u00B0' + sMinutes + '\'';
    176176    }
    177177
     
    325325        NumberFormat nf = NumberFormat.getInstance();
    326326        nf.setMaximumFractionDigits(5);
    327         return "lat=" + nf.format(lat()) + "\u00B0, lon=" + nf.format(lon()) + "\u00B0";
     327        return "lat=" + nf.format(lat()) + "\u00B0, lon=" + nf.format(lon()) + '\u00B0';
    328328    }
    329329
     
    370370    }
    371371
    372     @Override public String toString() {
    373         return "LatLon[lat="+lat()+",lon="+lon()+"]";
     372    @Override
     373    public String toString() {
     374        return "LatLon[lat="+lat()+",lon="+lon()+']';
    374375    }
    375376
Note: See TracChangeset for help on using the changeset viewer.