[ZEPPELIN-6530] Fix operator precedence in SSL store path checks and make isWindowsPath null-safe - #5353
Open
dev-donghwan wants to merge 1 commit into
Open
[ZEPPELIN-6530] Fix operator precedence in SSL store path checks and make isWindowsPath null-safe#5353dev-donghwan wants to merge 1 commit into
dev-donghwan wants to merge 1 commit into
Conversation
…make isWindowsPath null-safe
jongyoul
approved these changes
Jul 27, 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.
What is this PR for?
getKeyStorePath()andgetTrustStorePath()inZeppelinConfigurationcontaina mis-parenthesized condition:
The condition is meant to answer a single question — "is
pathan absolutepath (Unix
/...or WindowsC:\...)?" — withpath != nullguarding thewhole check. But since
&&binds tighter than||, it actually parses as(path != null && path.startsWith("/")) || isWindowsPath(path), leavingisWindowsPath(path)outside the null guard.isWindowsPathdereferences itsargument, so a null
pathwould throw an NPE.Note on reachability: with the current defaults this NPE is latent rather than
user-facing.
ZEPPELIN_SSL_KEYSTORE_PATHhas a non-null default ("keystore"),so
getKeyStorePath()never sees a null path, andgetTrustStorePath()fallsback to
getKeyStorePath()when the truststore path is unset. So this PR is acorrectness/hardening fix, not a fix for a currently reproducible crash.
This PR:
path != null && (path.startsWith("/") || isWindowsPath(path))— matchingthe correctly-parenthesized pattern already used in
getAbsoluteDir()in thesame class
isWindowsPath(null)returnfalseinstead of throwing, as defensein depth
What type of PR is it?
Bug Fix
Todos
getKeyStorePath()/getTrustStorePath()isWindowsPathnull-safeisWindowsPath(null)What is the Jira issue?
How should this be tested?
./mvnw test -pl zeppelin-server -Dtest=ZeppelinConfigurationTestisWindowsPathTestNullassertsisWindowsPath(null)returnsfalse(it threw an NPE before this change), following the existing
isWindowsPathTestTrue/isWindowsPathTestFalseconvention.Screenshots (if appropriate)
N/A
Questions:
all reachable inputs; only the (previously unreachable) null case changes from
NPE to the intended relative-path fallback