Is the serialization of Guava immutable collections stable?

前端 未结 2 1691
星月不相逢
星月不相逢 2021-01-05 07:46

I was warned against using Guava immutable collections in objects used in serialized communication because if the version of Guava on one end were updated, there could be se

2条回答
  •  攒了一身酷
    2021-01-05 08:34

    Yes, that is a valid concern.

    From the Guava project homepage (http://code.google.com/p/guava-libraries/):

    Serialized forms of ALL objects are subject to change. Do not persist these and assume they can be read by a future version of the library.

    If you're using Java native serialization Guava is not a good choice.

提交回复
热议问题