From 9097faf0e2331782a4a5423a94308928880fa961 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 11 Sep 2013 14:36:41 +0200 Subject: [PATCH] Improve date setting. --- src/fr/devinsy/sikevadb/Element.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fr/devinsy/sikevadb/Element.java b/src/fr/devinsy/sikevadb/Element.java index 9180f0e..21f5adf 100644 --- a/src/fr/devinsy/sikevadb/Element.java +++ b/src/fr/devinsy/sikevadb/Element.java @@ -95,11 +95,15 @@ public class Element { } public void setArchiveDate(final Date archiveDate) { - this.archiveDate = archiveDate; + if (archiveDate == null) { + this.archiveDate = null; + } else { + this.archiveDate = (Date) archiveDate.clone(); + } } public void setCreationDate(final Date creationDate) { - this.creationDate = creationDate; + this.creationDate = (Date) creationDate.clone(); } public void setDigest(final String digest) { @@ -107,7 +111,7 @@ public class Element { } public void setEditionDate(final Date editionDate) { - this.editionDate = editionDate; + this.editionDate = (Date) editionDate.clone(); } public void setKey(final String key) {