diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/jobs/domain/ScheduledJobDetail.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/jobs/domain/ScheduledJobDetail.java index 48b6ba191..302bba956 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/jobs/domain/ScheduledJobDetail.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/jobs/domain/ScheduledJobDetail.java @@ -28,7 +28,6 @@ public class ScheduledJobDetail extends AbstractPersistable { @Column(name = "cron_expression") private String cronExpression; - @SuppressWarnings("unused") @Column(name = "create_time") @Temporal(TemporalType.TIMESTAMP) private Date createTime; @@ -39,7 +38,6 @@ public class ScheduledJobDetail extends AbstractPersistable { @Column(name = "group_name") private String groupName; - @SuppressWarnings("unused") @Column(name = "previous_run_start_time") @Temporal(TemporalType.TIMESTAMP) private Date previousRunStartTime; @@ -51,7 +49,6 @@ public class ScheduledJobDetail extends AbstractPersistable { @Column(name = "job_key") private String jobKey; - @SuppressWarnings("unused") @Column(name = "initializing_errorlog") private String errorLog; @@ -61,7 +58,6 @@ public class ScheduledJobDetail extends AbstractPersistable { @Column(name = "currently_running") private boolean currentlyRunning; - @SuppressWarnings("unused") @Column(name = "updates_allowed") private boolean updatesAllowed; @@ -162,7 +158,7 @@ public class ScheduledJobDetail extends AbstractPersistable { return this.triggerMisfired; } - public void updateTriggerMisfired(boolean triggerMisfired) { + public void updateTriggerMisfired(final boolean triggerMisfired) { this.triggerMisfired = triggerMisfired; } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/jobs/domain/ScheduledJobRunHistory.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/jobs/domain/ScheduledJobRunHistory.java index 2dd17f66a..e7b5255cd 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/jobs/domain/ScheduledJobRunHistory.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/jobs/domain/ScheduledJobRunHistory.java @@ -18,37 +18,29 @@ public class ScheduledJobRunHistory extends AbstractPersistable { @ManyToOne @JoinColumn(name = "job_id") - @SuppressWarnings("unused") private ScheduledJobDetail scheduledJobDetail; @Column(name = "version") - @SuppressWarnings("unused") private Long version; @Column(name = "start_time") @Temporal(TemporalType.TIMESTAMP) - @SuppressWarnings("unused") private Date startTime; @Column(name = "end_time") @Temporal(TemporalType.TIMESTAMP) - @SuppressWarnings("unused") private Date endTime; @Column(name = "status") - @SuppressWarnings("unused") private String status; @Column(name = "error_message") - @SuppressWarnings("unused") private String errorMessage; @Column(name = "trigger_type") - @SuppressWarnings("unused") private String triggerType; @Column(name = "error_log") - @SuppressWarnings("unused") private String errorLog; public ScheduledJobRunHistory() { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java index 5eb5906bc..96deaf1f7 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/account/service/PortfolioAccountReadPlatformServiceImpl.java @@ -66,7 +66,7 @@ public class PortfolioAccountReadPlatformServiceImpl implements PortfolioAccount case SAVINGS: sql = "select " + this.savingsAccountMapper.schema() + " where sa.id = ?"; if (currencyCode != null) { - sql += " and la.currency_code = ?"; + sql += " and sa.currency_code = ?"; sqlParams = new Object[] {accountId, currencyCode}; } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/group/domain/Group.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/group/domain/Group.java index 26e70aafe..b816da1fb 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/group/domain/Group.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/group/domain/Group.java @@ -38,7 +38,6 @@ import org.mifosplatform.infrastructure.core.service.DateUtils; import org.mifosplatform.organisation.office.domain.Office; import org.mifosplatform.organisation.staff.domain.Staff; import org.mifosplatform.portfolio.client.domain.Client; -import org.mifosplatform.portfolio.client.domain.ClientStatus; import org.mifosplatform.portfolio.group.api.GroupingTypesApiConstants; import org.mifosplatform.portfolio.group.exception.ClientExistInGroupException; import org.mifosplatform.portfolio.group.exception.ClientNotInGroupException; @@ -111,7 +110,8 @@ public final class Group extends AbstractPersistable { LocalDate groupActivationDate = null; if (active) { status = GroupingTypeStatus.ACTIVE; - groupActivationDate = activationDate;//set activation date only if group is made active + groupActivationDate = activationDate;// set activation date only if + // group is made active } return new Group(office, staff, parent, groupLevel, name, externalId, status, groupActivationDate, clientMembers, groupMembers); @@ -310,8 +310,8 @@ public final class Group extends AbstractPersistable { public List updateClientMembersIfDifferent(final Set clientMembersSet) { List differences = new ArrayList(); if (!clientMembersSet.equals(this.clientMembers)) { - Set diffClients = Sets.symmetricDifference(clientMembersSet, this.clientMembers); - String[] diffClientsIds = getClientIds(diffClients); + final Set diffClients = Sets.symmetricDifference(clientMembersSet, this.clientMembers); + final String[] diffClientsIds = getClientIds(diffClients); if (diffClientsIds != null) { differences = Arrays.asList(diffClientsIds); } @@ -322,35 +322,33 @@ public final class Group extends AbstractPersistable { } public List associateClients(final Set clientMembersSet) { - List differences = new ArrayList(); - for (Client client : clientMembersSet) { - if(this.hasClientAsMember(client)){ - throw new ClientExistInGroupException(client.getId(), this.getId()); - } + final List differences = new ArrayList(); + for (final Client client : clientMembersSet) { + if (hasClientAsMember(client)) { throw new ClientExistInGroupException(client.getId(), getId()); } this.clientMembers.add(client); differences.add(client.getId().toString()); } return differences; } - + public List disassociateClients(final Set clientMembersSet) { - List differences = new ArrayList(); - for (Client client : clientMembersSet) { - if(this.hasClientAsMember(client)){ + final List differences = new ArrayList(); + for (final Client client : clientMembersSet) { + if (hasClientAsMember(client)) { this.clientMembers.remove(client); differences.add(client.getId().toString()); - }else{ - throw new ClientNotInGroupException(client.getId(), this.getId()); - } + } else { + throw new ClientNotInGroupException(client.getId(), getId()); + } } return differences; - } - + } + private String[] getClientIds(final Set clients) { - String[] clientIds = new String[clients.size()]; - Iterator it = clients.iterator(); + final String[] clientIds = new String[clients.size()]; + final Iterator it = clients.iterator(); for (int i = 0; it.hasNext(); i++) { clientIds[i] = it.next().getId().toString(); } @@ -385,15 +383,17 @@ public final class Group extends AbstractPersistable { public boolean isCenter() { return this.groupLevel.isCenter(); } - - public boolean isTransferInProgress () { + + public boolean isTransferInProgress() { return GroupingTypeStatus.fromInt(this.status).isTransferInProgress(); } - - public boolean isChildClient(final Long clientId){ + + public boolean isChildClient(final Long clientId) { if (clientId != null && this.clientMembers != null && !this.clientMembers.isEmpty()) { - for (Client client : this.clientMembers) { - if(client.getId().equals(clientId)) return true; + for (final Client client : this.clientMembers) { + if (client.getId().equals(clientId)) { + return true; + } } } return false;