Bug #24596 Possible NPE in code.
Submitted: 26 Nov 2006 15:40 Modified: 28 Nov 2006 12:33
Reporter: Nils Hammar Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:5.0.4 OS:Any (Any)
Assigned to: CPU Architecture:Any

[26 Nov 2006 15:40] Nils Hammar
Description:
In the file com.mysql.jdbc.DatabaseMetaData there are some cases of a potential NullPointerException:

Line 505:
		} else if (db != null & db.equals(procDb)) {

Line 540:
		} else if (db != null & db.equals(procDb)) {

How to repeat:
Compiler warning.

Suggested fix:
Line 505 should be:
		} else if (db != null && db.equals(procDb)) {

Line 540 should be:
		} else if (db != null && db.equals(procDb)) {

The difference is the double "&" which does a lazy evaluation.
[28 Nov 2006 12:33] Tonci Grgin
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html