Fix for serializable object compare when upgrading JDK version