Index: /trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 2376)
+++ /trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 2377)
@@ -168,4 +168,17 @@
         private OsmPrimitiveData current;
         private String generator;
+
+        protected void fixLegacyVersion(Attributes atts) throws SAXException {
+            if (ds.version.equals("0.6") && atts.getValue("version") == null) {
+                throwException(
+                        tr("Mandatory attribute ''version'' missing for object with id {0}.", current.id)
+                );
+            } else if (ds.version.equals("0.5") && atts.getValue("version") == null) {
+                // legacy mode. 0.5 data might not have version attribute. Init with
+                // default value 1
+                //
+                current.version = 1;
+            }
+        }
 
         @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
@@ -214,4 +227,5 @@
                 current.latlon = new LatLon(getDouble(atts, "lat"), getDouble(atts, "lon"));
                 readCommon(atts, current);
+                fixLegacyVersion(atts);
                 Node n = current.createNode();
                 externalIdMap.put("n"+current.id, n);
@@ -219,4 +233,5 @@
                 current = new OsmPrimitiveData();
                 readCommon(atts, current);
+                fixLegacyVersion(atts);
                 Way w = current.createWay();
                 externalIdMap.put("w"+current.id, w);
@@ -247,4 +262,5 @@
                 current = new OsmPrimitiveData();
                 readCommon(atts, current);
+                fixLegacyVersion(atts);
                 Relation r = current.createRelation();
                 externalIdMap.put("r"+current.id, r );
