https://issues.apache.org/bugzilla/show_bug.cgi?id=53526
Priority: P2
Bug ID: 53526
Assignee: [email protected]
Summary: .ConnectionPool.terminateTransaction unsafe == check
of Boolean
Severity: normal
Classification: Unclassified
OS: Windows XP
Reporter: [email protected]
Hardware: PC
Status: NEW
Version: unspecified
Component: jdbc-pool
Product: Tomcat Modules
The method ConnectionPool.terminateTransaction(PooledConnection con) uses == to
check the value of a Boolean, viz:
if (con.getPoolProperties().getDefaultAutoCommit()==Boolean.FALSE) {
This is not 100% safe - if the user sets the property as follows:
String value; // e.g. derived from property file
...
setDefaultAutoCommit(new Boolean(value));
then the condition will never be true, even if value="false".
Although it is better to use Boolean.valueOf(value), which would not have the
same problem, the code ought to work regardless.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]