Changeset 9994 in josm for trunk


Ignore:
Timestamp:
2016-03-14T20:32:56+01:00 (9 years ago)
Author:
simon04
Message:

Fix drag-and-drop from selection list to relation member table

Location:
trunk
Files:
2 added
1 edited

Legend:

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

    r9891 r9994  
    22package org.openstreetmap.josm.data.osm;
    33
     4import java.io.IOException;
     5import java.io.ObjectInputStream;
     6import java.io.ObjectOutputStream;
    47import java.io.Serializable;
    58import java.util.ArrayList;
     
    7376    @Override
    7477    public abstract OsmPrimitiveType getType();
     78
     79    private void writeObject(ObjectOutputStream oos) throws IOException {
     80        // since super class is not Serializable
     81        oos.writeLong(id);
     82        oos.writeLong(user == null ? -1 : user.getId());
     83        oos.writeInt(version);
     84        oos.writeInt(changesetId);
     85        oos.writeInt(timestamp);
     86        oos.defaultWriteObject();
     87    }
     88
     89    private void readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException {
     90        // since super class is not Serializable
     91        id = ois.readLong();
     92        final long userId = ois.readLong();
     93        user = userId == -1 ? null : User.getById(userId);
     94        version = ois.readInt();
     95        changesetId = ois.readInt();
     96        timestamp = ois.readInt();
     97        ois.defaultReadObject();
     98    }
    7599}
Note: See TracChangeset for help on using the changeset viewer.