Index: trunk/src/org/openstreetmap/josm/io/OsmDataParsingException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmDataParsingException.java	(revision 2094)
+++ trunk/src/org/openstreetmap/josm/io/OsmDataParsingException.java	(revision 2094)
@@ -0,0 +1,62 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.io;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+
+/**
+ * Represents a parsing error in an OSM data file.
+ * 
+ * Use {@see #getColumnNumber()} and {@see #getLineNumber()} to locate
+ * the position in the file where the parsing error occured.
+ * 
+ */
+public class OsmDataParsingException extends SAXException {
+    private int columnNumber;
+    private int lineNumber;
+
+    public OsmDataParsingException() {
+        super();
+    }
+
+    public OsmDataParsingException(Exception e) {
+        super(e);
+    }
+
+    public OsmDataParsingException(String message, Exception e) {
+        super(message, e);
+    }
+
+    public OsmDataParsingException(String message) {
+        super(message);
+    }
+
+    public OsmDataParsingException rememberLocation(Locator locator) {
+        if (locator == null) return this;
+        this.columnNumber = locator.getColumnNumber();
+        this.lineNumber = locator.getLineNumber();
+        return this;
+    }
+
+    @Override
+    public String getMessage() {
+        String msg = super.getMessage();
+        if (lineNumber == 0 && columnNumber == 0)
+            return msg;
+        if (msg == null) {
+            msg = getClass().getName();
+        }
+        msg = msg + " " + tr("(at line {0}, column {1})", lineNumber, columnNumber);
+        return msg;
+    }
+
+    public int getColumnNumber() {
+        return columnNumber;
+    }
+
+    public int getLineNumber() {
+        return lineNumber;
+    }
+}
Index: trunk/src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 2093)
+++ trunk/src/org/openstreetmap/josm/io/OsmReader.java	(revision 2094)
@@ -36,5 +36,5 @@
 
 /**
- * Parser for the Osm Api. Read from an input stream and construct a dataset out of it.
+ * Parser for the Osm Api. Read from an input stream and constructs a dataset out of it.
  *
  */
@@ -80,55 +80,4 @@
     }
 
-    private static class OsmPrimitiveData {
-        public long id = 0;
-        public boolean modified = false;
-        public boolean deleted = false;
-        public Date timestamp = new Date();
-        public User user = null;
-        public boolean visible = true;
-        public int version = 0;
-        public LatLon latlon = new LatLon(0,0);
-        private OsmPrimitive primitive;
-
-        public void copyTo(OsmPrimitive osm) {
-            osm.setModified(modified);
-            osm.setDeleted(deleted);
-            //  id < 0 possible if read from a file
-            if (id <= 0) {
-                osm.clearOsmId();
-            } else {
-                osm.setOsmId(id, version);
-            }
-            osm.setTimestamp(timestamp);
-            osm.user = user;
-            osm.setVisible(visible);
-            osm.mappaintStyle = null;
-        }
-
-        public Node createNode() {
-            Node node = new Node();
-            node.setCoor(latlon);
-            copyTo(node);
-            primitive = node;
-            return node;
-        }
-
-        public Way createWay() {
-            Way way = new Way();
-            copyTo(way);
-            primitive = way;
-            return way;
-        }
-        public Relation createRelation() {
-            Relation relation= new Relation();
-            copyTo(relation);
-            primitive = relation;
-            return relation;
-        }
-
-        public void rememberTag(String key, String value) {
-            primitive.put(key, value);
-        }
-    }
 
     /**
@@ -152,51 +101,4 @@
     private Map<Long, Collection<RelationMemberData>> relations = new HashMap<Long, Collection<RelationMemberData>>();
 
-    static public class OsmDataParsingException extends SAXException {
-        private int columnNumber;
-        private int lineNumber;
-
-        public OsmDataParsingException() {
-            super();
-        }
-
-        public OsmDataParsingException(Exception e) {
-            super(e);
-        }
-
-        public OsmDataParsingException(String message, Exception e) {
-            super(message, e);
-        }
-
-        public OsmDataParsingException(String message) {
-            super(message);
-        }
-
-        public OsmDataParsingException rememberLocation(Locator locator) {
-            if (locator == null) return this;
-            this.columnNumber = locator.getColumnNumber();
-            this.lineNumber = locator.getLineNumber();
-            return this;
-        }
-
-        @Override
-        public String getMessage() {
-            String msg = super.getMessage();
-            if (lineNumber == 0 && columnNumber == 0)
-                return msg;
-            if (msg == null) {
-                msg = getClass().getName();
-            }
-            msg = msg + " " + tr("(at line {0}, column {1})", lineNumber, columnNumber);
-            return msg;
-        }
-
-        public int getColumnNumber() {
-            return columnNumber;
-        }
-
-        public int getLineNumber() {
-            return lineNumber;
-        }
-    }
 
     private class Parser extends DefaultHandler {
@@ -601,3 +503,59 @@
         }
     }
+
+    /**
+     * Temporarily holds data for a parsed {@see OsmPrimitive} and provides
+     * methods for creating an {@see OsmPrimitive} based on this data.
+     */
+    private static class OsmPrimitiveData {
+        public long id = 0;
+        public boolean modified = false;
+        public boolean deleted = false;
+        public Date timestamp = new Date();
+        public User user = null;
+        public boolean visible = true;
+        public int version = 0;
+        public LatLon latlon = new LatLon(0,0);
+        private OsmPrimitive primitive;
+
+        public void copyTo(OsmPrimitive osm) {
+            //  id < 0 possible if read from a file
+            if (id <= 0) {
+                osm.clearOsmId();
+            } else {
+                osm.setOsmId(id, version);
+            }
+            osm.setDeleted(deleted);
+            osm.setModified(modified);
+            osm.setTimestamp(timestamp);
+            osm.user = user;
+            osm.setVisible(visible);
+            osm.mappaintStyle = null;
+        }
+
+        public Node createNode() {
+            Node node = new Node();
+            node.setCoor(latlon);
+            copyTo(node);
+            primitive = node;
+            return node;
+        }
+
+        public Way createWay() {
+            Way way = new Way();
+            copyTo(way);
+            primitive = way;
+            return way;
+        }
+        public Relation createRelation() {
+            Relation relation= new Relation();
+            copyTo(relation);
+            primitive = relation;
+            return relation;
+        }
+
+        public void rememberTag(String key, String value) {
+            primitive.put(key, value);
+        }
+    }
 }
