DATAREST-1148 - Fix eager toString() call on domain object in ResourceStatus.

Originl pull request: #282.
This commit is contained in:
Simmo Saan
2017-10-12 15:40:19 +03:00
committed by Oliver Gierke
parent 80e2fc3a3a
commit 28bb6abfea

View File

@@ -61,8 +61,10 @@ class ResourceStatus {
Assert.notNull(requestHeaders, "Request headers must not be null!");
Assert.notNull(domainObject, "Domain object must not be null!");
Assert.notNull(entity, "PersistentEntity must not be null!");
Assert.isTrue(entity.getType().isInstance(domainObject),
String.format(INVALID_DOMAIN_OBJECT, domainObject, entity.getType()));
if (!entity.getType().isInstance(domainObject)) {
throw new IllegalArgumentException(String.format(INVALID_DOMAIN_OBJECT, domainObject, entity.getType()));
}
// Check ETag for If-Non-Match