« Previous | Next » 

Revision 2d6a0dfd

ID2d6a0dfdadd82877c210abead884cec55805ce16
Parent e469b096
Child 3e0faa27

Added by Philipp Maier over 6 years ago

[!!!][BUGFIX] Generate Value Object hash from property values

This changes the Value Objects' hash generation algorithm to
use the actual properties of the Value Object, not only the
constructor arguments which lead to duplicate hashes in cases
where arguments were empty.

Furthermore the initial approach disregarded everything that
can be done within the constructor (such as trimming, calculations,
etc.).

This patch delays the generation of the value hash to just after
instantiation, where the Value Object is completely initialized.
The final object properties names and values are then hashed.

Additionally, the handling of DateTime objects has been improved.
The generated ValueHash now also includes information about the
timezone.

This might be breaking in the unlikely case where the initial
hash calculation leads to the same hash as the new calculation,
for different VOs. Besides, it might lead to duplicate VOs in the
database because the "same" VO can become a new hash due to the
changed hashing algorithm.

Change-Id: Iaf4d2a28bcd8fc5bf2c749f8021171456616e45c
Fixes: #51236
Fixes: #37357
Releases: master

  • added
  • modified
  • copied
  • renamed
  • deleted