You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2012/07/09 22:08:39 UTC

[Bug 53526] New: .ConnectionPool.terminateTransaction unsafe == check of Boolean

https://issues.apache.org/bugzilla/show_bug.cgi?id=53526

          Priority: P2
            Bug ID: 53526
          Assignee: dev@tomcat.apache.org
           Summary: .ConnectionPool.terminateTransaction unsafe == check
                    of Boolean
          Severity: normal
    Classification: Unclassified
                OS: Windows XP
          Reporter: sebb@apache.org
          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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 53526] .ConnectionPool.terminateTransaction unsafe == check of Boolean

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=53526

Filip Hanik <fh...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Filip Hanik <fh...@apache.org> ---
Fixed in r1359705

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org