Bug 143173 No error for recursive including when exporting a report to a library
Steps to reproduce: 1.New a library named "Lib", add a lable in it 2.New a report, extends Lib.label 3.Export the report, choose target library "Lib" Expected result: Error to warn the recursive including Actual result: The target library includes itself without error
model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/util/ElementExportUtil.java
package org.eclipse.birt.report.model.api.util;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.DesignFileException;
import org.eclipse.birt.report.model.api.ErrorDetail;
import org.eclipse.birt.report.model.api.LibraryHandle;
import org.eclipse.birt.report.model.api.ReportDesignHandle;
import org.eclipse.birt.report.model.api.StructureHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException;
import org.eclipse.birt.report.model.core.DesignSession;
import org.eclipse.birt.report.model.elements.Library;
import org.eclipse.birt.report.model.parser.DesignParserException;
/**
 * Represents the utility class to help export element and structure to library
 * file. The element or structure to export must comply with the following rule:
 * <ul>
 * <li>Element must have name defined.
 * <li>The name property of strucure must have value.
 * <li>The element or structure must be contained in design file.
 * </ul>
 * 
 * Any violation will throw <code>IllegalArgumentException</code>.
 */
public class ElementExportUtil