Skip to content

Parse error into GeoJsonPoint if coordinates are "integers" [DATAMONGO-1453] #2364

Closed
@spring-projects-issues

Description

@spring-projects-issues

Javier Caselli opened DATAMONGO-1453 and commented

When mapping a document containing a GeoJSON location into a GeoJsonPoint object, if the location coordinates are "round" numbers (e.g. [0,0]) I get a ClassCastException:

Failed to convert from type \[com.mongodb.BasicDBObject\] to type \[org.springframework.data.mongodb.core.geo.GeoJsonPoint\] for value '\{ "type" : "Point" , "coordinates" : [ 0 , 0]\}'; nested exception is java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Double

Affects: 1.8.4 (Gosling SR4)

Referenced from: pull request #369

Backported to: 1.9.3 (Hopper SR3), 1.8.5 (Gosling SR5)

Metadata

Metadata

Labels

in: mappingMapping and conversion infrastructuretype: bugA general bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions