Skip to content

Commit

Permalink
GCI-142 Fixed exposing internal representations of mutable Date objec…
Browse files Browse the repository at this point in the history
…ts in setters of BaseConceptMap (openmrs#3097)
  • Loading branch information
PermissionError authored and dkayiwa committed Dec 24, 2019
1 parent e78a888 commit 3bf1768
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/src/main/java/org/openmrs/BaseConceptMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ public Date getDateCreated() {
*/
@Override
public void setDateCreated(Date dateCreated) {
this.dateCreated = dateCreated;
if(dateCreated == null) {
this.dateCreated = null;
return;
}
this.dateCreated = new Date(dateCreated.getTime());
}

/**
Expand All @@ -109,7 +113,11 @@ public Date getDateChanged() {
*/
@Override
public void setDateChanged(Date dateChanged) {
this.dateChanged = dateChanged;
if(dateChanged == null) {
this.dateChanged = null;
return;
}
this.dateChanged = new Date(dateChanged.getTime());
}

}

0 comments on commit 3bf1768

Please sign in to comment.