Bug 199714 NPE with invalid url[0002]
viewer/org.eclipse.birt.report.viewer/birt/WEB-INF/classes/org/eclipse/birt/report/service/BirtViewerReportService.java
* into service api parameters (ParameterDefinition and
	 * ParameterGroupDefinition)
	 * 
	 * @param params
	 *            a Collection of IScalarParameterDefn or IParameterGroupDefn
	 * @param includeGroups
	 *            if true, include groups (ParameterGroupDefinition) in the
	 *            result, otherwise flatten the result (i.e. include the
	 *            contents of the groups in the result)
	 * 
	 * @return a Collection of ParameterDefinition and ParameterGroupDefinition,
	 *         or a Collection of only ParameterDefinition if includeGroups ==
	 *         false
	 */
	private static Collection convertEngineParameters( Collection params,
			boolean includeGroups )
	{
		if ( params == null )
			return Collections.EMPTY_LIST;
		List ret = new ArrayList( );
		for ( Iterator it = params.iterator( ); it.hasNext( ); )
		{
			Object o = it.next( );
			if ( o instanceof IScalarParameterDefn )
			{
				IScalarParameterDefn engineParam = (IScalarParameterDefn) o;
				ParameterGroupDefinition group = null;
				ParameterDefinition param = convertScalarParameter(
						engineParam, group );
				ret.add( param );