chaokunyang commented on code in PR #1737:
URL: https://github.com/apache/fury/pull/1737#discussion_r1683204373
##########
java/fury-core/src/main/java/org/apache/fury/meta/ClassDef.java:
##########
@@ -235,13 +235,18 @@ public List<Descriptor> getDescriptors(ClassResolver
resolver, Class<?> cls) {
Descriptor descriptor =
descriptorsMap.get(fieldInfo.getDefinedClass() + "." +
fieldInfo.getFieldName());
Descriptor newDesc = fieldInfo.toDescriptor(resolver);
- if (descriptor != null) {
- // Make DescriptorGrouper have consistent order whether field exist
or not
- descriptor = descriptor.copyWithTypeName(newDesc.getTypeName());
- descriptors.add(descriptor);
- } else {
+ if (descriptor == null) {
descriptors.add(newDesc);
+ continue;
+ }
+ // Make DescriptorGrouper have consistent order whether field exist or
not
+ // type is inconsistent use serialize type, except enum
+ if (!newDesc.getRawType().isAssignableFrom(descriptor.getRawType())
+ && !descriptor.getRawType().isEnum()) {
Review Comment:
move this check first
--
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]