2

I am getting below error when object have value like Nan & Infinite

java.lang.IllegalArgumentException: Infinity is not a valid double value as per JSON specification. To override this behavior, use GsonBuilder.serializeSpecialFloatingPointValues() method.

I solved this using :-

GsonBuilder builder = new GsonBuilder(); builder.serializeSpecialFloatingPointValues();

But with Javers when using javers.getJsonConverter().toJson(diff)

Its throwing the same error . How solve this .

I am not able to set . serializeSpecialFloatingPointValues property with Javers.

i am using "org.javers.core.Javers-5.1.3" library

user3040299
  • 51
  • 1
  • 5
  • Nan & Infinite in Java? – Bartek Walacik Feb 11 '19 at 20:35
  • Yes . I am getting Infinite value (Float & Double) in object .. How to handle this with Javers library with method (javers.getJsonConverter().toJson(diff)) – user3040299 Feb 13 '19 at 04:32
  • Well, I didn't know that Java has Nan & Infinite, so there is no special support in Javers for them. Looks like this `serializeSpecialFloatingPointValues()` should be called in Javers' JsonConverterBuilder. Consider contributing a PR. – Bartek Walacik Feb 16 '19 at 15:44

0 Answers0