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/I18n.java

    r8840 r8846  
    309309        }
    310310        if (strings != null) {
    311             String trans = strings.get(ctx == null ? text : "_:"+ctx+"\n"+text);
     311            String trans = strings.get(ctx == null ? text : "_:"+ctx+'\n'+text);
    312312            if (trans != null)
    313313                return trans;
     
    315315        if (pstrings != null) {
    316316            i = pluralEval(1);
    317             String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+"\n"+text);
     317            String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+'\n'+text);
    318318            if (trans != null && trans.length > i)
    319319                return trans[i];
     
    339339        if (pstrings != null) {
    340340            i = pluralEval(num);
    341             String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+"\n"+text);
     341            String[] trans = pstrings.get(ctx == null ? text : "_:"+ctx+'\n'+text);
    342342            if (trans != null && trans.length > i)
    343343                return trans[i];
     
    353353
    354354    private static URL getTranslationFile(String lang) {
    355         return Main.class.getResource("/data/"+lang.replace("@", "-")+".lang");
     355        return Main.class.getResource("/data/"+lang.replace('@', '-')+".lang");
    356356    }
    357357
Note: See TracChangeset for help on using the changeset viewer.