Bug 179133 Out of bounds chart exception when rendering a report using multiple threads
An out of bounds ChartException occurs when rendering reports using multiple threads. This was seen multiple times when running the performance test in org.eclipse.birt.test.performance project. To reproduce this exception, run the test after increasing the threads to 50 in case-10threads-pdf in org.eclipse.birt.test.performance/config.xml. Stack trace: WARNING: Exception org.eclipse.birt.chart.exception.ChartException: $NO-RB$ org.eclipse.birt.chart. exception.ChartException: Out of bounds at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1236) at org.eclipse.birt.chart.reportitem.ChartReportItemPresentationImpl.onR owSets(ChartReportItemPresentationImpl.java:477) at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.p rocessExtendedContent(LocalizedContentVisitor.java:638) at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.v isitForeign(LocalizedContentVisitor.java:343) at org.eclipse.birt.report.engine.content.impl.ForeignContent.accept(For eignContent.java:59) at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.l ocalize(LocalizedContentVisitor.java:99) at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReport ItemExecutor.execute(LocalizedReportItemExecutor.java:38) at org.eclipse.birt.report.engine.layout.content.BlockStackingExecutor.g etNextChild(BlockStackingExecutor.java:47) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.traverse Children(PDFBlockStackingLM.java:86) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildre n(PDFStackingLM.java:118) at org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layout(PDFAbs tractLM.java:132) at org.eclipse.birt.report.engine.layout.pdf.PDFRowLM.traverseChildren(P DFRowLM.java:123) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildre n(PDFStackingLM.java:118) at org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layout(PDFAbs tractLM.java:132) at org.eclipse.birt.report.engine.layout.pdf.PDFRowLM.layout(PDFRowLM.ja va:51) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.layoutCh ildNode(PDFBlockStackingLM.java:109) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.traverse Children(PDFBlockStackingLM.java:89) at org.eclipse.birt.report.engine.layout.pdf.PDFTableBandLM.traverseChil dren(PDFTableBandLM.java:97) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildre n(PDFStackingLM.java:118) at org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layout(PDFAbs tractLM.java:132) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.layoutCh ildNode(PDFBlockStackingLM.java:109) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.traverse Children(PDFBlockStackingLM.java:89) at org.eclipse.birt.report.engine.layout.pdf.PDFGroupLM.traverseChildren (PDFGroupLM.java:29) at org.eclipse.birt.report.engine.layout.pdf.PDFTableGroupLM.traverseChi ldren(PDFTableGroupLM.java:41) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildre n(PDFStackingLM.java:118) at org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layout(PDFAbs tractLM.java:132) at org.eclipse.birt.report.engine.layout.pdf.PDFTableGroupLM.layout(PDFT ableGroupLM.java:61) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.layoutCh ildNode(PDFBlockStackingLM.java:109) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.traverse Children(PDFBlockStackingLM.java:89) at org.eclipse.birt.report.engine.layout.pdf.PDFTableLM.traverseChildren (PDFTableLM.java:157) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildre n(PDFStackingLM.java:118) at org.eclipse.birt.report.engine.layout.pdf.PDFAbstractLM.layout(PDFAbs tractLM.java:132) at org.eclipse.birt.report.engine.layout.pdf.PDFBlockStackingLM.traverse Children(PDFBlockStackingLM.java:68) at org.eclipse.birt.report.engine.layout.pdf.PDFStackingLM.layoutChildre n(PDFStackingLM.java:118) at org.eclipse.birt.report.engine.layout.pdf.PDFPageLM.layout(PDFPageLM. java:199) at org.eclipse.birt.report.engine.layout.pdf.PDFReportLayoutEngine.layou tReport(PDFReportLayoutEngine.java:56) at org.eclipse.birt.report.engine.layout.pdf.PDFReportLayoutEngine.layou t(PDFReportLayoutEngine.java:72) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAnd RenderTask.java:225) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRe nderTask.java:147) at org.eclipse.birt.test.performance.RunRenderThread.run(RunRenderThread .java:138) Caused by: java.lang.RuntimeException: org.eclipse.birt.chart.exception.ChartExc eption: Out of bounds at org.eclipse.birt.chart.computation.DataSetIterator.next(DataSetIterat or.java:448) at org.eclipse.birt.chart.render.AxesRenderHelper$TextAxisTypeComputatio n.handlePreEachTick(AxesRenderHelper.java:416) at org.eclipse.birt.chart.render.AxesRenderHelper.renderHorizontalAxisBy Type(AxesRenderHelper.java:814) at org.eclipse.birt.chart.render.AxesRenderHelper.renderEachAxis(AxesRen derHelper.java:1679) at org.eclipse.birt.chart.render.AxesRenderer.renderEachAxis(AxesRendere r.java:2915) at org.eclipse.birt.chart.render.AxesRenderer.renderAxesLabels(AxesRende rer.java:2156) at org.eclipse.birt.chart.render.AxesRenderer.renderPlot(AxesRenderer.ja va:2278) at org.eclipse.birt.chart.render.AxesRenderer.render(AxesRenderer.java:2 88) at org.eclipse.birt.chart.factory.Generator.render(Generator.java:1231) ... 39 more Caused by: org.eclipse.birt.chart.exception.ChartException: Out of bounds at org.eclipse.birt.chart.computation.DataSetIterator.next(DataSetIterat or.java:451) ... 47 more
chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/render/AxesRenderer.java
protected void restoreClipping( final IPrimitiveRenderer ipr )
			throws ChartException
	{
		if ( !isShowOutside( ) )
		{
			flushClipping( );
			ClipRenderEvent clip = new ClipRenderEvent( this );
			clip.setVertices( null );
			ipr.setClip( clip );
		}
	}
	
	/**
	 * Flushes specified types of rendering for clipping.
	 * 
	 * @throws ChartException
	 */
	protected void flushClipping( ) throws ChartException
	{
		getDeferredCache( ).flushOptions( DeferredCache.FLUSH_LINE
				| DeferredCache.FLUSH_PLANE );
	}
	
	/**
	 * Checks data point entry by types
	 * 
	 * @param scale
	 *            AutoScale for min/max value
	 * @param entry
	 *            data point entry