From 40c30b52ce75415d4b0bcff618a1051bec64d98f Mon Sep 17 00:00:00 2001 From: Ray Gauss Date: Mon, 8 Oct 2012 21:29:09 +0000 Subject: [PATCH] ALF-16201: TransformationOptions Should Be More Easily Extended - Added copyFrom method which does the work of the copying and is called by clone() for cases where deepCopy() can't be called. - Added javadocs git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42454 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../cmr/repository/TransformationOptions.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/service/cmr/repository/TransformationOptions.java b/source/java/org/alfresco/service/cmr/repository/TransformationOptions.java index a422c9f1ee..209bf55f15 100644 --- a/source/java/org/alfresco/service/cmr/repository/TransformationOptions.java +++ b/source/java/org/alfresco/service/cmr/repository/TransformationOptions.java @@ -111,10 +111,26 @@ public class TransformationOptions implements Cloneable { TransformationOptions clone = (TransformationOptions) super.clone(); clone.limits = new TransformationOptionLimits(); - clone.set(toMap()); + clone.copyFrom(this); return clone; } + /** + * Does the work of copying the given other TransformationOptions + * values to this one + * + * @param otherOptions the options to copy + */ + public void copyFrom(TransformationOptions otherOptions) + { + this.set(otherOptions.toMap()); + } + + /** + * Creates a clone of the TransformationOptions + * + * @return a copy of the options + */ public TransformationOptions deepCopy() { try