db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1445) Add new streaming overloads and modify some existing ones.
Date Mon, 26 Jun 2006 10:03:32 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1445?page=comments#action_12417769 ] 

Kristian Waagan commented on DERBY-1445:
----------------------------------------

I had a look at the patch, and found some issues worth commenting.

[EmbedResultSet]
* updateAsciiStream(String,InputStream,int)
  JavaDoc - this was added in JDBC 2, not 4.
* updateBinaryStream(String,InputStream,int)
  JavaDoc - this was added in JDBC 2, not 4.
* updateCharacterStream(String,Reader,int)
  JavaDoc - this was added in JDBC 2, not 4.

[Tests]
The points below are my own preferences. The existing code works, but I
think it could be made a little easier to read by changing the things
below.

* Unless a specific error message is to be specified/given, there is no
  need to catch exceptions in a JUnit test when you don't take
  corrective actions. If an exception is thrown, the test will fail.

* Using an available assert-method where possible makes the test more
  compact, and the stacktrace/msg more descriptive. For instance,
  instead of
      if (str1.compareTo(str2) != 0)
          fail(errmsg)
  this could be used:
      assertEquals(errmsg, str1, str2);

[ResultSetTest]
* Duplicate comment in method 'testUpdateBinaryStream'.

* A lot of arrays with the same content are defined in multiple places.
  Could these be made static final and only be defined once?

* Whitespace change in 'tearDown'.

* Use assertEquals(String, byte, byte) in the for-loops comparing
  byte-values? Makes it a lot easier to immediatly spot what's wrong, as
  opposed to only getting the message "Error in updateXXXStream".

* No need/use to have 'return' after a 'fail(some-text)'.


A few general comments:
* End the first sentence of JavaDoc with a dot.

* Avoid inserting spaces at end of lines and on empty lines.


I think the patch can be committed when the tab-space issue commented by Knut Anders and the
incorrect JavaDoc are fixed.
It would be nice to get the other comments addressed as well.


Thanks!

>  Add new streaming overloads and modify some existing ones.
> -----------------------------------------------------------
>
>          Key: DERBY-1445
>          URL: http://issues.apache.org/jira/browse/DERBY-1445
>      Project: Derby
>         Type: New Feature

>   Components: JDBC
>     Reporter: V.Narayanan
>     Assignee: V.Narayanan
>  Attachments: JDBC40_long_length_overloads.diff, JDBC40_long_length_overloads.stat
>
> The task involves Adding and modifying the following methods, which were recently added
by the JDBC4 expert group and which appeared in Mustang build 86:
>         add PreparedStatement.setAsciiStream (int columnIndex, InputStream x, long length)
>   	add PreparedStatement.setBinaryStream (int columnIndex, InputStream x, long length
>   	add PreparedStatement.setCharacterStream (int columnIndex, Reader x, long length)
>   	add CallableStatement.setAsciiStream (String columnName, InputStream x, long length)
>   	add CallableStatement.setBinaryStream (String columnName, InputStream x, long length)
>   	add CallableStatement.setCharacterStream (String columnName, Reader x, long length)
>   	add ResultSet.updateAsciiStream (int columnIndex, InputStream x, long length)
>   	add ResultSet.updateBinaryStream (int columnIndex, InputStream x, long length)
>   	add ResultSet.updateCharacterStream (int columnIndex, Reader x, long length)
>   	add ResultSet.updateAsciiStream (String columnName, InputStream x, long length)
>   	add ResultSet.updateBinaryStream (String columnName, InputStream x, long length)
>   	add ResultSet.updateCharacterStream (String columnName, Reader x, long length)
>   	add ResultSet.updateBlob (int columnIndex, InputStream x, long length)
>   	add ResultSet.updateBlob (String columnName, InputStream x, long length)
>   	add ResultSet.updateClob (int columnIndex, Reader x, long length)
>   	add ResultSet.updateClob (String columnName, Reader x, long length)
>   	add ResultSet.updateNClob (int columnIndex, Reader x, long length)
>   	add ResultSet.updateNClob (String columnName, Reader x, long length)
>   	modify ResultSet.updateNCharacterStream(int columnIndex, Reader x, int length) to
ResultSet.updateNCharacterStream(int columnIndex, Reader x, long
>         length)
>   	modify ResultSet.updateNCharacterStream(String columnName, Reader x, int length) to
ResultSet.updateNCharacterStream(String columnName, 
>         Reader x, long length)

-- 
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


Mime
View raw message