adamsaghy commented on code in PR #4861:
URL: https://github.com/apache/fineract/pull/4861#discussion_r2218611750


##########
fineract-core/src/main/java/org/apache/fineract/organisation/monetary/domain/MoneyHelper.java:
##########
@@ -18,54 +18,176 @@
  */
 package org.apache.fineract.organisation.monetary.domain;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-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.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
+import org.apache.fineract.infrastructure.core.domain.FineractPlatformTenant;
+import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
 
+/**
+ * Pure utility class for monetary calculations and rounding operations. This 
class does not depend on Spring components
+ * or configuration services. All rounding modes are initialized at startup 
and cached per tenant.
+ */
 @Slf4j
-@Component
-public class MoneyHelper {
+public final class MoneyHelper {
 
-    private static RoundingMode roundingMode = null;
-    private static MathContext mathContext;
     public static final int PRECISION = 19;
+    private static final RoundingMode DEFAULT_ROUNDING_MODE = 
RoundingMode.HALF_EVEN;

Review Comment:
   I am not a big fan of hardcoded "default" values... I would prefer throwing 
error if it was not set, so it will be blocker if someone tries something nasty!



-- 
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]

Reply via email to