thswlsqls opened a new pull request, #17045:
URL: https://github.com/apache/iceberg/pull/17045

   Closes #17044
   
   ## Summary
   
   - `DynFields.Builder.build(target)`/`buildChecked(target)` threw 
`NullPointerException` instead of returning a field bound to `null` when 
`defaultAlwaysNull()` was set and no matching field was found.
   - `AlwaysNull` (a singleton with a `null` backing `Field`) did not override 
`bind(Object)`, so it inherited `UnboundField.bind()`, which dereferences the 
null field.
   - Adds a `bind(Object)` override to `AlwaysNull`, matching the sibling no-op 
singleton `DynMethods.UnboundMethod.NOOP.bind()`, which already avoids this 
issue the same way.
   
   ## Testing done
   
   - Added `TestDynFields` covering `build(target)`/`buildChecked(target)` with 
`defaultAlwaysNull()`: no exception thrown, and the bound field's `get()` 
returns `null`.
   - `./gradlew :iceberg-common:check` — passed (spotlessCheck, checkstyle, 
revapi, test all green; 4 new tests pass).
   - `./gradlew :iceberg-common:revapi` — passed; no public API change 
(`AlwaysNull` is a private nested class).
   


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