Repository navigation
Fix null handling in XMLTimeUtil - #53839
Merged
ahus1 merged 2 commits intoOct 29, 2026
Merged
Conversation
Closes keycloak#53672 Signed-off-by: Nihal Kumar Sharma <125385820+nihalritgithub@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation satisfies the issue requirements and includes appropriate regression coverage.
0 open findings
What changed in this PR
Adds explicit null validation to XMLTimeUtil and verifies parsing behavior.
Changes:
- Throws intentional
IllegalArgumentExceptions for null inputs. - Adds tests for null, valid, and invalid inputs.
| File | Description |
|---|---|
XMLTimeUtil.java |
Adds null guards to both parsing methods. |
XMLTimeUtilTest.java |
Covers parsing success and failure cases. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
Hi @rmartinc, I've submitted a fix for #53672 along with regression tests. The DCO check has passed, but the CI workflows are still awaiting maintainer approval. This would be my first contribution to Keycloak, so I'd really appreciate any feedback. Could you please take a look when you get a chance, or help direct it to the appropriate reviewer? Thanks! |
ahus1
previously approved these changes
Oct 29, 2026
ahus1
force-pushed
the
fix-xml-time-null-input-53672
branch
from
October 29, 2026 11:47
5313072 to
698f8a7
Compare
ahus1
approved these changes
Oct 29, 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.
Closes #53672
parseAsDuration()was callingnullArgumentError()without throwing the exception, so execution continued with a null value. Also,parse()had no explicit null check.This change makes both methods reject null inputs using the existing exception helper.
Added tests for null arguments and valid/invalid inputs. All 129 SAML Core tests passed, along with the Spotless check.