FINERACT-2326: Refractor redundant and some deprecated code as per new Java 21 style

This commit is contained in:
Aman-Mittal
2025-12-08 13:49:44 +01:00
committed by Adam Saghy
parent 399789ba42
commit dce3c66def
29 changed files with 117 additions and 232 deletions
@@ -86,7 +86,7 @@ public class CreditAllocationsValidator {
}
private boolean hasLoanProductCreditAllocationRule(List<LoanProductCreditAllocationRule> rules) {
return rules != null && rules.size() > 0;
return rules != null && !rules.isEmpty();
}
private void raiseValidationError(String globalisationMessageCode, String msg) {
@@ -94,9 +94,7 @@ public class CreditAllocationsJsonParserTest {
private static List<Pair<Integer, AllocationType>> createAllocationTypeList() {
AtomicInteger i = new AtomicInteger(1);
List<Pair<Integer, AllocationType>> list = EnumSet.allOf(AllocationType.class).stream().map(p -> Pair.of(i.getAndIncrement(), p))
.toList();
return list;
return EnumSet.allOf(AllocationType.class).stream().map(p -> Pair.of(i.getAndIncrement(), p)).toList();
}
public Map<String, Object> createCreditAllocationEntry(String transactionType, List<String> orderedRules) {
@@ -117,9 +115,8 @@ public class CreditAllocationsJsonParserTest {
private JsonCommand createJsonCommand(Map<String, Object> jsonMap) throws JsonProcessingException {
ObjectMapper objectMapper = new ObjectMapper();
String json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonMap);
JsonCommand command = JsonCommand.from(json, JsonParser.parseString(json), fromJsonHelper, null, 1L, 2L, 3L, 4L, null, null, null,
null, null, null, null, null, null);
return command;
return JsonCommand.from(json, JsonParser.parseString(json), fromJsonHelper, null, 1L, 2L, 3L, 4L, null, null, null, null, null,
null, null, null, null);
}
}