Aman-Mittal commented on code in PR #5510:
URL: https://github.com/apache/fineract/pull/5510#discussion_r2836484358
##########
fineract-core/src/main/java/org/apache/fineract/infrastructure/core/api/ApiParameterHelper.java:
##########
@@ -58,15 +61,21 @@ public static Set<String>
extractFieldsForResponseIfProvided(final MultivaluedMa
}
public static Set<String> extractAssociationsForResponseIfProvided(final
MultivaluedMap<String, String> queryParams) {
- Set<String> fields = new HashSet<>();
- String commaSeparatedParameters = "";
- if (queryParams.getFirst("associations") != null) {
- commaSeparatedParameters = queryParams.getFirst("associations");
- if (StringUtils.isNotBlank(commaSeparatedParameters)) {
- fields = new
HashSet<>(Arrays.asList(commaSeparatedParameters.split("\\s*,\\s*"))); //
NOSONAR
+ Objects.requireNonNull(queryParams, "queryParams map cannot be null");
+ Set<String> associations = new HashSet<>();
+
+ // FIX: Change "fields" to "associations"
+ String commaSeparatedParameters = queryParams.getFirst("associations");
+
+ if (StringUtils.isNotBlank(commaSeparatedParameters)) {
+ String[] split = commaSeparatedParameters.split(",");
Review Comment:
This will trigger errorProne String[] split =
commaSeparatedParameters.split(","); fix this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]