sabashaikh4 commented on code in PR #9854:
URL: https://github.com/apache/gravitino/pull/9854#discussion_r2763773505
##########
core/src/main/java/org/apache/gravitino/listener/api/event/ListTopicFailureEvent.java:
##########
@@ -39,10 +40,15 @@ public final class ListTopicFailureEvent extends
TopicFailureEvent {
* @param exception The exception encountered during the attempt to list
topics.
*/
public ListTopicFailureEvent(String user, Namespace namespace, Exception
exception) {
- super(user, NameIdentifier.of(namespace.levels()), exception);
+ super(user, toNameIdentifier(namespace), exception);
this.namespace = namespace;
}
+ private static NameIdentifier toNameIdentifier(Namespace namespace) {
+ Preconditions.checkNotNull(namespace, "namespace must not be null");
Review Comment:
@justinmclean @jerryshao
I want to make sure I implement this correctly. There seems to be a
difference in approach:
- @justinmclean suggested using `checkNotNull` (throws
`NullPointerException`)
- @jerryshao mentioned using `checkArgument` (throws
`IllegalArgumentException`)
The current test expects `NullPointerException`, but if I use
`checkArgument` as @jerryshao suggested, I'll need to update the test to expect
`IllegalArgumentException`.
Could you both please confirm which approach you'd prefer? I'm happy to
implement either way - I just want to make sure we're all aligned.
Thank you for your patience and guidance!
--
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]