sachinnn99 opened a new pull request, #10631: URL: https://github.com/apache/gravitino/pull/10631
### What changes were proposed in this pull request? Changed `Optional.of(value)` to `Optional.ofNullable(value)` in `CustomStatistic.value()` and added a unit test covering the null value case. ### Why are the changes needed? `CustomStatistic.value()` throws `NullPointerException` when value is null, instead of returning an empty `Optional` as specified by the `Statistic` interface contract. `StatisticDTO` already correctly uses `Optional.ofNullable`. Fix: #10625 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added `testCustomStatisticWithNullValue()` in `TestStatisticManager` that constructs a `CustomStatistic` with a null value and verifies no NPE is thrown and `Optional.empty()` is returned. -- 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]
