Skip to content

Commit

Permalink
[JENKINS-57125] Trim the value and request parameter options (#112)
Browse files Browse the repository at this point in the history
* fix: trim value and request parameter options

* fix: trim value string and include spaces before the comma
  • Loading branch information
therealsujitk authored Apr 26, 2024
1 parent 360a25e commit 5697b32
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,12 @@ public ParameterValue createValue(CLICommand command, String value) {
if (valueStr != null) {
List<String> result = new ArrayList<>();

String[] values = valueStr.split(",");
String[] values = valueStr.trim().split("\\s*,\\s*");
Set<String> valueSet = new HashSet<>(Arrays.asList(values));

for (String requestValue : requestValues) {
if (valueSet.contains(requestValue)) {
result.add(requestValue);
if (valueSet.contains(requestValue.trim())) {
result.add(requestValue.trim());

Check warning on line 537 in src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 532-537 are not covered by tests
}
}

Expand Down

0 comments on commit 5697b32

Please sign in to comment.