-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix][common] TopicName: Throw IllegalArgumentException if localName is whitespace only #23691
[fix][common] TopicName: Throw IllegalArgumentException if localName is whitespace only #23691
Conversation
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/pulsarbot rerun-failure-checks |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23691 +/- ##
============================================
+ Coverage 73.57% 73.75% +0.17%
- Complexity 32624 34285 +1661
============================================
Files 1877 1945 +68
Lines 139502 150723 +11221
Branches 15299 17033 +1734
============================================
+ Hits 102638 111160 +8522
- Misses 28908 30971 +2063
- Partials 7956 8592 +636
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…is whitespace only (apache#23691) (cherry picked from commit 034791f) (cherry picked from commit 0e4dbd1)
…is whitespace only (apache#23691) (cherry picked from commit 034791f) (cherry picked from commit 0e4dbd1)
Fixes #23690
Motivation
When creating a consumer with the topic name only being a whitespace we get:
That's why I expect
TopicName.get(" ")
to throw an exception too.Modifications
Throw exception if
localName
is blank.Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: pdolif#5