-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(java): child container deep copy #1911
fix(java): child container deep copy #1911
Conversation
...fury-core/src/main/java/org/apache/fury/serializer/collection/ChildContainerSerializers.java
Show resolved
Hide resolved
public static InternalFieldInfo[] buildFieldsInfo(Fury fury, List<Field> fields) { | ||
List<Descriptor> descriptors = new ArrayList<>(); | ||
for (Field field : fields) { | ||
if (!Modifier.isStatic(field.getModifiers())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transient fields should be filtered too
public Collection newCollection(Collection originCollection) { | ||
Collection newCollection = super.newCollection(originCollection); | ||
if (fieldInfos == null) { | ||
List<Field> fields = ReflectionUtils.getFieldsWithoutSuperClasses(type, superClasses); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just fury.getClassResolver().getAllDescriptorsMap(beanClass, false).values();
or org.apache.fury.reflect.ReflectionUtils#getFields
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
fix child container bug
Related issues
#1855
Does this PR introduce any user-facing change?
Benchmark