justinmclean commented on code in PR #9854:
URL: https://github.com/apache/gravitino/pull/9854#discussion_r2760693368
##########
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);
Review Comment:
You could do it like this, but it seems a bit ugly to me.
```
public ListTopicFailureEvent(String user, Namespace namespace, Exception
exception) {
super(user, NameIdentifier.of(Preconditions.checkNotNull(namespace,
"namespace must not be null").levels()),
exception);
}
```
Something like this I think, would be best:
```
public ListTopicFailureEvent(String user, Namespace namespace, Exception
exception) {
super(user, toNameIdentifier(namespace), exception);
}
private static NameIdentifier toNameIdentifier(Namespace namespace) {
Preconditions.checkNotNull(namespace, "namespace must not be null");
return NameIdentifier.of(namespace.levels());
}
```
@jerryshao what do you think?
--
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]