commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r470003 - in /jakarta/commons/proper/dbutils/trunk/src: java/org/apache/commons/dbutils/ java/org/apache/commons/dbutils/wrappers/ test/org/apache/commons/dbutils/wrappers/
Date Wed, 01 Nov 2006 17:33:51 GMT
Author: bayard
Date: Wed Nov  1 09:33:50 2006
New Revision: 470003

URL: http://svn.apache.org/viewvc?view=rev&rev=470003
Log:
Applying Alan Canon's patch for DBUTILS-32

Modified:
    jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java
    jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
    jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java

Modified: jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java?view=diff&rev=470003&r1=470002&r2=470003
==============================================================================
--- jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java
(original)
+++ jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java
Wed Nov  1 09:33:50 2006
@@ -225,6 +225,9 @@
             // Don't call setter if the value object isn't the right type 
             if (this.isCompatibleType(value, params[0])) {
                 setter.invoke(target, new Object[] { value });
+            } else {
+              throw new SQLException(
+                  "Cannot set " + prop.getName() + ": incompatible types.");
             }
 
         } catch (IllegalArgumentException e) {

Modified: jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java?view=diff&rev=470003&r1=470002&r2=470003
==============================================================================
--- jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
(original)
+++ jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
Wed Nov  1 09:33:50 2006
@@ -369,7 +369,7 @@
         // Check nullMethod != null first so that we don't call wasNull()
         // before a true getter method was invoked on the ResultSet.
         return (nullMethod != null && this.rs.wasNull())
-            ? nullMethod.invoke(this, null)
+            ? nullMethod.invoke(this, (Object[]) null)
             : result;
     }
 

Modified: jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java?view=diff&rev=470003&r1=470002&r2=470003
==============================================================================
--- jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
(original)
+++ jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
Wed Nov  1 09:33:50 2006
@@ -877,6 +877,14 @@
         return null;
     }
 
+    public void free() throws SQLException {
+      
+    }
+
+    public InputStream getBinaryStream(long pos, long length) throws SQLException {
+      return null;
+    }
+
 }
 
 class SqlNullCheckedResultSetMockClob implements Clob {
@@ -924,6 +932,14 @@
     public int setString(long pos, String str, int offset, int len)
         throws SQLException {
         return 0;
+    }
+
+    public void free() throws SQLException {
+
+    }
+
+    public Reader getCharacterStream(long pos, long length) throws SQLException {
+      return null;
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message