java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer in java 1.6
Use:
((Long) userService.getAttendanceList(currentUser)).intValue();
instead.
The .intValue()
method is defined in class Number
, which Long
extends.
The number of results can (theoretically) be greater than the range of an integer. I would refactor the code and work with the returned long value instead.