[cleanup] PIP-457: Remove NamespaceName.isGlobal() and TopicName.isGlobal()#25319
Merged
lhotari merged 1 commit intoapache:masterfrom Mar 16, 2026
Merged
[cleanup] PIP-457: Remove NamespaceName.isGlobal() and TopicName.isGlobal()#25319lhotari merged 1 commit intoapache:masterfrom
lhotari merged 1 commit intoapache:masterfrom
Conversation
…obal() With V1 namespace removal, isGlobal() always returns true, making it dead code. Removed the methods and simplified all call sites: - Always-true conditions unwrapped to just the body - Always-false conditions (negated) removed as dead code - Combined conditions simplified by removing the isGlobal() term
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #25319 +/- ##
============================================
+ Coverage 72.73% 72.74% +0.01%
+ Complexity 34671 34217 -454
============================================
Files 1967 1954 -13
Lines 156326 154609 -1717
Branches 17812 17693 -119
============================================
- Hits 113697 112475 -1222
+ Misses 33552 33125 -427
+ Partials 9077 9009 -68
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
lhotari
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Follow-up cleanup for PIP-457 (V1 topic name and namespace removal, #25275 and #25304).
With V1 namespace removal,
NamespaceName.isGlobal()always returnstrue(since all namespaces are now 2-part V2 format). This makesisGlobal()dead code — every condition checking it is either always-true or always-false.Modifications
NamespaceName.isGlobal()andTopicName.isGlobal()methodsif (x.isGlobal())conditions: unwrapped to just the bodyif (!x.isGlobal())conditions: removed as dead codeisGlobal()termPersistentTopicsBase.java: chainedthenCompose()calls directly instead of using intermediate variables with block lambdas (~30 methods simplified)Verifying this change
This change is a pure refactor with no behavioral change —
isGlobal()already returnedtrueunconditionally.Documentation
docdoc-requireddoc-not-neededdoc-complete