This is an automated email from the ASF dual-hosted git repository. radhikakundam pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push: new ef9b9ae8f ATLAS-5026: Remove getProperty call when calling setProperty (#340) ef9b9ae8f is described below commit ef9b9ae8f16580dbc8a7a232ebf77825be7f1611 Author: Amruth S <79594127+amruth-git...@users.noreply.github.com> AuthorDate: Thu Jun 19 10:07:51 2025 +0530 ATLAS-5026: Remove getProperty call when calling setProperty (#340) * ATLAS-5026: Remove getProperty call when calling setProperty * Update AtlasGraphUtilsV2.java --------- Co-authored-by: Madhan Neethiraj <mad...@apache.org> --- .../store/graph/v2/AtlasGraphUtilsV2.java | 26 +++++----------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java index 4efc06247..5967c4b33 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java @@ -233,30 +233,14 @@ public class AtlasGraphUtilsV2 { propertyName = encodePropertyKey(propertyName); } - Object existingValue = element.getProperty(propertyName, Object.class); - if (value == null) { - if (existingValue != null) { - if (LOG.isDebugEnabled()) { - LOG.debug("Removing property {} from {}", propertyName, toString(element)); - } - - element.removeProperty(propertyName); - } + element.removeProperty(propertyName); } else { - if (!value.equals(existingValue)) { - if (LOG.isDebugEnabled()) { - LOG.debug("Setting property {} in {}", propertyName, toString(element)); - } - - if (value instanceof Date) { - Long encodedValue = ((Date) value).getTime(); - - element.setProperty(propertyName, encodedValue); - } else { - element.setProperty(propertyName, value); - } + if (value instanceof Date) { + value = ((Date) value).getTime(); } + + element.setProperty(propertyName, value); } }