-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache
deserialization fails with NPE for null
valued entries
#140
Comments
@cowtowncoder You are acting fast. I just received a new issue earlier today from OSS-Fuzz (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65183), which is exactly an NPE from |
@arthurscchan Yeah in this case it was just so similar to other Guava NPEs, easy to reproduce. Also wondering if this (unrelated) Fuzz issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65181 might have been fixed by one of your PRs. At least I seem unable to reproduce it. |
I'm not sure if this matters but fyi wrt the contract for native serialization of * <p>The caches produced by {@code CacheBuilder} are serializable, and the deserialized caches
* retain all the configuration properties of the original cache. Note that the serialized form does
* <i>not</i> include cache contents, but only configuration. |
|
@ben-manes Good point. I don't know if configuration may be retained in JSON serialization, but the point about dropping contents is ... interesting. Unfortunately implementation was for #90 where content serialization was explicitly desired. So if anyone would want "drop the contents" on serialization, they should file a new issue as RFE. |
I think it was for FlumeJava (Spark, Apache Beam predecessor) so the computations could be sent to the data, caching as it was processed on the local node. A very different usage and since a cache is transient data, perhaps the only reasonable expectation. Just an fyi, this seems fine for Jackson |
@ben-manes Yeah it is what it is. But conceptually I think it was wrong thing to do -- I wish I had thought it through. |
Since most Guava containers are null-averse, looks like deserializing
Cache
withnull
values fails with NPE.Longer term it may make sense to add more options for handling wrt Guava module, but for now:
@JsonSetter
annotation on field (or equivalent Config Overrides) to "skip nulls"JsonMappingException
(specifically,MismatchedInputException
) instead of NPE in failure caseThe text was updated successfully, but these errors were encountered: