This is an automated email from the ASF dual-hosted git repository.

sidmishra pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 5754a92  ATLAS-4481: Fixed NPE at Atlas API on update classifications 
without propagate flag
5754a92 is described below

commit 5754a929096efaa33c10853c8d699972bb4baf4c
Author: Sidharth Mishra <sidharthkmis...@gmail.com>
AuthorDate: Tue Nov 16 13:26:06 2021 -0800

    ATLAS-4481: Fixed NPE at Atlas API on update classifications without 
propagate flag
    
    Signed-off-by: Sidharth Mishra <sidmis...@apache.org>
    (cherry picked from commit 7211f4724fe827ebec1a6c1891a9b46b72f3553f)
---
 .../apache/atlas/repository/store/graph/v2/EntityGraphMapper.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
index 6d8305a..f6c50bc 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
@@ -1065,7 +1065,7 @@ public class EntityGraphMapper {
                 if (trimmedLength < value.length()) {
                     LOG.warn("Length of indexed attribute {} is {} characters, 
longer than safe-limit {}; trimming to {} - attempt #{}", 
attribute.getQualifiedName(), value.length(), INDEXED_STR_SAFE_LEN, 
trimmedLength, requestContext.getAttemptCount());
 
-                    String checksumSuffix = ":" + DigestUtils.shaHex(value); 
// Storing SHA checksum in case verification is needed after retrieval
+                    String checksumSuffix = ":" + 
DigestUtils.sha256Hex(value); // Storing SHA checksum in case verification is 
needed after retrieval
 
                     ret = value.substring(0, trimmedLength - 
checksumSuffix.length()) + checksumSuffix;
                 } else {
@@ -2407,7 +2407,7 @@ public class EntityGraphMapper {
                |   true      |    false    | => Remove Tag Propagation (send 
REMOVE classification notifications)
                |-------------|-------------| */
 
-            if (taskManagement != null && DEFERRED_ACTION_ENABLED) {
+            if (updatedTagPropagation != null && taskManagement != null && 
DEFERRED_ACTION_ENABLED) {
                 String propagationType = updatedTagPropagation ? 
CLASSIFICATION_PROPAGATION_ADD : CLASSIFICATION_PROPAGATION_DELETE;
 
                 createAndQueueTask(propagationType, entityVertex, 
classificationVertex.getIdForDisplay());
@@ -2840,4 +2840,4 @@ public class EntityGraphMapper {
 
         AtlasGraphUtilsV2.removeItemFromListProperty(edge, 
EDGE_PENDING_TASKS_PROPERTY_KEY, taskGuid);
     }
-}
\ No newline at end of file
+}

Reply via email to