Closed cnuernber closed 3 years ago
I would appreciate this as well, it seems that thaw got a little more strict recently and we're getting "unthawable" errors for java.time.Instant.
To be precise:
{:nippy/unthawable
{:cause :quarantined,
:class-name "java.time.Instant",
:content #<[B@238a7f2c>,
:type :serializable}}
Will try to take care of this next weekend. Would ideally prefer to add to Nippy core, but that'd bump the minimum Java version to 8. Want to consider a little about how to approach.
@solatis In the meantime you can safely do something like the following:
(alter-var-root nippy/*thaw-serializable-allowlist*
(fn [allowlist] (conj allowlist "java.time.Instant")))
This'll allow the use of Serializable for java.time.Instant
.
Okay have added support, though via a different implementation that:
require
an extra namespace for support. Support will be automatic on JVMs >= 8.On Clojars now as [com.taoensso/nippy "3.1.0-RC1"]
.
Cheers!
Hi, just tried this today ("3.1.0-RC1"
) and it worked in some simple cases, very grateful for this, thank you.
@harold Awesome, thanks for the confirmation- that helps!
Yup, you're welcome.
Notably, files with instants that were serialized with 3.0.0
still load those instants as unthawable/quarantined - but I believe that's to be expected.
I re-serialized with 3.1.0-RC1
and everything (including some instants) round-tripped perfectly.
We propose adding java-time as a simple extension namespace that first makes a version independent data structure out of the java.time object and then serializes to and from that ds to avoid java serialization version issues/conflicts.