JDK-6387021 : faulty guard logic in setMatchColumn(String columnName)
  • 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-17
  • 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 (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
EVALUATION This has to be changed to include a proper check for null.
12-09-2006

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