Bug 166758 [Regression] Link to a Date type parameter cause error.[07][0705]
Build number: 2.2.0 M3 2006-1205 Description: Dataset parameter link to a date type report parameter will cause error. Step to reporduce: 1. new parameter type: datetime Defualt value: 12/12/2006 2. new a sampledb datasource and dataset "select * from CLASSICMODELS.ORDERS where CLASSICMODELS.ORDERS.ORDERDATE<?" 3. in the patameter page link the patamet to the report patameter 4. preview in dataset editor Error log: org.eclipse.birt.data.engine.core.DataException: Cannot convert the parameter value 2006-12-12 00:00:00.0 GMT+0800 to type class java.util.Date. Can not convert the value of 2006-12-12 00:00:00.0 GMT+0800 to Date type. at org.eclipse.birt.data.engine.executor.DataSourceQuery.convertToValue(DataSourceQuery.java:701) at org.eclipse.birt.data.engine.executor.DataSourceQuery.addParameterDefns(DataSourceQuery.java:330) at org.eclipse.birt.data.engine.executor.DataSourceQuery.prepare(DataSourceQuery.java:255) at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.prepareOdiQuery(PreparedOdaDSQuery.java:344) at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:222) at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:396) at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:145) at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery.execute(PreparedOdaDSQuery.java:134) at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:125) at org.eclipse.birt.report.data.adapter.impl.QueryExecutionHelper.executeQuery(QueryExecutionHelper.java:108) at org.eclipse.birt.report.data.adapter.impl.DataRequestSessionImpl.executeQuery(DataRequestSessionImpl.java:205) at org.eclipse.birt.report.designer.data.ui.util.DataSetProvider.executeQuery(DataSetProvider.java:451) at org.eclipse.birt.report.designer.data.ui.util.DataSetProvider.execute(DataSetProvider.java:301) at org.eclipse.birt.report.designer.data.ui.util.DataSetProvider.execute(DataSetProvider.java:264) at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage.executeProcess(ResultSetPreviewPage.java:280) at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage.runUpdateResults(ResultSetPreviewPage.java:248) at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage.access$1(ResultSetPreviewPage.java:232) at org.eclipse.birt.report.designer.data.ui.dataset.ResultSetPreviewPage$4.runInUIThread(ResultSetPreviewPage.java:225) at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.birt.report.designer.internal.ui.dialogs.BaseDialog.open(BaseDialog.java:95) at org.eclipse.birt.report.designer.internal.ui.views.data.providers.DataSetNodeProvider.performEdit(DataSetNodeProvider.java:192) at org.eclipse.birt.report.designer.internal.ui.views.DefaultNodeProvider.performRequest(DefaultNodeProvider.java:363) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.birt.report.designer.ui.views.ElementAdapterInvocationHandler.invoke(ElementAdapterInvocationHandler.java:90) at $Proxy0.performRequest(Unknown Source) at org.eclipse.birt.report.designer.internal.ui.views.actions.EditAction.doAction(EditAction.java:80) at org.eclipse.birt.report.designer.internal.ui.views.actions.AbstractElementAction.run(AbstractElementAction.java:64) at org.eclipse.birt.report.designer.internal.ui.views.RenameListener.doubleClick(RenameListener.java:211) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:796) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:843) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:794) at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1227) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1158) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:223) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:220) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:281) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) 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(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Caused by: org.eclipse.birt.core.exception.CoreException: Can not convert the value of 2006-12-12 00:00:00.0 GMT+0800 to Date type. at org.eclipse.birt.core.data.DataTypeUtil.toDate(DataTypeUtil.java:504) at org.eclipse.birt.core.data.DataTypeUtil.toDate(DataTypeUtil.java:923) at org.eclipse.birt.core.data.DataTypeUtil.toDate(DataTypeUtil.java:380) at org.eclipse.birt.core.data.DataTypeUtil.convert(DataTypeUtil.java:141) at org.eclipse.birt.data.engine.executor.DataSourceQuery.convertToValue(DataSourceQuery.java:697)
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/ParameterUtil.java
* @param scope
	 */
	ParameterUtil( IQueryService outerResults, DataSetRuntime dsRT,
			IQueryDefinition queryDefn, Scriptable scope )
	{
		this.outerResults = outerResults;
		this.dsRT = dsRT;
		this.queryDefn = queryDefn;
		this.scope = scope;
	}
	
	/**
	 * Resolve parameter bindings and return a Collection of ParameterHints, which merged information obtained
	 * from query parameter binding and the data set parameter definition
	 * 
	 */
	Collection resolveDataSetParameters( boolean evaluateValue )
			throws DataException
	{
		List paramDefns = this.dsRT.getParameters( );
		int nParams = paramDefns == null ? 0 : paramDefns.size( );
		
		
		ParameterHint[] paramHints = new ParameterHint[nParams];
		
		boolean[] bindingResolved = new boolean[nParams];
		
		 
		for ( int i = 0; i < nParams; i++ )
		{