You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Refactor] Clean up redundant null guard for contextPath(ContextPathParser) #7510
During the review of pull request #7031, a redundant null branch was identified in the code.
There is an existing StringUtils.isBlank(contextPath) guard that executes beforehand, which already filters out null, empty, and whitespace-only values. Because contextPath is read from the same local annotations map, the subsequent if (contextPath == null) branch is unreachable code.
Proposed Solution
Remove the duplicate null branch to clean up the codebase while ensuring the local variable passed to the helper utilities remains intact.
Additional Context
Polishing task identified during the merge of #7031.
The requested cleanup is already on current master 34f2ed036: merged #7523 (4cd79f566) removed the redundant contextPath == null branch. parseIngressRule retains the preceding StringUtils.isBlank(...) guard and passes the resolved local context path into the helper methods.
Activity
poliglots commentedon Oct 8, 2026
Goal is - Consider removing this duplicate guard while retaining the local variable passed to the helpers.
in the shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/ContextPathParser.java...
look at the line no. 126 in #7031 (comment), this needs to be removed
github-actions commentedon Oct 8, 2026
👋 Hello @Aias00
A new issue has been opened by @poliglots:
Please review when you have time. Thank you! 🙏
Aias00 commentedon Oct 23, 2026
The requested cleanup is already on current master
34f2ed036: merged #7523 (4cd79f566) removed the redundantcontextPath == nullbranch.parseIngressRuleretains the precedingStringUtils.isBlank(...)guard and passes the resolved local context path into the helper methods.Current ContextPathParser
Closing as completed; this is the exact polishing change requested here, not a replacement of the broader context-path behavior.