pdolif commented on code in PR #23691:
URL: https://github.com/apache/pulsar/pull/23691#discussion_r1876396974
##########
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java:
##########
@@ -170,8 +170,7 @@ private TopicName(String completeTopicName) {
throw new IllegalArgumentException("Invalid topic name: " +
completeTopicName);
}
-
- if (localName == null || localName.isEmpty()) {
+ if (StringUtils.isBlank(localName)) {
throw new IllegalArgumentException("Invalid topic name: " +
completeTopicName);
Review Comment:
I think that `localName` can never be null here.
What do you think of this?
```java
if (StringUtils.isBlank(localName)) {
throw new IllegalArgumentException(String.format("Invalid topic name:
%s. Topic local name must not"
+ " be blank.", completeTopicName));
}
```
--
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]