justinmclean commented on code in PR #8420:
URL: https://github.com/apache/gravitino/pull/8420#discussion_r2320798579


##########
core/src/main/java/org/apache/gravitino/meta/AuditInfo.java:
##########
@@ -157,11 +157,20 @@ public AuditInfo merge(AuditInfo other, boolean 
overwrite) {
       return this;
     }
 
-    this.creator = overwrite || this.creator == null ? other.creator : creator;
-    this.createTime = overwrite || this.createTime == null ? other.createTime 
: createTime;
-    this.lastModifier = overwrite || this.lastModifier == null ? 
other.lastModifier : lastModifier;
+    this.creator =
+        (overwrite && other.creator != null) || this.creator == null ? 
other.creator : creator;
+    this.createTime =
+        (overwrite && other.createTime != null) || this.createTime == null
+            ? other.createTime
+            : createTime;
+    this.lastModifier =
+        (overwrite && other.lastModifier != null) || this.lastModifier == null
+            ? other.lastModifier
+            : lastModifier;
     this.lastModifiedTime =
-        overwrite || this.lastModifiedTime == null ? other.lastModifiedTime : 
lastModifiedTime;
+        (overwrite && other.lastModifiedTime != null) || this.lastModifiedTime 
== null
+            ? other.lastModifiedTime
+            : lastModifiedTime;

Review Comment:
   And if you set it to false, the modifier field will not be updated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to