Bug 155262 Total.countDistinct() method returns null on empty resultset
If you use Total.countDistinct(row.aColumn, null, 0) or Total.countDistinct(dataSetRow.aColumn, null, 0) and the resultset for the dataset is empty, the method returns null. It should return 0.
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/aggregation/JSAggrValueObject.java
return new Integer( 0 );
			else
				return null;
		}
		try
		{
			int groupIndex;
			if ( aggrInfo.aggregation.getType( ) == IAggregation.SUMMARY_AGGR )
			{
				
				if ( aggrInfo.groupLevel == 0 )
					groupIndex = 0;
				else
					groupIndex = this.odiResult.getCurrentGroupIndex( aggrInfo.groupLevel );
			}
			else
			{
				groupIndex = this.odiResult.getCurrentResultIndex( );
			}
			return this.aggrValues[aggrIndex].get( groupIndex );
		}
		catch ( DataException e )
		{
			throw e;
		}
	}
	
	/**
	 * Gets information about one aggregate expression in the table, given its
	 * index