Repository navigation
fix: handle missing toolchain requirement types - #197
Merged
slawekjaranowski merged 1 commit intoOct 17, 2026
Merged
slawekjaranowski merged 1 commit into
slawekjaranowski merged 1 commit into
Conversation
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix addresses the reported failure, preserves configured-type behavior, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes #169 by making ToolchainsRequirement.getParams return an immutable empty map for unknown toolchain types instead of throwing a NullPointerException.
Changes:
- Preserves the existing unmodifiable view for configured parameters.
- Adds regression tests for unknown and configured types.
| File | Description |
|---|---|
| src/test/java/org/apache/maven/plugins/toolchain/ToolchainsRequirementTest.java | Tests unknown and configured type lookups. |
| src/main/java/org/apache/maven/plugins/toolchain/ToolchainsRequirement.java | Handles missing parameters with an immutable empty map. |
Review effort: Balanced
elharo
approved these changes
Oct 17, 2026
slawekjaranowski
approved these changes
Oct 17, 2026
|
@slawekjaranowski Please assign appropriate label to PR according to the type of change. |
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.
Fixes #169
Summary
ToolchainsRequirement.getParamsnow handles unknown toolchain types without throwing a NullPointerException.Changes
Testing
JAVA_HOME=/opt/homebrew/Cellar/openjdk/27/libexec/openjdk.jdk/Contents/Home mvn -DskipITs -Dspotless.check.skip=true -Dspotless.apply.skip=true verify— passed; 3 tests passed.git diff --check— passed.-DskipITswas used for local validation.Notes
This keeps the public method total for unknown keys and avoids changing behavior for configured types. AI assistance was used in preparing this change; I reviewed the modified code and test results.