fury icon indicating copy to clipboard operation
fury copied to clipboard

[Java] Object deep copy didn't handle transient fields correctly

Open chaokunyang opened this issue 1 year ago • 0 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

main branch

Component(s)

Java

Minimal reproduce step

In org.apache.fury.serializer.AbstractObjectSerializer, we added transient fields for copy too. But not all fields are copyable. For example, we may have a transient field such as a Lock, it's will introduce subtle bugs if we copy such objects.

What did you expect to see?

We should copy non-transient and non-static fields only, and follow object serialization semantics.

AbstractObjectSerializer needs to change and all serializers which extends AbstractObjectSerializer needs to change to. We still need to following object serialization process, just skip writing data to buffer

What did you see instead?

transient fields are copied too.

Anything Else?

#1701 #1739

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

chaokunyang avatar Sep 24 '24 04:09 chaokunyang