mchernyakov commented on code in PR #3021:
URL: https://github.com/apache/fory/pull/3021#discussion_r2628516417


##########
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:
   with the current impl it will fail. 
   consider a case
   * the global ref tracking = `true`
   * no `@ForyField` provided -> in the Descriptor we have `refTracking = false`
   It could be handled ofc in `getAllDescriptorsMap/createAllDescriptorsMap` , 
but that means we have to take care for any cases related to the global ref 
tracking during the descriptor fetching.
   
   what do you think?



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