NPE in MockResultSet.isRowEqual()
Brought to you by:
aibba
When calling MockResultSet.isRowEqual(int number, List rowData) with a row that contain a null column, a NullPointerException is thrown on the following line:
if(!source.getClass().isAssignableFrom(target.getClass()) && target.getClass().isAssignableFrom(source.getClass()))
The fix appears to be to change the line to:
if(source != null && target != null &&
!source.getClass().isAssignableFrom(target.getClass()) &&
!target.getClass().isAssignableFrom(source.getClass()))
This skips the assigning to string, and ParameterUtils.compareParameter() correctly compares the null values.
This fix works for the code where I found the problem.
Logged In: YES
user_id=804648
Originator: NO
Yes this is a bug. Thanks. I'll fix it using your suggestion (which should also applied to isColumnEqual()).