Skip to content

Commit d93b7f6

Browse files
committed
FINERACT-2510: Resolve compilation warnings in fineract-core and ensure test compatibility
git rebase --continue
1 parent 23c67f7 commit d93b7f6

5 files changed

Lines changed: 9 additions & 6 deletions

File tree

fineract-core/src/main/java/org/apache/fineract/infrastructure/core/api/JsonQuery.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.time.LocalDate;
2626
import java.util.Arrays;
2727
import java.util.Map;
28-
import org.apache.commons.lang3.ObjectUtils;
28+
import java.util.Objects;
2929
import org.apache.commons.lang3.StringUtils;
3030
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
3131
import org.apache.fineract.infrastructure.security.domain.BasicPasswordEncodablePlatformUser;
@@ -240,7 +240,7 @@ public Boolean booleanObjectValueOfParameterNamed(final String parameterName) {
240240
*/
241241
public boolean booleanPrimitiveValueOfParameterNamed(final String parameterName) {
242242
final Boolean value = this.fromApiJsonHelper.extractBooleanNamed(parameterName, this.parsedQuery);
243-
return ObjectUtils.defaultIfNull(value, Boolean.FALSE);
243+
return Objects.requireNonNullElse(value, Boolean.FALSE);
244244
}
245245

246246
public boolean isChangeInArrayParameterNamed(final String parameterName, final String[] existingValue) {

fineract-core/src/main/java/org/apache/fineract/infrastructure/core/service/DataEnricherProcessor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
@Component
2828
public class DataEnricherProcessor {
2929

30-
private final List<DataEnricher<?>> enhancers;
30+
private final List<DataEnricher> enhancers;
3131

3232
@Autowired
33-
public DataEnricherProcessor(Optional<List<DataEnricher<?>>> enhancers) {
33+
public DataEnricherProcessor(Optional<List<DataEnricher>> enhancers) {
3434
this.enhancers = enhancers.orElse(new ArrayList<>());
3535
}
3636

37+
@SuppressWarnings({ "unchecked", "rawtypes" })
3738
public <T> T enrich(T source) {
3839
for (DataEnricher enhancer : enhancers) {
3940
if (enhancer.isDataTypeSupported(source.getClass())) {

fineract-core/src/main/java/org/apache/fineract/infrastructure/core/service/PaginationHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
package org.apache.fineract.infrastructure.core.service;
2020

2121
import java.util.List;
22-
import org.apache.commons.lang3.ObjectUtils;
22+
import java.util.Objects;
2323
import org.apache.fineract.infrastructure.core.service.database.DatabaseSpecificSQLGenerator;
2424
import org.apache.fineract.infrastructure.core.service.database.DatabaseTypeResolver;
2525
import org.springframework.beans.factory.annotation.Autowired;
@@ -62,6 +62,6 @@ public <E> Page<Long> fetchPage(JdbcTemplate jdbcTemplate, String sql, Class<Lon
6262
String sqlCountRows = sqlGenerator.countLastExecutedQueryResult(sql);
6363
Integer totalFilteredRecords = jdbcTemplate.queryForObject(sqlCountRows, Integer.class);
6464

65-
return new Page<>(items, ObjectUtils.defaultIfNull(totalFilteredRecords, 0));
65+
return new Page<>(items, Objects.requireNonNullElse(totalFilteredRecords, 0));
6666
}
6767
}

fineract-core/src/main/java/org/apache/fineract/infrastructure/core/service/database/JavaType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ public boolean isDefault(Object o) {
343343
};
344344
}
345345

346+
@SuppressWarnings("deprecation")
346347
public Object parse(String s, String format, Locale locale) {
347348
if (s == null) {
348349
return null;

fineract-core/src/main/java/org/apache/fineract/infrastructure/event/external/service/InternalExternalEventService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ private List<ExternalEventResponse> convertToReadableFormat(List<ExternalEvent>
108108
var payLoad = method.invoke(null, byteBuffer);
109109
if (externalEvent.getType().equalsIgnoreCase("BulkBusinessEvent")) {
110110
var methodToGetDatas = payLoad.getClass().getMethod("getDatas", (Class<?>) null);
111+
@SuppressWarnings("unchecked")
111112
var bulkMessages = (List<BulkMessageItemV1>) methodToGetDatas.invoke(payLoad);
112113
var bulkMessagePayload = new StringBuilder();
113114
for (var bulkMessage : bulkMessages) {

0 commit comments

Comments
 (0)