United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6387021 faulty guard logic in setMatchColumn(String columnName)
JDK-6387021 : faulty guard logic in setMatchColumn(String columnName)

Details
Type:
Bug
Submit Date:
2006-02-17
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 (java.net)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
not needed

A DESCRIPTION OF THE PROBLEM :
In com.sun.rowset.CacheRowsetImpl and com.sun.rowset.JdbcRowsetImpl

   public void setMatchColumn(String columnName) throws SQLException {
        // validate, if col is ok to be set
        columnName = columnName.trim();
        if( columnName == "" || columnName.equals(null)) {
            throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols2").toString());

this guard

if( columnName == "" || columnName.equals(null)) {


is complelely bogus, if columnName is null both sides would cause a NullPointerException.



REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
SUGGESTED FIX

Non -critical can be fixed in in SE 6 update release
                                     
2006-08-30
EVALUATION

This has to be changed to include a proper check for null.
                                     
2006-09-12



Hardware and Software, Engineered to Work Together