The code in BeanComparator.calculateModifications() create a clone of the source bean:
public static LscModifications calculateModifications(
Task task, IBean srcBean, IBean dstBean)
throws LscServiceException {
LscModifications lm = null;
// clone the source bean to work on it
IBean itmBean = cloneSrcBean(task, srcBean, dstBean);
// get modification type to perform
LscModificationType modificationType = calculateModificationType(task, srcBean, dstBean);
...
and just afterward, we also clone the source bean a second time in the calculateModificationType call:
public static LscModificationType calculateModificationType(Task task,
IBean srcBean, IBean dstBean) throws LscServiceException {
...
// we have the object in the source and the destination
// this must be either a MODIFY or MODRDN operation
// clone the source bean to calculate modifications on the DN
IBean itmBean = cloneSrcBean(task, srcBean, dstBean);
...
We can spare on of those two clones.
The code in
BeanComparator.calculateModifications()create a clone of the source bean:and just afterward, we also clone the source bean a second time in the
calculateModificationTypecall:We can spare on of those two clones.