Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug] TopicName does not throw IllegalArgumentException if localName is whitespace only #23690

Closed
3 tasks done
pdolif opened this issue Dec 8, 2024 · 0 comments · Fixed by #23691
Closed
3 tasks done
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@pdolif
Copy link
Contributor

pdolif commented Dec 8, 2024

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

Pulsar master

Minimal reproduce step

Call TopicName.get(" ").

What did you expect to see?

This is a test for the behavior I would expect:

try {
    TopicName.get(" ");
    fail("Should have raised exception");
} catch (IllegalArgumentException e) {
    // Ok
}

When creating a consumer with the topic name only being a whitespace we get:

java.lang.IllegalArgumentException: topicNames cannot have blank topic

That's why I expect TopicName.get(" ") to throw an exception too.

What did you see instead?

No exception is thrown.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
1 participant