Skip to content

Commit 7000380

Browse files
adamsaghygalovics
authored andcommitted
Apply fixes (based on review)
1 parent 25823a9 commit 7000380

3 files changed

Lines changed: 14 additions & 19 deletions

File tree

fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/Client.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,15 @@ public class Client extends AbstractAuditableWithUTCDateTimeCustom {
180180
@Column(name = "submittedon_date", nullable = true)
181181
private LocalDate submittedOnDate;
182182

183-
// Deprecated since common Auditable fields were introduced. Columns and data left untouched to help migration.
184-
185-
// @Column(name = "updated_on", nullable = true)
186-
// private LocalDate updatedOnDate;
187-
188-
// @ManyToOne(optional = true, fetch = FetchType.LAZY)
189-
// @JoinColumn(name = "updated_by", nullable = true)
190-
// private AppUser updatedBy;
183+
/*
184+
* Deprecated since common Auditable fields were introduced. Columns and data left untouched to help migration.
185+
*
186+
* @Column(name = "updated_on", nullable = true) private LocalDate updatedOnDate;
187+
*
188+
* @ManyToOne(optional = true, fetch = FetchType.LAZY)
189+
*
190+
* @JoinColumn(name = "updated_by", nullable = true) private AppUser updatedBy;
191+
*/
191192

192193
@ManyToOne(optional = true, fetch = FetchType.LAZY)
193194
@JoinColumn(name = "activatedon_userid", nullable = true)

fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,6 @@ public class Loan extends AbstractAuditableWithUTCDateTimeCustom {
218218
// loan application states
219219
@Column(name = "submittedon_date")
220220
private LocalDate submittedOnDate;
221-
222-
// @ManyToOne(optional = true, fetch = FetchType.LAZY)
223-
// @JoinColumn(name = "submittedon_userid", nullable = true)
224-
// private AppUser submittedBy;
225-
226221
@Column(name = "rejectedon_date")
227222
private LocalDate rejectedOnDate;
228223

fineract-provider/src/main/java/org/springframework/data/auditing/CustomAuditingHandler.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,10 @@
2020

2121
import java.time.temporal.TemporalAccessor;
2222
import java.util.Optional;
23-
import org.apache.commons.logging.Log;
24-
import org.apache.commons.logging.LogFactory;
2523
import org.apache.fineract.infrastructure.core.auditing.CustomDateTimeProvider;
2624
import org.apache.fineract.infrastructure.core.domain.AbstractAuditableWithUTCDateTimeCustom;
27-
import org.springframework.core.log.LogMessage;
25+
import org.slf4j.Logger;
26+
import org.slf4j.LoggerFactory;
2827
import org.springframework.data.domain.AuditorAware;
2928
import org.springframework.data.mapping.PersistentEntity;
3029
import org.springframework.data.mapping.PersistentProperty;
@@ -38,7 +37,7 @@
3837
*/
3938
public class CustomAuditingHandler extends AuditingHandler {
4039

41-
private static final Log logger = LogFactory.getLog(CustomAuditingHandler.class);
40+
private static final Logger LOG = LoggerFactory.getLogger(CustomAuditingHandler.class);
4241
private final AuditableBeanWrapperFactory factory;
4342
private boolean dateTimeForNow = true;
4443
private boolean modifyOnCreation = true;
@@ -129,12 +128,12 @@ private <T> T touch(Auditor auditor, T target, boolean isNew) {
129128
touchAuditor(auditor, it, isNew);
130129
Optional<TemporalAccessor> now = dateTimeForNow ? touchDate(it, isNew) : Optional.empty();
131130

132-
if (logger.isDebugEnabled()) {
131+
if (LOG.isDebugEnabled()) {
133132

134133
Object defaultedNow = now.map(Object::toString).orElse("not set");
135134
Object defaultedAuditor = auditor.isPresent() ? auditor.toString() : "unknown";
136135

137-
logger.debug(LogMessage.format("Touched %s - Last modification at %s by %s", target, defaultedNow, defaultedAuditor));
136+
LOG.debug("Touched {} - Last modification at {} by {}", target, defaultedNow, defaultedAuditor);
138137
}
139138

140139
return it.getBean();

0 commit comments

Comments
 (0)