]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5887: Minor cleanup of event listener to mirror work done in PAHMA-738: only...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 14 Feb 2013 23:43:53 +0000 (15:43 -0800)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 14 Feb 2013 23:43:53 +0000 (15:43 -0800)
3rdparty/nuxeo/nuxeo-platform-listener/updateobjectlocationonmove/src/main/java/org/collectionspace/services/listener/UpdateObjectLocationOnMove.java

index c6b9efdd8c9a50a318ad6a5c9ff53a1c1f42fee6..3436d3c1992a1277147b3502d7e02e6c1c3ec097 100644 (file)
@@ -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