computerluca / lambdaj

Automatically exported from code.google.com/p/lambdaj
1 stars 0 forks source link

java.lang.ClassCastException has orrcued if list is empty for sum function #76

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. sum(myClassList, on(MyClass.class).getLongValue())
2. myClassList is empty.
3. "java.lang.ClassCastException: java.lang.Integer cannot be cast to 
java.lang.Long"
 has occurred. 

What is the expected output? What do you see instead?
No exception. 0L has to be returned for a sum function.

What version of the product are you using? On what operating system?
2.3.2

Please provide any additional information below.

Lambda.class#typedZero has to handle a java.lang.Long type.

if (numberClass == Long.class) return 0L;

Original issue reported on code.google.com by passion....@gmail.com on 12 Oct 2011 at 11:03

GoogleCodeExporter commented 8 years ago
Fixed in lambdaj 2.4

Original comment by mario.fu...@gmail.com on 29 Jan 2012 at 10:45