Project: Birt
Bug 211175 ClassCastException thrown when implementing IReportItemQuery
Reported: 2007-11-28 03:15:26 | Status: resolved fixed

When implementing IReportItemQuery's method, public IDataQueryDefinition[] createReportQueries(IDataQueryDefinition parent) throws BirtException, even if the impl method returns IDataQueryDefinition[], ClassCastException will be thrown during preview, the error log is as follows: java.lang.ClassCastException: [Lorg.eclipse.birt.data.engine.api.IDataQueryDefinition; at org.eclipse.birt.report.engine.executor.ExtendedGenerateExecutor.generateContent(ExtendedGenerateExecutor.java:91) at org.eclipse.birt.report.engine.executor.ExtendedGenerateExecutor.execute(ExtendedGenerateExecutor.java:72) at org.eclipse.birt.report.engine.executor.ExtendedItemExecutor.execute(ExtendedItemExecutor.java:60) at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:42) If the method returns IBaseQueryDefinition[], it's ok. Look at the engine code, there's something wrong of class casting when generating content.

Files changed in fix:
chart/org.eclipse.birt.chart.reportitem/src/org/eclipse/birt/chart/reportitem/ChartReportItemGenerationProxy.java chart/org.eclipse.birt.chart.reportitem/src/org/eclipse/birt/chart/reportitem/ChartReportItemPresentationProxy.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/executor/ExtendedGenerateExecutor.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/extension/IReportItemGeneration.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/extension/IReportItemGenerationInfo.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/extension/IReportItemPresentation.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/extension/IReportItemPresentationInfo.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/extension/ReportItemGenerationBase.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/extension/ReportItemPresentationBase.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/extension/internal/ReportItemGenerationInfo.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/extension/internal/ReportItemPresentationInfo.java engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/presentation/LocalizedContentVisitor.java