From 63f8f502b9c0d6fd3a171f840fa73332620488d0 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Thu, 14 Feb 2013 15:43:53 -0800 Subject: [PATCH] CSPACE-5887: Minor cleanup of event listener to mirror work done in PAHMA-738: only 'null out' non-blank existing computedCurrentLocation values when the most recent Movement's currentLocation value is blank. --- .../services/listener/UpdateObjectLocationOnMove.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java b/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java index c6b9efdd8..3436d3c19 100644 --- a/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java +++ b/3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java @@ -39,8 +39,8 @@ public class UpdateObjectLocationOnMove extends AbstractUpdateObjectLocationValu // // * If it is not blank ... // * Is then capable of being successfully parsed by an authority item parser. - if ((Tools.notBlank(currentLocationRefName) - && (RefNameUtils.parseAuthorityTermInfo(currentLocationRefName) == null))) { + if (Tools.notBlank(currentLocationRefName) + && RefNameUtils.parseAuthorityTermInfo(currentLocationRefName) == null) { logger.warn("Could not parse current location refName '" + currentLocationRefName + "'"); return collectionObjectDocModel; } else { @@ -59,9 +59,9 @@ public class UpdateObjectLocationOnMove extends AbstractUpdateObjectLocationValu logger.trace("Existing computedCurrentLocation refName=" + existingComputedCurrentLocationRefName); } - // If the new value is blank, the existing value should always be - // overwritten ('nulled out') with a blank value. - if (Tools.isBlank(currentLocationRefName)) { + // If the new value is blank, any non-blank existing value should always + // be overwritten ('nulled out') with a blank value. + if (Tools.isBlank(currentLocationRefName) && Tools.notBlank(existingComputedCurrentLocationRefName)) { collectionObjectDocModel.setProperty(COLLECTIONOBJECTS_COMMON_SCHEMA, COMPUTED_CURRENT_LOCATION_PROPERTY, (Serializable) null); // Otherwise, if the existing value is blank, or if the new value -- 2.47.3