You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess this is two issues but they kind of go together. We are using FST to serialise method call requests/responses to AMQP. We're currently successfully using it in binary mode, but would like to be able to format messages as JSON so they're human readable and easier to interface with outside Java. There are two things which won't currently go through a serialise/deserialise and come back with the same object:
Attempting to deserialise Collections.emptyList throws a "private constructor" error. It looks like FSTCollectionSerializer:79
> if ( AbstractList.class.isAssignableFrom(objectClass) && objectClass.getName().startsWith( "java.util.Arrays" ) ) { ...
... should include java.util.Collections in this check?
A list of numbers containing NaN or Infinity values comes back with those values as strings. This is especially problematic because this can violate the list item type declaration on the list and cause weird downstream failures. I.e.
List list = deserialize(serialize(Arrays.asList(2, 3, Double.NaN, Double.Infinity))
list will end up as [ 2, 3, "NaN". "Infinity" ], and then if I try to do arithmetic on it I'll get a casting exception.
(this issue JSON encoding: if double is infinite classcast exception on decoding "Infinity" #260 is related, in the non-collection scenario)
This is because JSON doesn't support writing NaN and Infinity constants, but perhaps a configuration option to allow writing it like that anyway for ease of round trip? EDIT: You can already do this if you assume the internals of the JsonConfiguration like:
I guess this is two issues but they kind of go together. We are using FST to serialise method call requests/responses to AMQP. We're currently successfully using it in binary mode, but would like to be able to format messages as JSON so they're human readable and easier to interface with outside Java. There are two things which won't currently go through a serialise/deserialise and come back with the same object:
Attempting to deserialise Collections.emptyList throws a "private constructor" error. It looks like FSTCollectionSerializer:79
> if ( AbstractList.class.isAssignableFrom(objectClass) && objectClass.getName().startsWith( "java.util.Arrays" ) ) { ...
... should include java.util.Collections in this check?
A list of numbers containing NaN or Infinity values comes back with those values as strings. This is especially problematic because this can violate the list item type declaration on the list and cause weird downstream failures. I.e.
List list = deserialize(serialize(Arrays.asList(2, 3, Double.NaN, Double.Infinity))
list will end up as [ 2, 3, "NaN". "Infinity" ], and then if I try to do arithmetic on it I'll get a casting exception.
(this issue JSON encoding: if double is infinite classcast exception on decoding "Infinity" #260 is related, in the non-collection scenario)
This is because JSON doesn't support writing NaN and Infinity constants, but perhaps a configuration option to allow writing it like that anyway for ease of round trip? EDIT: You can already do this if you assume the internals of the JsonConfiguration like:
If it's intended that users can assume the coder specific config is a JsonFactory then this is ok
We are using 2.57 on Java 8
The text was updated successfully, but these errors were encountered: