This is an automated email from the ASF dual-hosted git repository.
radhikakundam pushed a commit to branch atlas-2.5
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/atlas-2.5 by this push:
new bd0818ec4 ATLAS-5026: Remove getProperty call when calling setProperty
(#340)
bd0818ec4 is described below
commit bd0818ec479f100335633777a81e52612cf3eb77
Author: Amruth S <[email protected]>
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 <[email protected]>
(cherry picked from commit ef9b9ae8f16580dbc8a7a232ebf77825be7f1611)
---
.../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);
}
}