Changeset 5996 in josm for trunk/src/org


Ignore:
Timestamp:
2013-06-08T12:51:41+02:00 (11 years ago)
Author:
Don-vip
Message:

fix #8771 - <changeset> with no ID rejected

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

Legend:

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

    r5890 r5996  
    4848     */
    4949    public Changeset() {
    50         this.id = 0;
    51         this.tags = new HashMap<String, String>();
     50        this(0);
    5251    }
    5352
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r5881 r5996  
    320320
    321321    private void parseChangeset(Long uploadChangesetId) throws XMLStreamException {
    322         long id = getLong("id");
    323 
    324         if (id == uploadChangesetId) {
    325             uploadChangeset = new Changeset((int) getLong("id"));
     322
     323        Long id = null;
     324        if (parser.getAttributeValue(null, "id") != null) {
     325            id = getLong("id");
     326        }
     327        // Read changeset info if neither upload-changeset nor id are set, or if they are both set to the same value
     328        if (id == uploadChangesetId || (id != null && id.equals(uploadChangesetId))) {
     329            uploadChangeset = new Changeset(id != null ? id.intValue() : 0);
    326330            while (true) {
    327331                int event = parser.next();
Note: See TracChangeset for help on using the changeset viewer.