I currently use the library to serialize and deserialize GPX for analysis.
Some files contain elevation values greater than 1000m.
For these files the elevation is serialized with a comma as "thousand separator".
When the serialized GPX data is deserialized, Double.parseDouble is used,
which does not support the given Syntax.
Steps to reproduce the issue
Generate a GPX object with at least one waypoint which has an elevation greater 1000m
Serialze the object with the GPX.Writer#write method
Deserialize the object with the GPX.Reader#read method
What's the expected result?
No exception is thrown
The deserialized object contains exactly the same data
What's the actual result?
A java.io.InvalidObjectException Exception is thrown
java.io.InvalidObjectException: Invalid GPX: Invalid value for 'ele': For input string: "1,234.5"
at io.jenetics.jpx.GPX$Reader.read(GPX.java:1183)
at io.jenetics.jpx.GPX$Reader.read(GPX.java:1209)
at io.jenetics.jpx.GPX$Reader.fromString(GPX.java:1271)
Issue description
I currently use the library to serialize and deserialize GPX for analysis. Some files contain elevation values greater than 1000m. For these files the elevation is serialized with a comma as "thousand separator". When the serialized GPX data is deserialized,
Double.parseDouble
is used, which does not support the given Syntax.Steps to reproduce the issue
GPX.Writer#write
methodGPX.Reader#read
methodWhat's the expected result?
What's the actual result?
java.io.InvalidObjectException
Exception is thrownAdditional details
Code
Stacktrace