Changeset 11350 in josm for trunk/src


Ignore:
Timestamp:
2016-11-30T13:00:13+01:00 (3 years ago)
Author:
Don-vip
Message:

fix unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java

    r11348 r11350  
    4343
    4444    private static Component setColors(Component comp, JTable table, boolean isSelected, int row) {
    45         RelationMemberConflictResolverModel model = (RelationMemberConflictResolverModel) table.getModel();
     45        if (table.getModel() instanceof RelationMemberConflictResolverModel) {
     46            RelationMemberConflictResolverModel model = (RelationMemberConflictResolverModel) table.getModel();
    4647
    47         if (!isSelected && comp != null) {
    48             switch (model.getDecision(row).getDecision()) {
    49             case UNDECIDED:
    50                 comp.setForeground(ConflictColors.FGCOLOR_UNDECIDED.get());
    51                 comp.setBackground(ConflictColors.BGCOLOR_UNDECIDED.get());
    52                 break;
    53             case KEEP:
    54                 comp.setForeground(ConflictColors.FGCOLOR_MEMBER_KEEP.get());
    55                 comp.setBackground(ConflictColors.BGCOLOR_MEMBER_KEEP.get());
    56                 break;
    57             case REMOVE:
    58                 comp.setForeground(ConflictColors.FGCOLOR_MEMBER_REMOVE.get());
    59                 comp.setBackground(ConflictColors.BGCOLOR_MEMBER_REMOVE.get());
    60                 break;
     48            if (!isSelected && comp != null) {
     49                switch (model.getDecision(row).getDecision()) {
     50                case UNDECIDED:
     51                    comp.setForeground(ConflictColors.FGCOLOR_UNDECIDED.get());
     52                    comp.setBackground(ConflictColors.BGCOLOR_UNDECIDED.get());
     53                    break;
     54                case KEEP:
     55                    comp.setForeground(ConflictColors.FGCOLOR_MEMBER_KEEP.get());
     56                    comp.setBackground(ConflictColors.BGCOLOR_MEMBER_KEEP.get());
     57                    break;
     58                case REMOVE:
     59                    comp.setForeground(ConflictColors.FGCOLOR_MEMBER_REMOVE.get());
     60                    comp.setBackground(ConflictColors.BGCOLOR_MEMBER_REMOVE.get());
     61                    break;
     62                }
    6163            }
    6264        }
Note: See TracChangeset for help on using the changeset viewer.