mchernyakov commented on code in PR #3021:
URL: https://github.com/apache/fory/pull/3021#discussion_r2616256930
##########
java/fory-core/src/main/java/org/apache/fory/type/Descriptor.java:
##########
@@ -89,6 +89,8 @@ public static void clearDescriptorCache() {
private final Method writeMethod;
private ForyField foryField;
private boolean nullable;
Review Comment:
@chaokunyang if we consider `Descriptor` class: do we really need those
additional fields? probably it could be better when there is only one "source
of truth" for nullability and ref tracking in the class :
```
public boolean isNullable() {
return nullable;
}
public boolean isTrackingRef() {
return trackingRef;
}
```
basically, I propose to set those fields in the constructors -- using
`@ForyField` if present, `isPrimitive` check and the builder. We just need to
agree on priorities like
* the global ref tracking config overrides the config from `@ForyField`
* the config from the builder overrides `@ForyField`
* etc.
wdyt?
--
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]