Changeset 14102 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2018-08-07T19:50:47+02:00 (6 years ago)
Author:
Don-vip
Message:

update unit test

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/NoteData.java

    r14101 r14102  
    5151
    5252    /**
    53      * Construct a new note container with a given list of notes
     53     * Construct a new note container without notes
    5454     * @since 14101
    5555     */
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r13150 r14102  
    277277        @Override
    278278        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    279             FilterTableModel model = (FilterTableModel) table.getModel();
    280279            Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    281             cell.setEnabled(model.isCellEnabled(row, column));
     280            TableModel model = table.getModel();
     281            if (model instanceof FilterTableModel) {
     282                cell.setEnabled(((FilterTableModel) model).isCellEnabled(row, column));
     283            }
    282284            return cell;
    283285        }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r14097 r14102  
    813813            if (c instanceof JLabel) {
    814814                JLabel label = (JLabel) c;
    815                 label.setText(((MemberInfo) table.getValueAt(row, 1)).getPositionString());
     815                MemberInfo member = (MemberInfo) table.getValueAt(row, 1);
     816                if (member != null) {
     817                    label.setText(member.getPositionString());
     818                }
    816819                if (isDisabledAndHidden) {
    817820                    label.setFont(label.getFont().deriveFont(Font.ITALIC));
  • trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java

    r14101 r14102  
    1919import java.util.Collections;
    2020import java.util.List;
     21import java.util.Objects;
    2122import java.util.regex.Matcher;
    2223import java.util.regex.Pattern;
     
    9798     */
    9899    public NoteLayer(Collection<Note> notes, String name) {
    99         super(name);
    100         noteData = new NoteData(notes);
    101         noteData.addNoteDataUpdateListener(this);
     100        this(new NoteData(notes), name);
    102101    }
    103102
     
    110109    public NoteLayer(NoteData noteData, String name) {
    111110        super(name);
    112         this.noteData = noteData;
     111        this.noteData = Objects.requireNonNull(noteData);
    113112        this.noteData.addNoteDataUpdateListener(this);
    114113    }
Note: See TracChangeset for help on using the changeset viewer.