Ignore:
Timestamp:
2016-05-15T14:48:06+02:00 (3 years ago)
Author:
Don-vip
Message:

findbugs - SF_SWITCH_NO_DEFAULT + various sonar fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/RelationMemberListTableCellRenderer.java

    r10021 r10216  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.Color;
    76import java.awt.Component;
    87import java.util.EnumMap;
     
    4847
    4948    protected void renderRole(Item diffItem) {
    50         String text = "";
    51         Color bgColor = diffItem.state.getColor();
    5249        RelationMemberData member = (RelationMemberData) diffItem.value;
    53         text = member == null ? "" : member.getRole();
     50        String text = member == null ? "" : member.getRole();
    5451        setText(text);
    5552        setToolTipText(text);
    56         GuiHelper.setBackgroundReadable(this, bgColor);
     53        GuiHelper.setBackgroundReadable(this, diffItem.state.getColor());
    5754    }
    5855
    5956    protected void renderPrimitive(Item diffItem) {
    6057        String text = "";
    61         Color bgColor = diffItem.state.getColor();
    6258        RelationMemberData member = (RelationMemberData) diffItem.value;
    63         text = "";
    6459        if (member != null) {
    6560            switch(member.getMemberType()) {
     
    6762            case WAY: text = tr("Way {0}", member.getMemberId()); break;
    6863            case RELATION: text = tr("Relation {0}", member.getMemberId()); break;
     64            default: throw new AssertionError();
    6965            }
    7066        }
    7167        setText(text);
    7268        setToolTipText(text);
    73         GuiHelper.setBackgroundReadable(this, bgColor);
     69        GuiHelper.setBackgroundReadable(this, diffItem.state.getColor());
    7470    }
    7571
     
    8985            renderPrimitive(member);
    9086            break;
     87        default: // Do nothing
    9188        }
    9289
Note: See TracChangeset for help on using the changeset viewer.