### Eclipse Workspace Patch 1.0
#P JOSM
Index: src/org/openstreetmap/josm/io/OsmReader.java
===================================================================
--- src/org/openstreetmap/josm/io/OsmReader.java	(revision 8567)
+++ src/org/openstreetmap/josm/io/OsmReader.java	(working copy)
@@ -38,6 +38,7 @@
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
 import org.openstreetmap.josm.gui.progress.ProgressMonitor;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
+import org.openstreetmap.josm.tools.Primitives;
 import org.openstreetmap.josm.tools.date.DateUtils;
 
 /**
@@ -201,7 +202,7 @@
         String lat = parser.getAttributeValue(null, "lat");
         String lon = parser.getAttributeValue(null, "lon");
         if (lat != null && lon != null) {
-            nd.setCoor(new LatLon(Double.parseDouble(lat), Double.parseDouble(lon)));
+            nd.setCoor(new LatLon(Primitives.parseDouble(lat), Primitives.parseDouble(lon)));
         }
         readCommon(nd);
         Node n = new Node(nd.getId(), nd.getVersion());
Index: src/org/openstreetmap/josm/tools/Primitives.java
===================================================================
--- src/org/openstreetmap/josm/tools/Primitives.java	(revision 0)
+++ src/org/openstreetmap/josm/tools/Primitives.java	(working copy)
@@ -0,0 +1,63 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools;
+
+public class Primitives {
+
+    public static double parseDouble(String s) {
+        if (s == null) {
+            throw new NullPointerException();
+        }
+
+        int length = s.length();
+        if (length == 0) {
+            throw new NumberFormatException("empty");
+        }
+
+        int first = 0;
+        int dot = 0;
+        long acc = 0;
+        long mul = 1;
+
+        final char firstChar = s.charAt(0);
+        if (firstChar == '-') {
+            first = 1;
+            mul = -1;
+            if (length < 2) {
+                throw new NumberFormatException("just sign...");
+            }
+        } else if (firstChar == '+') {
+            first = 1;
+            if (length < 2) {
+                throw new NumberFormatException("just sign...");
+            }
+        }
+
+        for (int i = first; i < length; i++) {
+            int ch = s.charAt(i);
+            if (ch >= '0' && ch <= '9') {
+                acc = acc * 10 + (ch - '0');
+                if (dot > 0) {
+                    mul *= 10;
+                }
+            } else if (ch == '.') {
+                if (dot > 0) { // second comma
+                    throw new NumberFormatException("second dot");
+                }
+                dot = i;
+            } else {
+                throw new NumberFormatException("invalid char [" + (char) ch + "]");
+            }
+        }
+
+        double res = (double) acc / mul;
+
+        /*
+        double orig = Double.parseDouble(s);
+        if (res != orig){
+            throw new NumberFormatException("bad result " + s + " " + res + " " + orig);
+        }
+        */
+
+        return res;
+    }
+}
