PCloud63514 opened a new pull request, #8233: URL: https://github.com/apache/gravitino/pull/8233
### What changes were proposed in this pull request? - Add null guard in `CreateTagFailureEvent` constructor. - Do not construct a `NameIdentifier` when `TagInfo` is null. - Ensure `tagInfo()` and `identifier()` return `null` consistently if no `TagInfo` is provided. - Added a unit test `testNullTagInfoDoesNotThrow` to verify expected behavior. ### Why are the changes needed? - Previously, passing a null `TagInfo` caused a `NullPointerException` in the constructor when creating the `NameIdentifier`. - This patch prevents the unexpected NPE and ensures that failure events can still be created safely without tag information. Fix: #8203 ### Does this PR introduce _any_ user-facing change? - No API changes. - Behavioral change: `CreateTagFailureEvent` no longer throws NPE if `TagInfo` is null. - In such cases, both `tagInfo()` and `identifier()` return `null`. ### How was this patch tested? - Added a new test in `CreateTagFailureEventTest` verifying null `TagInfo` does not throw. - Verified that events with valid `TagInfo` still construct a proper `NameIdentifier`. - Ensured all existing tests continue to pass. -- 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]
