United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6388998 CachedRowSetWriter NPE on deleteOriginalRow with null vals
JDK-6388998 : CachedRowSetWriter NPE on deleteOriginalRow with null vals

Details
Type:
Bug
Submit Date:
2006-02-22
Status:
Resolved
Updated Date:
2010-08-13
Project Name:
JDK
Resolved Date:
2007-07-11
Component:
core-libs
OS:
windows_xp
Sub-Component:
javax.sql
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
6u4 (b01)

Related Reports

Sub Tasks

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

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

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



Hardware and Software, Engineered to Work Together