Bug 200755 [smoke]Fail to preview Crosstab after deploy BIRT in application servers.[0601][1102]
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/expression/AbstractExpressionCompiler.java
throw new DataException( ResourceConstants.INVALID_TOTAL_NAME,
					aggrFuncName );
		}
		return agg;
	}
	/**
	 * flatten out the tree when there are nested ComplexExpressions ( i.e.
	 * ComplexExpression with ComplexExpressions as sub expressions ) the
	 * nesting provides no additional information for the calculation to use.
	 * this nesting could occur depending on the Rhino parse tree that's
	 * returned by Rhino, and the limited way we can traverse down the parse
	 * tree.
	 * 
	 * @param complexExpr
	 */
	private void flattenNestedComplexExprs( ComplexExpression complexExpr )
	{
		ArrayList interestingSubExpr = new ArrayList();
		ArrayList interestingConstantExpr = new ArrayList();
		ArrayList tokenList = new ArrayList();
		
		Collection subExprs = complexExpr.getSubExpressions();
		Iterator iter = subExprs.iterator();
		while( iter.hasNext() )
		{
			CompiledExpression childExpr = (CompiledExpression) iter.next();
			if( childExpr instanceof ColumnReferenceExpression ||
				childExpr instanceof AggregateExpression )
				interestingSubExpr.add( childExpr );