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/gui/widgets
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/HtmlPanel.java

    r6890 r8846  
    3737                        f.isItalic() ? "italic" : "normal"
    3838        );
    39         rule = "body {" + rule + "}";
     39        rule = "body {" + rule + '}';
    4040        rule = MessageFormat.format(
    4141                "font-family: ''{0}'';font-size: {1,number}pt; font-weight: {2}; font-style: {3}",
     
    4545                f.isItalic() ? "italic" : "normal"
    4646        );
    47         rule = "strong {" + rule + "}";
     47        rule = "strong {" + rule + '}';
    4848        ss.addRule(rule);
    4949        ss.addRule("a {text-decoration: underline; color: blue}");
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java

    r8377 r8846  
    9999        final Font f = UIManager.getFont("Label.font");
    100100        final StyleSheet ss = new StyleSheet();
    101         ss.addRule((allBold ? "html" : "strong, b") + " {" + getFontRule(f) + "}");
     101        ss.addRule((allBold ? "html" : "strong, b") + " {" + getFontRule(f) + '}');
    102102        ss.addRule("a {text-decoration: underline; color: blue}");
    103         ss.addRule("h1 {" + getFontRule(GuiHelper.getTitleFont()) + "}");
     103        ss.addRule("h1 {" + getFontRule(GuiHelper.getTitleFont()) + '}');
    104104        ss.addRule("ol {margin-left: 1cm; margin-top: 0.1cm; margin-bottom: 0.2cm; list-style-type: decimal}");
    105105        ss.addRule("ul {margin-left: 1cm; margin-top: 0.1cm; margin-bottom: 0.2cm; list-style-type: disc}");
    106106        if ("km".equals(LanguageInfo.getJOSMLocaleCode())) {
    107107            // Fix rendering problem for Khmer script
    108             ss.addRule("p {" + getFontRule(UIManager.getFont("Label.font")) + "}");
     108            ss.addRule("p {" + getFontRule(UIManager.getFont("Label.font")) + '}');
    109109        }
    110110        kit.setStyleSheet(ss);
  • trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java

    r8840 r8846  
    11581158            }
    11591159        } else {
    1160             throwParseException(st, "unrecognized attribute \"" + name + "\"");
     1160            throwParseException(st, "unrecognized attribute \"" + name + '\"');
    11611161        }
    11621162    }
     
    12131213                    parseSplit(st, split);
    12141214                } else {
    1215                     throwParseException(st, "unrecognized node type '" + nodeType + "'");
     1215                    throwParseException(st, "unrecognized node type '" + nodeType + '\'');
    12161216                }
    12171217            }
Note: See TracChangeset for help on using the changeset viewer.