Check if string map param is literal before returning the value. - #133
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves parameter merging by adding validation to ensure string map parameters are literal values before processing. The change prevents merging attempts on SEL (expression-based) string map parameters, which would be invalid operations.
- Added validation to check if string map parameters are literal before accessing their values
- Enhanced test coverage to verify the new validation behavior
- Minor code style improvements including diamond operator usage and string formatting cleanup
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ParamsMergeHelper.java | Added literal validation check for string map parameters before value extraction |
| ParamsMergeHelperTest.java | Added test case for the new validation and applied minor code style improvements |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| paramDef.isLiteral(), | ||
| "param [%s] definition exp=[%s] is not a literal", | ||
| key, | ||
| paramDef.getExpression()); |
There was a problem hiding this comment.
The error message format uses 'exp=[%s]' but 'paramDef.getExpression()' may return null for literal parameters. Consider using a more descriptive message that handles null expressions or checks if the parameter has an expression before including it.
| paramDef.getExpression()); | |
| paramDef.getExpression() != null ? paramDef.getExpression() : "N/A"); |
Pull Request type
./gradlew build --write-locksto refresh dependencies)NOTE: Please remember to run
./gradlew spotlessApplyto fix any format violations.Changes in this PR
Check if string map param is literal before turning the value.