krishnaasawa1 commented on code in PR #4531:
URL: https://github.com/apache/ozone/pull/4531#discussion_r1161638590
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java:
##########
@@ -789,6 +789,15 @@ public OmKeyInfo copyObject() {
return builder.build();
}
+ /**
+ * Return a new copy of the object.
+ */
+ @Override
+ public Object clone() throws CloneNotSupportedException {
+ OmKeyInfo omKeyInfo = (OmKeyInfo) super.clone();
+ return omKeyInfo.copyObject();
Review Comment:
Here clone creates a new reference but with shallowcopy but when moving to
copyObject->build() again a new OmkeyInfo object is created to enable deep
copy. Though ideally you needed deep copy using same reference returned by
clone. Hope this behavior is appropriate.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]