JDK-6388998 : CachedRowSetWriter NPE on deleteOriginalRow with null vals
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.sql
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-02-22
  • Updated: 2010-08-13
  • Resolved: 2007-07-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u4 b01Fixed
Description
FULL PRODUCT VERSION :
mustang early release

A DESCRIPTION OF THE PROBLEM :
CachedRowSetWriter function

    private boolean deleteOriginalRow(CachedRowSet crs, CachedRowSetImpl crsRes) throws SQLException {

does this:

            crsRes.moveToInsertRow();
            for (i = 1; i <= crs.getMetaData().getColumnCount(); i++) {
                if(!( ((origVals.getObject(i)).toString()).equals((rs.getObject(i)).toString()))) {
                   boolChanged = true;
                   crsRes.updateObject(i,origVals.getObject(i));
               } else {
                   crsRes.updateNull(i);
               }
            }

If any of the field values are null, this code will throw NullPointerExceptions, incorrectly.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
delete a cached row set record that has a null field


REPRODUCIBILITY :
This bug can be reproduced always.

Comments
EVALUATION Null value to be checked for before update.
12-09-2006

EVALUATION should be fixed in an upcoming SE 6 update release. Not a showstopper
30-08-2006