Bug 152929 engine multi-thread issues
render reports in multi-thread, following exceptions were thrown out in console, java.lang.NullPointerException at java.io.Reader.<init>(Reader.java:61) at java.io.InputStreamReader.<init>(InputStreamReader.java:80) at java.util.Properties.load(Properties.java:266) at org.eclipse.birt.report.engine.parser.HTMLTextParser.<init>(HTMLTextParser.java:108) at org.eclipse.birt.report.engine.parser.TextParser.parse(TextParser.java:111) at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.processForeignData(HTML2Content.java:196) at org.eclipse.birt.report.engine.layout.pdf.util.HTML2Content.html2Content(HTML2Content.java:181) at org.eclipse.birt.report.engine.layout.pdf.PDFLayoutManagerFactory$ContentVisitor.visitForeign(PDFLayoutManagerFactory.java:182) at org.eclipse.birt.report.engine.content.impl.ForeignContent.accept(ForeignContent.java:56) at org.eclipse.birt.report.engine.layout.pdf.PDFLayoutManagerFactory.createLayoutManager(PDFLayoutManagerFactory.java:79) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.layoutChildNode(PDFBlockStackingLM.java:93) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.traverseChildren(PDFBlockStackingLM.java:75) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildren(PDFStackingLM.java:130) at org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layout(PDFAbstractLM.java:134) at org.eclipse.birt.report.engine.layout.pdf.PDFRowLM.traverseChildren(PDFRowLM.java:117) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildren(PDFStackingLM.java:130) at org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layout(PDFAbstractLM.java:134) at org.eclipse.birt.report.engine.layout.pdf.PDFRowLM.layout(PDFRowLM.java:51) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.layoutChildNode(PDFBlockStackingLM.java:95) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.traverseChildren(PDFBlockStackingLM.java:75) at org.eclipse.birt.report.engine.layout.pdf.PDFTableBandLM.traverseChildren(PDFTableBandLM.java:98) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildren(PDFStackingLM.java:130) at org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layout(PDFAbstractLM.java:134) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.layoutChildNode(PDFBlockStackingLM.java:95) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.traverseChildren(PDFBlockStackingLM.java:75) at org.eclipse.birt.report.engine.layout.pdf.PDFTableLM.traverseChildren(PDFTableLM.java:146) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildren(PDFStackingLM.java:130) at org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layout(PDFAbstractLM.java:134) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.layoutChildNode(PDFBlockStackingLM.java:95) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.traverseChildren(PDFBlockStackingLM.java:75) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildren(PDFStackingLM.java:130) at org.eclipse.birt.report.engine.layout.pdf.PDFPageLM.layout(PDFPageLM.java:198) at org.eclipse.birt.report.engine.layout.pdf.PDFReportLayoutEngine.layoutReport(PDFReportLayoutEngine.java:55) at org.eclipse.birt.report.engine.layout.pdf.PDFReportLayoutEngine.layout(PDFReportLayoutEngine.java:68) at org.eclipse.birt.report.engine.api.impl.RenderTask.doRender(RenderTask.java:221) at org.eclipse.birt.report.engine.api.impl.RenderTask$PageRender.render(RenderTask.java:635) at org.eclipse.birt.report.engine.api.impl.RenderTask.render(RenderTask.java:566) at org.eclipse.birt.test.performance.RenderThread.run(RenderThread.java:167)
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/parser/HTMLTextParser.java
*
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/
package org.eclipse.birt.report.engine.parser;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
import org.w3c.tidy.Tidy;
/**
 * Parse the content of text according to the HTML specification to get the DOM
 * tree.
 * <p>
 * After parsing, the DOM tree has a <code>Document</code> node that has a
 * <code>Element</code> child node whose tag name is body. All other nodes
 * that need to be processed to output are the descendant nodes of "body" node.
 * <p>
 * 
 * @version $Revision: 1.8 $ $Date: 2005/12/23 06:37:23 $
 */
public class HTMLTextParser