ParameterDefnBase temp = ( ParameterDefnBase ) it.next( );
IParameterDefnBase temp = ( IParameterDefnBase ) it.next( );
	private Map getParameterSelectionLists( IViewerReportDesignHandle design,			Map params, InputOptions options ) throws ReportServiceException	{		if ( params == null || params.size( ) == 0 )			return new HashMap( );		List[] listArray = null;		Map ret = new HashMap( );		List remainingParamNames = new ArrayList( );		String firstName = ( String ) params.keySet( ).iterator( ).next( );		Collection paramDefs = getReportService( ).getParameterDefinitions(				design, options );		ParameterDefnBase paramDef = null;		for ( Iterator it = paramDefs.iterator( ); it.hasNext( ); )		{			ParameterDefnBase temp = ( ParameterDefnBase ) it.next( );			if ( temp.getName( ).equals( firstName ) )			{				paramDef = temp;				break;			}		}		if ( paramDef == null )		{			throw new ReportServiceException( "Invalid parameter: " + firstName );		}		String groupName = null;		ReportElementHandle element = paramDef.getHandle( );		assert element != null;		if ( element.getContainer( ) instanceof CascadingParameterGroupHandle )		{			CascadingParameterGroupHandle groupHandle = ( CascadingParameterGroupHandle ) element					.getContainer( );			groupName = groupHandle.getName( );			if ( groupHandle.getParameters( ).getCount( ) > params.size( ) )			{				int remainingParams = groupHandle.getParameters( ).getCount( )						- params.size( );				for ( int i = 0; i < remainingParams; i++ )				{					remainingParamNames.add( groupHandle.getParameters( ).get(							params.size( ) + i ).getName( ) );				}			}			if ( groupName == null )			{				throw new ReportServiceException(						"Can not find cascade parameter group name." );			}		}		// Query all lists.		try		{			if ( remainingParamNames.size( ) > 0 )			{				listArray = new List[remainingParamNames.size( )];				for ( int k = 0; k < remainingParamNames.size( ); k++ )				{					Object[] keyValue = new Object[params.size( ) + k];					Set values = params.keySet( );					int i = 0;					for ( Iterator it = values.iterator( ); it.hasNext( ); )					{						keyValue[i] = params.get( it.next( ) );						i++;					}					for ( i = 0; i < k; i++ )					{						keyValue[params.size( ) + i] = listArray[i].get( 0 );					}					ret.put( remainingParamNames.get( k ),							doQueryCascadeParameterSelectionList( design,									groupName, keyValue ) );				}			}		}		catch ( RemoteException e )		{			throw new ReportServiceException( e.getLocalizedMessage( ) );		}		return ret;	}