=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/typehandler/AggregationOperatorTypeHandler.java' --- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/typehandler/AggregationOperatorTypeHandler.java 2010-04-12 21:23:33 +0000 +++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/file/typehandler/AggregationOperatorTypeHandler.java 2010-11-16 14:52:41 +0000 @@ -29,6 +29,8 @@ import java.sql.SQLException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.hisp.dhis.dataelement.DataElement; import com.ibatis.sqlmap.client.extensions.ParameterSetter; @@ -46,7 +48,9 @@ private static final String JDBC_AVERAGE = "Avg"; private static final String JDBC_COUNT = "Count"; - static final Integer NON_EXISTING = -1; + private static final Integer NON_EXISTING = -1; + + private static final Log log = LogFactory.getLog( AggregationOperatorTypeHandler.class ); // ------------------------------------------------------------------------- // TypeHandlerCallback implementation @@ -73,12 +77,16 @@ } else { - throw new RuntimeException( "Illegal aggregation operator: " + result ); + log.warn( "Unknow aggregation operator, returning sum " + result ); + + return DataElement.AGGREGATION_OPERATOR_SUM; } } else { - throw new RuntimeException( "Aggregation operator is not present" ); + log.warn( "Aggregation operator is null, returning sum " + result ); + + return DataElement.AGGREGATION_OPERATOR_SUM; } }