chaokunyang commented on code in PR #1701:
URL: https://github.com/apache/fury/pull/1701#discussion_r1670432914


##########
java/fury-core/src/main/java/org/apache/fury/serializer/ObjectSerializer.java:
##########
@@ -228,6 +229,65 @@ public void write(MemoryBuffer buffer, T value) {
     writeContainerFields(buffer, value, fury, refResolver, classResolver);
   }
 
+  @Override
+  public T copy(T originObj) {
+    if (isRecord) {
+      return originObj;
+    }
+    T newObj;
+    if (!needToCopyRef) {
+      newObj = newBean(constructor, type);
+      copyFields(originObj, newObj);
+      return newObj;
+    }
+    newObj = (T) fury.getCopyObject(originObj);
+    if (Objects.nonNull(newObj)) {
+      return newObj;
+    }
+    fury.incCopyDepth(1);
+    newObj = newBean(constructor, type);
+    fury.copyReference(originObj, newObj);

Review Comment:
   Fury use `ref` instead `reference`, could we rename it to `copyRef` to keep 
consist naming style like `writeRef`



-- 
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]

Reply via email to