Ignore:
Timestamp:
2015-05-17T04:02:42+02:00 (10 years ago)
Author:
Don-vip
Message:

performance - remove useless boxing of boolean constants

Location:
trunk/src/org/openstreetmap/josm/gui/widgets
Files:
3 edited

Legend:

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

    r8291 r8377  
    4646    protected void feedbackInvalid(String msg) {
    4747        if (valid == null || valid || !Objects.equals(msg, this.msg)) {
    48             // only provide feedback if the validity has changed. This avoids
    49             // unnecessary UI updates.
     48            // only provide feedback if the validity has changed. This avoids unnecessary UI updates.
    5049            tc.setBorder(ERROR_BORDER);
    5150            tc.setBackground(ERROR_BACKGROUND);
    5251            tc.setToolTipText(msg);
    53             valid = false;
     52            valid = Boolean.FALSE;
    5453            this.msg = msg;
    5554        }
     
    6261    protected void feedbackValid(String msg) {
    6362        if (valid == null || !valid || !Objects.equals(msg, this.msg)) {
    64             // only provide feedback if the validity has changed. This avoids
    65             // unnecessary UI updates.
     63            // only provide feedback if the validity has changed. This avoids unnecessary UI updates.
    6664            tc.setBorder(UIManager.getBorder("TextField.border"));
    6765            tc.setBackground(UIManager.getColor("TextField.background"));
    6866            tc.setToolTipText(msg == null ? "" : msg);
    69             valid = true;
     67            valid = Boolean.TRUE;
    7068            this.msg = msg;
    7169        }
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmComboBox.java

    r8005 r8377  
    184184        public void propertyChange(PropertyChangeEvent evt) {
    185185            if ("editable".equals(evt.getPropertyName())) {
    186                 if (evt.getNewValue().equals(true)) {
     186                if (evt.getNewValue().equals(Boolean.TRUE)) {
    187187                    enableMenu();
    188188                } else {
  • trunk/src/org/openstreetmap/josm/gui/widgets/JosmEditorPane.java

    r8291 r8377  
    125125            defaults.put("EditorPane[Enabled].backgroundPainter", bgColor);
    126126            pane.putClientProperty("Nimbus.Overrides", defaults);
    127             pane.putClientProperty("Nimbus.Overrides.InheritDefaults", true);
     127            pane.putClientProperty("Nimbus.Overrides.InheritDefaults", Boolean.TRUE);
    128128            pane.setBackground(bgColor);
    129129        }
Note: See TracChangeset for help on using the changeset viewer.