Bug 314631 Cann't get correct default values for parameters that with non-constant default value expressions
Steps to reproduce: 1. create a report with a scalar parameter that has non-constant default value expression such as BirtDateTime.today() 2. setup a project to get the default values of the parameter in BIRT runtime Eg. IReportEngine engine = createReportEngine( ); IRunnable runnable = engine.openReportDesign( REPORT_DESIGN ); IGetParamaterDefinitionTask task = engine.createGetParameterDefinitionTask( runnable ); HashMap result = task.getDefaultValues(); Expect result: The result map contains a parameter name and default value pair in which the default value is a Date instance of today. Actural result: The default value is null.
engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/api/impl/GetParameterDefinitionTask.java
boolean fixedOrder = parameter.isFixedOrder( );
		boolean sortByLabel = "label".equalsIgnoreCase( parameter.getSortBy( ) );
		boolean sortDirectionValue = "asc".equalsIgnoreCase( parameter
				.getSortDirection( ) );
		String selectionMethod = parameter.getSelectionValueListMethod( );
		if ( selectionMethod != null )
		{
			try
			{
				Object result = executionContext.evaluate( selectionMethod );
				if ( result == null )
					return null;
				ArrayList choices = new ArrayList( );
				if ( result instanceof Collection )
				{
					Iterator iter = ( (Collection) result ).iterator( );
					while ( iter.hasNext( ) )
					{
						Object value = convertToType( iter.next( ), dataType );
						choices.add( new SelectionChoice( null, value ) );
					}
				}
				else if ( result.getClass( ).isArray( ) )
				{
					
					int count = Array.getLength( result );
					for ( int index = 0; index < count; index++ )
					{
						Object origValue = Array.get( result, index );
						Object value = convertToType( origValue, dataType );