oshdb
oshdb copied to clipboard
MapAggregator.sum / NumberUtils.add don't support Long as Numeric type
Using MapAggregator.sum(x -> 1L) will result in a ClassCastException:
Exception in thread "main" java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Long (java.lang.Double and java.lang.Long are in module java.base of loader 'bootstrap')
at java.base/java.util.TreeMap.forEach(TreeMap.java:1002)
Reason is that NumericUtils.add defaults to type Double if input type is not (integer / float).