Aarti Panchal created FINERACT-2979:
---------------------------------------
Summary: Updating a product mix fails with 501 Not Implemented
Key: FINERACT-2979
URL: https://issues.apache.org/jira/browse/FINERACT-2979
Project: Apache Fineract
Issue Type: Bug
Reporter: Aarti Panchal
PUT /loanproducts/\{productId}/productmix with restrictedProducts that keep a
product that is already restricted returns 501 "Request was understood but not
implemented".
The server log shows java.lang.UnsupportedOperationException from
ImmutableCollections.remove, thrown in
ProductMixWritePlatformServiceJpaRepositoryImpl.updateRestrictedIds:
updateProductMix passes Set.copyOf(restrictedProducts), which is immutable, and
updateRestrictedIds removes the ids it keeps from that set. The exception is
mapped to 501. This came in with the new command processing for product mix
(FINERACT-2256), so editing a product mix fails in the web apps too.
Fix: copy the ids into a mutable set (new HashSet<>(restrictedProducts)).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)