vidakovic commented on code in PR #3563:
URL: https://github.com/apache/fineract/pull/3563#discussion_r1442550114
##########
fineract-core/src/main/java/org/apache/fineract/accounting/producttoaccountmapping/domain/PortfolioProductType.java:
##########
@@ -47,33 +44,41 @@ public String getCode() {
return this.code;
}
- private static final Map<Integer, PortfolioProductType> intToEnumMap = new
HashMap<>();
-
- static {
- for (final PortfolioProductType type : PortfolioProductType.values()) {
- intToEnumMap.put(type.value, type);
+ public static PortfolioProductType fromInt(final Integer v) {
+ if (v == null) {
+ return null;
}
- }
- public static PortfolioProductType fromInt(final int i) {
- final PortfolioProductType type = intToEnumMap.get(Integer.valueOf(i));
- return type;
+ switch (v) {
Review Comment:
See comment above.
--
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]