remove invalid suppressings and issue found by ashok in savings.

This commit is contained in:
Keith Woodlock
2013-08-28 12:46:29 +01:00
parent b2644bee9d
commit 4ad25ce2ea
4 changed files with 28 additions and 40 deletions
@@ -28,7 +28,6 @@ public class ScheduledJobDetail extends AbstractPersistable<Long> {
@Column(name = "cron_expression") @Column(name = "cron_expression")
private String cronExpression; private String cronExpression;
@SuppressWarnings("unused")
@Column(name = "create_time") @Column(name = "create_time")
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Date createTime; private Date createTime;
@@ -39,7 +38,6 @@ public class ScheduledJobDetail extends AbstractPersistable<Long> {
@Column(name = "group_name") @Column(name = "group_name")
private String groupName; private String groupName;
@SuppressWarnings("unused")
@Column(name = "previous_run_start_time") @Column(name = "previous_run_start_time")
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Date previousRunStartTime; private Date previousRunStartTime;
@@ -51,7 +49,6 @@ public class ScheduledJobDetail extends AbstractPersistable<Long> {
@Column(name = "job_key") @Column(name = "job_key")
private String jobKey; private String jobKey;
@SuppressWarnings("unused")
@Column(name = "initializing_errorlog") @Column(name = "initializing_errorlog")
private String errorLog; private String errorLog;
@@ -61,7 +58,6 @@ public class ScheduledJobDetail extends AbstractPersistable<Long> {
@Column(name = "currently_running") @Column(name = "currently_running")
private boolean currentlyRunning; private boolean currentlyRunning;
@SuppressWarnings("unused")
@Column(name = "updates_allowed") @Column(name = "updates_allowed")
private boolean updatesAllowed; private boolean updatesAllowed;
@@ -162,7 +158,7 @@ public class ScheduledJobDetail extends AbstractPersistable<Long> {
return this.triggerMisfired; return this.triggerMisfired;
} }
public void updateTriggerMisfired(boolean triggerMisfired) { public void updateTriggerMisfired(final boolean triggerMisfired) {
this.triggerMisfired = triggerMisfired; this.triggerMisfired = triggerMisfired;
} }
@@ -18,37 +18,29 @@ public class ScheduledJobRunHistory extends AbstractPersistable<Long> {
@ManyToOne @ManyToOne
@JoinColumn(name = "job_id") @JoinColumn(name = "job_id")
@SuppressWarnings("unused")
private ScheduledJobDetail scheduledJobDetail; private ScheduledJobDetail scheduledJobDetail;
@Column(name = "version") @Column(name = "version")
@SuppressWarnings("unused")
private Long version; private Long version;
@Column(name = "start_time") @Column(name = "start_time")
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@SuppressWarnings("unused")
private Date startTime; private Date startTime;
@Column(name = "end_time") @Column(name = "end_time")
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
@SuppressWarnings("unused")
private Date endTime; private Date endTime;
@Column(name = "status") @Column(name = "status")
@SuppressWarnings("unused")
private String status; private String status;
@Column(name = "error_message") @Column(name = "error_message")
@SuppressWarnings("unused")
private String errorMessage; private String errorMessage;
@Column(name = "trigger_type") @Column(name = "trigger_type")
@SuppressWarnings("unused")
private String triggerType; private String triggerType;
@Column(name = "error_log") @Column(name = "error_log")
@SuppressWarnings("unused")
private String errorLog; private String errorLog;
public ScheduledJobRunHistory() { public ScheduledJobRunHistory() {
@@ -66,7 +66,7 @@ public class PortfolioAccountReadPlatformServiceImpl implements PortfolioAccount
case SAVINGS: case SAVINGS:
sql = "select " + this.savingsAccountMapper.schema() + " where sa.id = ?"; sql = "select " + this.savingsAccountMapper.schema() + " where sa.id = ?";
if (currencyCode != null) { if (currencyCode != null) {
sql += " and la.currency_code = ?"; sql += " and sa.currency_code = ?";
sqlParams = new Object[] {accountId, currencyCode}; sqlParams = new Object[] {accountId, currencyCode};
} }
@@ -38,7 +38,6 @@ import org.mifosplatform.infrastructure.core.service.DateUtils;
import org.mifosplatform.organisation.office.domain.Office; import org.mifosplatform.organisation.office.domain.Office;
import org.mifosplatform.organisation.staff.domain.Staff; import org.mifosplatform.organisation.staff.domain.Staff;
import org.mifosplatform.portfolio.client.domain.Client; 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.api.GroupingTypesApiConstants;
import org.mifosplatform.portfolio.group.exception.ClientExistInGroupException; import org.mifosplatform.portfolio.group.exception.ClientExistInGroupException;
import org.mifosplatform.portfolio.group.exception.ClientNotInGroupException; import org.mifosplatform.portfolio.group.exception.ClientNotInGroupException;
@@ -111,7 +110,8 @@ public final class Group extends AbstractPersistable<Long> {
LocalDate groupActivationDate = null; LocalDate groupActivationDate = null;
if (active) { if (active) {
status = GroupingTypeStatus.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); return new Group(office, staff, parent, groupLevel, name, externalId, status, groupActivationDate, clientMembers, groupMembers);
@@ -310,8 +310,8 @@ public final class Group extends AbstractPersistable<Long> {
public List<String> updateClientMembersIfDifferent(final Set<Client> clientMembersSet) { public List<String> updateClientMembersIfDifferent(final Set<Client> clientMembersSet) {
List<String> differences = new ArrayList<String>(); List<String> differences = new ArrayList<String>();
if (!clientMembersSet.equals(this.clientMembers)) { if (!clientMembersSet.equals(this.clientMembers)) {
Set<Client> diffClients = Sets.symmetricDifference(clientMembersSet, this.clientMembers); final Set<Client> diffClients = Sets.symmetricDifference(clientMembersSet, this.clientMembers);
String[] diffClientsIds = getClientIds(diffClients); final String[] diffClientsIds = getClientIds(diffClients);
if (diffClientsIds != null) { if (diffClientsIds != null) {
differences = Arrays.asList(diffClientsIds); differences = Arrays.asList(diffClientsIds);
} }
@@ -322,35 +322,33 @@ public final class Group extends AbstractPersistable<Long> {
} }
public List<String> associateClients(final Set<Client> clientMembersSet) { public List<String> associateClients(final Set<Client> clientMembersSet) {
List<String> differences = new ArrayList<String>(); final List<String> differences = new ArrayList<String>();
for (Client client : clientMembersSet) { for (final Client client : clientMembersSet) {
if(this.hasClientAsMember(client)){ if (hasClientAsMember(client)) { throw new ClientExistInGroupException(client.getId(), getId()); }
throw new ClientExistInGroupException(client.getId(), this.getId());
}
this.clientMembers.add(client); this.clientMembers.add(client);
differences.add(client.getId().toString()); differences.add(client.getId().toString());
} }
return differences; return differences;
} }
public List<String> disassociateClients(final Set<Client> clientMembersSet) { public List<String> disassociateClients(final Set<Client> clientMembersSet) {
List<String> differences = new ArrayList<String>(); final List<String> differences = new ArrayList<String>();
for (Client client : clientMembersSet) { for (final Client client : clientMembersSet) {
if(this.hasClientAsMember(client)){ if (hasClientAsMember(client)) {
this.clientMembers.remove(client); this.clientMembers.remove(client);
differences.add(client.getId().toString()); differences.add(client.getId().toString());
}else{ } else {
throw new ClientNotInGroupException(client.getId(), this.getId()); throw new ClientNotInGroupException(client.getId(), getId());
} }
} }
return differences; return differences;
} }
private String[] getClientIds(final Set<Client> clients) { private String[] getClientIds(final Set<Client> clients) {
String[] clientIds = new String[clients.size()]; final String[] clientIds = new String[clients.size()];
Iterator<Client> it = clients.iterator(); final Iterator<Client> it = clients.iterator();
for (int i = 0; it.hasNext(); i++) { for (int i = 0; it.hasNext(); i++) {
clientIds[i] = it.next().getId().toString(); clientIds[i] = it.next().getId().toString();
} }
@@ -385,15 +383,17 @@ public final class Group extends AbstractPersistable<Long> {
public boolean isCenter() { public boolean isCenter() {
return this.groupLevel.isCenter(); return this.groupLevel.isCenter();
} }
public boolean isTransferInProgress () { public boolean isTransferInProgress() {
return GroupingTypeStatus.fromInt(this.status).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()) { if (clientId != null && this.clientMembers != null && !this.clientMembers.isEmpty()) {
for (Client client : this.clientMembers) { for (final Client client : this.clientMembers) {
if(client.getId().equals(clientId)) return true; if (client.getId().equals(clientId)) {
return true;
}
} }
} }
return false; return false;