chaokunyang commented on code in PR #2168:
URL: https://github.com/apache/fury/pull/2168#discussion_r2084435939
##########
java/fury-core/src/main/java/org/apache/fury/serializer/AbstractObjectSerializer.java:
##########
@@ -984,14 +993,22 @@ public static class InternalFieldInfo {
protected final String qualifiedFieldName;
protected final FieldAccessor fieldAccessor;
protected boolean nullable;
+ protected boolean trackingRef;
- private InternalFieldInfo(Descriptor d, short classId) {
+ private InternalFieldInfo(Fury fury, Descriptor d, short classId) {
this.typeRef = d.getTypeRef();
this.classId = classId;
this.qualifiedFieldName = d.getDeclaringClass() + "." + d.getName();
this.fieldAccessor = d.getField() != null ?
FieldAccessor.createAccessor(d.getField()) : null;
+ FuryField furyField = d.getFuryField();
if (!typeRef.isPrimitive()) {
- nullable = d.getFuryField() == null || d.getFuryField().nullable();
+ nullable = furyField == null || furyField.nullable();
+ }
+ if (fury.trackingRef()) {
+ trackingRef =
+ furyField != null
+ ? furyField.trackingRef()
Review Comment:
If `furyField.trackingRef()` but `fury.trackingRef` is false, then it should
still be false
##########
java/fury-core/src/main/java/org/apache/fury/resolver/FieldResolver.java:
##########
@@ -776,6 +777,13 @@ public FieldInfo(
}
FuryField furyField = field == null ? null :
field.getAnnotation(FuryField.class);
this.nullable = furyField == null || furyField.nullable();
+ if (fury.trackingRef()) {
+ trackingRef =
+ furyField != null
+ ? furyField.trackingRef()
+ // todo question TypeRef.of(type)?
+ : classResolver.needToWriteRef(TypeRef.of(type));
Review Comment:
If `furyField.trackingRef()` but `fury.trackingRef` is false, then it should
still be false
--
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]