Bug #24597 Null check after assuming non-null value.
Submitted: 26 Nov 2006 15:44 Modified: 19 Dec 2007 14:32
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:44] Nils Hammar
Description:
The variable typeInfo on line 222 in the file com.mysql.jdbc.DatabaseMetaData is checked for a null value after it is used.

How to repeat:
Compiler warning.

Suggested fix:
Move the condition to line 190. (side-effects may occur.)
[28 Nov 2006 12:24] Tonci Grgin
Hi Nils, can you please check my build log in Bug#24598 for details.
[28 Nov 2006 18:28] Nils Hammar
OK, more detailed:
The variable "typeInfo" in the file com.mysql.jdbc.DatabaseMetaData is used before it is checked for a 'null' value, and the usage before the checks will themselves render a NullPointerException if "typeInfo" was null, so the check is either not necessary or should have been done earlier.

This is in the constructor of the TypeDescriptor internal class.
[19 Dec 2007 14:32] Mark Matthews
5.1.x does a null check on this value before using it.