I'm building a persistence tester to test if the data I'm trying to persist is correct the process is something like this:
The test may or may not be correct. I've been fixing some bugs but the persisted data is always the same in both var1 and var2.
The values have always matched despite of the type (Integer, Long, Double, Boolean, Class, Object, etc...). However, when persisting and reading a Date, the value in milliseconds is different. The comparison works fine, it's not the problem.
Is there any bug regarding the serialization/deserialization/persistence of Date objects? I hope you can help me.
Thanks
Are you using Java serialization, Externaliable, ExternalizableLite, POF, or some custom serialization? (Assuming POF from the question title.)
Could you please post a reproducer and any custom serialization code (e.g. readExternal and writeExternal methods) that you are using?
Are you using a PofWriter to write the java.util.Date object out using the writeDateTime() method? Are you using a PofReader to read in the value using the readDate() method?
When you say that "the value in milliseconds is different", could you please define how the values differ? What was the milliseconds before you wrote it out? What was the milliseconds that was read back in?
It is also theoretically possible that something is occurring with respect to time zones. I'm curious if the time is off by exactly 15 minutes, 30 minutes, or 60 minutes, for example.