The SummaryType method:
should return an Object.Code:public abstract double render(Object v, ModelData m, String field, Map<String, Object> data)
This allows for non-double based summaries like BigDecimal, max and min String or Date etc.
Also the implementations of SUM, AVG and COUNT should check for null values when going:
I would suggest use the same rules as SQL for nulls in SUM, AVG and COUNT.Code:((Number) m.get(field)).doubleValue()