package com.adms.imex.util;

import java.beans.XMLDecoder;
import java.beans.XMLEncoder;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

public class ObjectUtil {

	public static Object deepClone(Object fromBean)
	{
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		XMLEncoder out = new XMLEncoder(bos);
		out.writeObject(fromBean);
		out.close();
		ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
		XMLDecoder in = new XMLDecoder(bis);
		Object toBean = in.readObject();
		in.close();
		return toBean;
	}
}

@@ -185,16 +185,163 @@
 Util %7B%0A%0A
+%09/**%0A%09 * Returns a deeply cloned java bean.%0A%09 *%0A%09 * @param fromBean java bean to be cloned.%0A%09 * @return a new java bean cloned from fromBean.%0A%09 */%0A
 %09public 

clean code