chaokunyang commented on code in PR #3021:
URL: https://github.com/apache/fory/pull/3021#discussion_r2629392044
##########
java/fory-core/src/main/java/org/apache/fory/builder/BaseObjectCodecBuilder.java:
##########
@@ -405,7 +405,17 @@ protected Expression serializeField(
TypeRef<?> typeRef = descriptor.getTypeRef();
boolean nullable = descriptor.isNullable();
+ // ref tracking logic:
+ // - if the ref tracking is enabled globally, then @ForyField will be
checked
+ // - otherwise, fallback to global config
+ boolean useRefTracking;
if (needWriteRef(typeRef)) {
+ useRefTracking = descriptor.getForyField() == null ||
descriptor.isTrackingRef();
Review Comment:
I prefer handle in `getAllDescriptorsMap/createAllDescriptorsMap`. For
external classes, we can't add annotation to its fields, but in future we can
provide an explicit API to allow users register fields meta, then we can use
that directly in serialization and deserialization.
--
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]