Project: Birt
Bug 159244 IndexOutOfBoundsException when run and render report with multiple pages.
Reported: 2006-09-29 04:50:24 | Status: closed fixed

Description: IndexOutOfBoundsException when run and render report without multiple pages. See ReportItemVisitor.link() method in EngineIRReader class. Inner loop should use j instead of i. I means masterPage.getHeader( j ) and masterPage.getFooter(j) instead of i. Expected result: No exception. Actual result: Error log: &#20005;&#37325;: Failed to get the report runnable java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.RangeCheck(ArrayList.java:507) at java.util.ArrayList.get(ArrayList.java:324) at org.eclipse.birt.report.engine.ir.SimpleMasterPageDesign.getHeader(SimpleMasterPageDesign.java:182) at org.eclipse.birt.report.engine.ir.EngineIRReader$ReportItemVisitor.link(EngineIRReader.java:1351) at org.eclipse.birt.report.engine.ir.EngineIRReader.link(EngineIRReader.java:104) at org.eclipse.birt.report.engine.api.impl.ReportDocumentReader.getReportRunnable(ReportDocumentReader.java:397) at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.createRenderTask(ReportEngineHelper.java:457) at org.eclipse.birt.report.engine.api.impl.ReportEngine.createRenderTask(ReportEngine.java:378) at org.eclipse.birt.report.tests.engine.EngineCase.render(EngineCase.java:552) at org.eclipse.birt.report.tests.engine.EngineCase.render_HTML(EngineCase.java:523) at org.eclipse.birt.report.tests.engine.EngineCase.runAndThenRender(EngineCase.java:613) at org.eclipse.birt.report.tests.engine.api.IAutoTextContentTest.testAutoTextContentFromReport(IAutoTextContentTest.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) This bug is found in IAutoTextContentTest.java

Files changed in fix:
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/ir/EngineIRReader.java