You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/01/07 13:06:52 UTC
svn commit: r1228600 -
/commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
Author: sebb
Date: Sat Jan 7 12:06:52 2012
New Revision: 1228600
URL: http://svn.apache.org/viewvc?rev=1228600&view=rev
Log:
Show why conversion failed
Modified:
commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
Modified: commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java?rev=1228600&r1=1228599&r2=1228600&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java (original)
+++ commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java Sat Jan 7 12:06:52 2012
@@ -252,7 +252,9 @@ public class BeanProcessor {
setter.invoke(target, new Object[]{value});
} else {
throw new SQLException(
- "Cannot set " + prop.getName() + ": incompatible types.");
+ "Cannot set " + prop.getName() + ": incompatible types, cannot convert "
+ + value.getClass().getName() + " to " + params[0].getName());
+ // value cannot be null here because isCompatibleType allows null
}
} catch (IllegalArgumentException e) {
@@ -277,7 +279,7 @@ public class BeanProcessor {
* of Integer into an int.
*
* @param value The value to be passed into the setter method.
- * @param type The setter's parameter type.
+ * @param type The setter's parameter type (non-null)
* @return boolean True if the value is compatible (null => true)
*/
private boolean isCompatibleType(Object value, Class<?> type) {