Primitive argument type cannot be null(in PropertyAccessPlan. setProperties)
-----------------------------------------------------------------------------
Key: IBATIS-351
URL: http://issues.apache.org/jira/browse/IBATIS-351
Project: iBatis for Java
Issue Type: Bug
Components: SQL Maps
Affects Versions: 2.2.0, 2.1.7
Reporter: qxo
ResultObject has a Primitive attribute and its result value is null,has
problem.
I fixed this proble as follow:
public void setProperties(Object object, Object[] values) {
int i = 0;
try {
Object[] arg = new Object[1];
for (i = 0; i < propertyNames.length; i++) {
arg[0] = values[i];
try {
final Class[] parameterTypes = setters[i].getParameterTypes();
if( null == arg[0] && parameterTypes[0].isPrimitive()){
//FIXME Primitive argument type cannot be null
return;
}
setters[i].invoke(object, arg);
} catch (Throwable t) {
throw ClassInfo.unwrapThrowable(t);
}
}
} catch (Throwable t) {
throw new RuntimeException("Error setting property '" +
setters[i].getName() + "' of '" +
object + "'. Cause: " + t, t);
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira