Issue Details (XML | Word | Printable)

Key: DBUTILS-32
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Henri Yandell
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons DbUtils

Tests fail to build under 1.6, and warning while compiling source

Created: 09/Jul/06 12:02 AM   Updated: 02/Jan/08 07:29 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 1.1

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works patch-DBUTILS-32.txt 2006-11-01 03:27 PM Alan B. Canon 2 kB
Text File Licensed for inclusion in ASF works patch.txt 2006-11-01 03:22 PM Alan B. Canon 2 kB

Resolution Date: 01/Nov/06 05:35 PM


 Description  « Hide
test:compile:
[javac] Compiling 20 source files to /home/hen/apache/jakarta/commons-proper/dbutils/target/test-classes
/home/hen/apache/jakarta/commons-proper/dbutils/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java:841: org.apache.commons.dbutils.wrappers.SqlNullCheckedResultSetMockBlob is not abstract and does not override abstract method getBinaryStream(long,long) in java.sql.Blob
class SqlNullCheckedResultSetMockBlob implements Blob {
^
/home/hen/apache/jakarta/commons-proper/dbutils/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java:882: org.apache.commons.dbutils.wrappers.SqlNullCheckedResultSetMockClob is not abstract and does not override abstract method getCharacterStream(long,long) in java.sql.Clob
class SqlNullCheckedResultSetMockClob implements Clob {

and warning of:

[javac] Compiling 20 source files to /home/hen/apache/jakarta/commons-proper/dbutils/target/classes
/home/hen/apache/jakarta/commons-proper/dbutils/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java:372: warning: non-varargs call of varargs method with inexact argument type for last parameter;
cast to java.lang.Object for a varargs call
cast to java.lang.Object[] for a non-varargs call and to suppress this warning
? nullMethod.invoke(this, null)



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Henri Yandell made changes - 19/Jul/06 06:22 AM
Field Original Value New Value
Fix Version/s 1.1 [ 12311973 ]
Alan B. Canon added a comment - 31/Oct/06 06:01 PM
SqlNullCheckedResultSet.java can be fixed to avoid the compiler warning by changing the implementation of invoke() to read as follows.

public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable { Object result = method.invoke(this.rs, args); Method nullMethod = (Method) nullMethods.get(method.getName()); // 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, (Object[]) null) : result; }


Alan B. Canon added a comment - 31/Oct/06 06:17 PM
The compiler errors for the tests can be fixed by adding no-op implementations of the previously unimplemented methods, viz.:

class SqlNullCheckedResultSetMockClob implements Clob {

public void free() throws SQLException {
}

public Reader getCharacterStream(long pos, long length) throws SQLException { return null; }
}

class SqlNullCheckedResultSetMockBlob implements Blob {
public void free() throws SQLException {

}

public InputStream getBinaryStream(long pos, long length) throws SQLException { return null; } }
}


Henri Yandell added a comment - 31/Oct/06 07:28 PM
Any chance of a patch?

Alan B. Canon added a comment - 01/Nov/06 03:22 PM
Patch is attached resolving issues as described in previous comments.

Alan B. Canon made changes - 01/Nov/06 03:22 PM
Attachment patch.txt [ 12344102 ]
Alan B. Canon added a comment - 01/Nov/06 03:27 PM
Sorry, the previous patch addressed two separate issues. The present attachment resolves only DBUTILS-32 (the present issue)

Alan B. Canon made changes - 01/Nov/06 03:27 PM
Attachment patch-DBUTILS-32.txt [ 12344106 ]
Repository Revision Date User Message
ASF #470003 Wed Nov 01 17:33:50 UTC 2006 bayard Applying Alan Canon's patch for DBUTILS-32
Files Changed
MODIFY /jakarta/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
MODIFY /jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
MODIFY /jakarta/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java

Henri Yandell added a comment - 01/Nov/06 05:35 PM

Thanks Alan.

svn ci -m "Applying Alan Canon's patch for DBUTILS-32"

Sending src/java/org/apache/commons/dbutils/BeanProcessor.java
Sending src/java/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.java
Sending src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
Transmitting file data ...
Committed revision 470003.

I've also tested it under 1.6 on a Linux box (back to hating the Mac for not having 1.6).

Btw, good naming for patches would be 'DBUTILS-32.patch'. Not sure about the repeat though


Henri Yandell made changes - 01/Nov/06 05:35 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Henri Yandell made changes - 02/Jan/08 07:29 AM
Status Resolved [ 5 ] Closed [ 6 ]