Bug 144167 [Compatibility] Error occurs when preview an existing report design
Description: Preview an existing report design, error occurs. Error message: The following items have errors: report report: - Group key has unsupported data type: java.util.Date data.engine.BadGroupKeyType ( 1 time(s) ) detail : org.eclipse.birt.data.engine.core.DataException: Group key has unsupported data type: java.util.Date at org.eclipse.birt.data.engine.executor.transform.group.GroupByNumberRange.isSameGroup(GroupByNumberRange.java:73) at org.eclipse.birt.data.engine.executor.transform.group.GroupBy.isInSameGroup(GroupBy.java:142) at org.eclipse.birt.data.engine.executor.transform.group.GroupInformationUtil.getBreakLevel(GroupInformationUtil.java:507) at org.eclipse.birt.data.engine.executor.transform.group.GroupInformationUtil.doGrouping(GroupInformationUtil.java:440) at org.eclipse.birt.data.engine.executor.transform.SinglePassRowProcessor.pass(SinglePassRowProcessor.java:65) at org.eclipse.birt.data.engine.executor.transform.MultiPassRowProcessor.populateResultSet(MultiPassRowProcessor.java:302) at org.eclipse.birt.data.engine.executor.transform.MultiPassRowProcessor.doPopulation(MultiPassRowProcessor.java:137) at org.eclipse.birt.data.engine.executor.transform.MultiPassRowProcessor.pass(MultiPassRowProcessor.java:103) at org.eclipse.birt.data.engine.executor.transform.ResultSetPopulator.populateResultSet(ResultSetPopulator.java:206) at org.eclipse.birt.data.engine.executor.transform.CachedResultSet.<init>(CachedResultSet.java:69) at org.eclipse.birt.data.engine.executor.DataSourceQuery.execute(DataSourceQuery.java:485) at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.executeOdiQuery(PreparedOdaDSQuery.java:257) at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:677) at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:146) at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:155) at org.eclipse.birt.report.engine.data.dte.DteResultSet.<init>(DteResultSet.java:79) at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:113) at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:214) at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:204) at org.eclipse.birt.report.engine.executor.QueryItemExecutor.openResultSet(QueryItemExecutor.java:62) at org.eclipse.birt.report.engine.executor.ListItemExecutor.execute(ListItemExecutor.java:79) at org.eclipse.birt.report.engine.executor.ReportExecutorVisitor.visitListItem(ReportExecutorVisitor.java:98) at org.eclipse.birt.report.engine.ir.ListItemDesign.accept(ListItemDesign.java:125) at org.eclipse.birt.report.engine.executor.ReportExecutor.execute(ReportExecutor.java:129) at org.eclipse.birt.report.engine.executor.ReportExecutor.execute(ReportExecutor.java:89) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:171) at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(Unknown Source) at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(Unknown Source) at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(Unknown Source) at org.eclipse.birt.report.service.actionhandler.BirtRunAndRenderActionHandler.__execute(Unknown Source) at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(Unknown Source) at org.eclipse.birt.report.presentation.aggregation.layout.EngineFragment.doService(Unknown Source) at org.eclipse.birt.report.presentation.aggregation.AbstractBaseFragment.service(Unknown Source) at org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(Unknown Source) at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGet(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.eclipse.tomcat.internal.EclipseErrorReportValve.invoke(EclipseErrorReportValve.java:153) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534)
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/transform/group/GroupBy.java
* @param columnType
	 * @return GroupBy
	 * @throws DataException
	 */
	public static GroupBy newInstance( GroupSpec groupDefn, int columnIndex, String columnName,
			Class columnType ) throws DataException
	{
		assert groupDefn != null;
		GroupBy groupBy = null;
		
		switch ( groupDefn.getInterval( ) )
		{
			case GroupSpec.NO_INTERVAL :
				groupBy = new GroupByDistinctValue( );
				break;
			case GroupSpec.STRING_PREFIX_INTERVAL :
				if ( isString( columnType ) )
					groupBy = new GroupByStringRange( groupDefn );
				else
					throw new DataException( ResourceConstants.BAD_GROUP_INTERVAL_TYPE,
							new Object[]{
									"string prefix", columnType.getName( )
							} );
				break;
			default :
				groupBy = new GroupByNumberRange( groupDefn );
				break;
		}
		groupBy.groupSpec = groupDefn;
		groupBy.columnIndex = columnIndex;