Project: Birt
Bug 240431 [Regression]Aggregation Function without required argument leads ArrayIndexOutOfBoundsException
Reported: 2008-07-10 21:43:02 | Status: closed fixed

Description: If do not specify the required argument in Aggregation Function like PERCENTILE, it will leads ArrayIndexOutOfBoundsException Build number: 2.3.1.v20080711-0630 Steps to reproduce: 1, Create a PERCENTILE aggregation function 2, Do not specify the argument of percentage 3, Preview Expected result: Throws out proper exception Actual result: ArrayIndexOutOfBoundsException occurs Error log: org.eclipse.birt.report.service.api.ReportServiceException: Error happened while running the report.; nested exception is: java.lang.ArrayIndexOutOfBoundsException: 1 org.eclipse.birt.data.engine.executor.aggregation.AggregationHelper.evaluateArgsValue(AggregationHelper.java:439) org.eclipse.birt.data.engine.executor.aggregation.AggregationHelper.onRow(AggregationHelper.java:343) org.eclipse.birt.data.engine.executor.aggregation.AggregationHelper.pass(AggregationHelper.java:184) org.eclipse.birt.data.engine.executor.aggregation.AggregationHelper.calculate(AggregationHelper.java:147) org.eclipse.birt.data.engine.executor.aggregation.AggregationHelper.populateAggregations(AggregationHelper.java:109) org.eclipse.birt.data.engine.executor.aggregation.AggregationHelper.(AggregationHelper.java:86) org.eclipse.birt.data.engine.executor.transform.pass.PassManager.populateAggregationInBinding(PassManager.java:148) org.eclipse.birt.data.engine.executor.transform.pass.PassManager.pass(PassManager.java:131) org.eclipse.birt.data.engine.executor.transform.pass.PassManager.populateResultSet(PassManager.java:71) org.eclipse.birt.data.engine.executor.transform.ResultSetPopulator.populateResultSet(ResultSetPopulator.java:196) org.eclipse.birt.data.engine.executor.transform.CachedResultSet.(CachedResultSet.java:86) org.eclipse.birt.data.engine.executor.DataSourceQuery.execute(DataSourceQuery.java:691) org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:331) org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:903) org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:233) org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:160) org.eclipse.birt.report.engine.data.dte.QueryResultSet.(QueryResultSet.java:92) org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:128) org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:248) org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1687) org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:77) org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)

Files changed in fix:
data/org.eclipse.birt.data.aggregation/src/org/eclipse/birt/data/aggregation/impl/rank/TotalPercentile.java data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/aggregation/TotalTest.java data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/aggregation/AggregationHelper.java