Closed ciscoheat closed 8 years ago
So what do you say? :)
Another bump on this :)
This change is breaking unit tests. I'll merge it once it's not breaking tests. do an sh runTests.sh
to run the tests (unix/mac)
Yes, unit tests can be at a too low level sometimes. But if not, is it a requirement that cached Date objects are keeping their references after serialization?
Sorry, deserialization (as done in the testObjectReferences
test)
That's not why the test is failing. It looks like the reference indexes are getting mixed up.
But as a user, I think I probably would actually want references to continue to be references and not copies.
Perhaps an option to use reference caching or not would be best.
Well, my patch removes Date
objects from caching altogether, so it will never match any references. But since it's on a cache level, originally from JSON which has no references, I don't see it as a problem for Date
at least, which is probably a value object in most users minds anyway. :)
I think the encoded Date object is small enough not to be cached, so it can be self-contained. It happened to me when using TJSON-encoded data in a REST service that the Date was cached but the cached object didn't exist in the response. What do you think?