Skip to content

Commit

Permalink
[GCI-142] Check bad code practices through Findbugs or Sonar and fix …
Browse files Browse the repository at this point in the history
…those issues (openmrs#3083)

null

GCI-142 minor fix

del xtra brace + deepcopy setters

GCI-142 fix travis
  • Loading branch information
ribhavsharma authored and dkayiwa committed Dec 18, 2019
1 parent 7ef7035 commit 627ffbf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions api/src/main/java/org/openmrs/CohortMembership.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ public void setPatientId(Integer patientId) {
}

public Date getStartDate() {
return startDate;
return startDate != null ? (Date) startDate.clone() : null;
}

public void setStartDate(Date startDate) {
this.startDate = startDate;
this.startDate = startDate != null ? new Date(startDate.getTime()) : null;
}

public Date getEndDate() {
return endDate;
return endDate != null ? (Date) endDate.clone() : null;
}

/**
Expand All @@ -112,9 +112,10 @@ public Date getEndDate() {
* @param endDate
*/
public void setEndDate(Date endDate) {
this.endDate = endDate;
this.endDate = endDate != null ? new Date(endDate.getTime()) : null;
}


/**
* Sorts by following fields, in order:
* <ol>
Expand Down

0 comments on commit 627ffbf

Please sign in to comment.