Basically, I'm trying to use Grails map based constructors to create objects. Â I have a test case where I populate Domain objects using the constructor and when I check the values on the object, they're populated correctly.
For some reason however, my test fails as soon as I try to serialize Operations using Gson. Â I'm using Gson 2.2.1.
Can anyone shed some light on why this might be happening? Â The code works with Java and Groovy so I would think it would be related to how Grails is constructing objects using the constructor, but I don't seem to see anything wrong there. Â It's almost as if it's struggling with the types involved.
Any help would be appreciated.
java.lang.StackOverflowError
at sun.misc.FpUtils.getExponent(FpUtils.java:130)
at java.lang.Math.getExponent(Math.java:1295)
at java.lang.StrictMath.floorOrCeil(StrictMath.java:338)
at java.lang.StrictMath.floor(StrictMath.java:323)
at java.lang.Math.floor(Math.java:407)
at sun.misc.FloatingDecimal.dtoa(FloatingDecimal.java:601)
at sun.misc.FloatingDecimal.<init>(FloatingDecimal.java:440)
at java.lang.Double.toString(Double.java:179)
at java.lang.String.valueOf(String.java:2973)
at java.lang.Double.toString(Double.java:603)
at com.google.gson.stream.JsonWriter.value(JsonWriter.java:480)
at com.google.gson.Gson$4.write(Gson.java:266)
at com.google.gson.Gson$4.write(Gson.java:251)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
at com.google.gson.internal.bind.ObjectTypeAdapter.write(ObjectTypeAdapter.java:105)