Repository navigation
Fix null handling in XMLTimeUtil - #53839
Conversation
Closes keycloak#53672 Signed-off-by: Nihal Kumar Sharma <125385820+nihalritgithub@users.noreply.github.com>
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.
|
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! |
5313072 to
698f8a7
Compare

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.