Changeset 273 in josm


Ignore:
Timestamp:
2007-07-05T10:48:17+02:00 (17 years ago)
Author:
imi
Message:
  • fixed NPE when switching to way mapmode and emtpy data loaded
Files:
4 edited

Legend:

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

    r271 r273  
    108108        public void setSelected(OsmPrimitive... osm) {
    109109                clearSelection();
    110                 if (osm.length == 0)
     110                if (osm.length == 0 || (osm.length == 1 && osm[0] == null))
    111111                        return;
    112112                for (OsmPrimitive o : osm)
  • src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java

    r272 r273  
    214214                // Refresh the values model when focus is gained
    215215                editor.addFocusListener(new FocusAdapter() {
    216             public void focusGained(FocusEvent e) {
     216            @Override public void focusGained(FocusEvent e) {
    217217                String key = keys.getEditor().getItem().toString();
    218218                if (allData.containsKey(key)) {
  • src/org/openstreetmap/josm/tools/AutoCompleteComboBox.java

    r272 r273  
    2929                }
    3030
    31                 public void remove(int offs, int len) throws BadLocationException {
     31                @Override public void remove(int offs, int len) throws BadLocationException {
    3232                        if (selecting)
    3333                                return;
     
    3535                }
    3636
    37                 public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
     37                @Override public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
    3838                        super.insertString(offs, str, a);
    3939
  • test/org/openstreetmap/josm/data/osm/DataSetTest.java

    r203 r273  
    7373                assertTrue(node3.selected);
    7474                assertFalse(node2.selected);
     75
     76                ds.setSelected();
     77                assertFalse(node3.selected || node2.selected);
     78               
     79                ds.setSelected(node1, way);
     80                assertTrue(node1.selected && way.selected);
     81                assertFalse(node3.selected);
     82               
     83                ds.setSelected((OsmPrimitive)null);
     84                assertFalse(node1.selected || node2.selected || node3.selected || way.selected);
    7585        }
    7686
Note: See TracChangeset for help on using the changeset viewer.