commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1228600 - /commons/proper/dbutils/trunk/src/main/java/org/apache/commons/dbutils/BeanProcessor.java
Date Sat, 07 Jan 2012 12:06:52 GMT
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) {



Mime
View raw message