google-nomulus/core
Michael Muller d10f53cfd6 Make cross database comparison recursive (#942)
* Make cross database comparison recursive

Cross-database comparison was previously just a shallow check: fields marked
with DoNotCompare on nested objects were still compared.  This causes problems
in some cases where there are nested immutable objects.

This change introduces recursive comparison.  It also provides a
hasCorrectHashCode() method that verifies that an object has not been mutated
since the hash code was calculated, which has been a problem in certain cases.

Finally, this also fixes the problem of objects that are mutated in multiple
transactions: we were previously comparing against the value in datastore, but
this doesn't work in these cases because the object in datastore may have
changed since the transaction that we are verifying.  Instead, check against
the value that we would have persisted in the original transaction.

* Changes requested in review

* Converted check method interfaces

Per review discussion, converted check method interface so that they
consistently return a ComparisonResult object which encapsulates a success
indicator and an optional error message.

* Another round of changes on ImmutableObjectSubject

* Final changes for review

Removed unnecessary null check, minor reformatting.

(this also removes an obsolete nullness assertion from an earlier commit that
should have been fixed in the rebase)

* Try removing that nullness check import again....
2021-01-29 18:57:20 -05:00
..
gradle/dependency-locks Add a Secret Manager client for Nomulus (#872) 2020-11-12 17:12:52 -05:00
src Make cross database comparison recursive (#942) 2021-01-29 18:57:20 -05:00
WEB-INF/appengine-generated Enable Cloud SQL when Datastore is enabled for unit test (#502) 2020-03-10 12:26:25 -04:00
build.gradle Resolve TODOs under Shicong's name (#930) 2021-01-15 14:22:31 -05:00
Dockerfile Build docker image of nomulus tool (#142) 2019-07-16 20:18:44 -04:00
karma.conf.js Clean up generated sources configuration (#724) 2020-07-30 15:43:42 -04:00