stevenschlansker commented on PR #2338:
URL: https://github.com/apache/fory/pull/2338#issuecomment-2971924674
I am not sure how to resolve the ObjectCodec thinking all fields are not
nullable.
With the code as it is, the ObjectCodecBuilder always thinks reading fields
will be a not-null result, which is not the case. However, when I apply what I
think is a good fix - take the field nullability from Descriptor rather than
always assume false - it seems to break the object codec generation method size
limit, like
```
java.lang.AssertionError: Method writeFields2$ for class
Struct4ForyRefCodec_2 has size 344 > 325 expected [true] but found [false]
at org.testng.Assert.fail(Assert.java:110)
at
org.apache.fory.builder.ObjectCodecBuilderTest.lambda$4(ObjectCodecBuilderTest.java:145)
```
I would appreciate advice on how to correctly solve the problem with
`CodecBuilder.getFieldValue` returning an expression always marked as not-null,
even in cases like:
```
class Struct { OptionalLong f1; }
struct.f1 // may be null
```
--
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]