galovics commented on code in PR #4861:
URL: https://github.com/apache/fineract/pull/4861#discussion_r2212496759
##########
fineract-core/src/main/java/org/apache/fineract/organisation/monetary/domain/MoneyHelper.java:
##########
@@ -22,17 +22,20 @@
import jakarta.annotation.PostConstruct;
import java.math.MathContext;
import java.math.RoundingMode;
+import java.util.concurrent.ConcurrentHashMap;
import lombok.extern.slf4j.Slf4j;
import
org.apache.fineract.infrastructure.configuration.domain.ConfigurationDomainService;
+import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
+import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class MoneyHelper {
- private static RoundingMode roundingMode = null;
- private static MathContext mathContext;
+ private static final ConcurrentHashMap<String, RoundingMode>
roundingModeCache = new ConcurrentHashMap<>();
+ private static final ConcurrentHashMap<String, MathContext>
mathContextCache = new ConcurrentHashMap<>();
public static final int PRECISION = 19;
private static ConfigurationDomainService staticConfigurationDomainService;
Review Comment:
good, let's proceed with it then as Adam suggested. Although please put a
comment there so anybody coming after us knows why it's only fetched once at
startup.
--
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]