You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2010/01/05 03:16:55 UTC
[jira] Created: (DBCP-316)
datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an
impossible null check
datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check
-----------------------------------------------------------------------------------------------
Key: DBCP-316
URL: https://issues.apache.org/jira/browse/DBCP-316
Project: Commons Dbcp
Issue Type: Bug
Reporter: Sebb
datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check:
{code}
synchronized (userKeys) {
key = getUserPassKey(username, password);
}
try {
info = (PooledConnectionAndInfo) pool.borrowObject(key);
}
catch (SQLException ex) { // Remove bad UserPassKey
if (userKeys != null) { // <== cannot be null here, else synch. would have failed with NPE
...
{code}
The null check should be removed, as userKeys cannot be null (it is a final variable, and set non-null).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (DBCP-316)
datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an
impossible null check
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phil Steitz closed DBCP-316.
----------------------------
> datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check
> -----------------------------------------------------------------------------------------------
>
> Key: DBCP-316
> URL: https://issues.apache.org/jira/browse/DBCP-316
> Project: Commons Dbcp
> Issue Type: Bug
> Reporter: Sebb
>
> datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check:
> {code}
> synchronized (userKeys) {
> key = getUserPassKey(username, password);
> }
>
> try {
> info = (PooledConnectionAndInfo) pool.borrowObject(key);
> }
> catch (SQLException ex) { // Remove bad UserPassKey
> if (userKeys != null) { // <== cannot be null here, else synch. would have failed with NPE
> ...
> {code}
> The null check should be removed, as userKeys cannot be null (it is a final variable, and set non-null).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DBCP-316)
datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an
impossible null check
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796493#action_12796493 ]
Phil Steitz commented on DBCP-316:
----------------------------------
Agree this is a needless check
> datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check
> -----------------------------------------------------------------------------------------------
>
> Key: DBCP-316
> URL: https://issues.apache.org/jira/browse/DBCP-316
> Project: Commons Dbcp
> Issue Type: Bug
> Reporter: Sebb
>
> datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check:
> {code}
> synchronized (userKeys) {
> key = getUserPassKey(username, password);
> }
>
> try {
> info = (PooledConnectionAndInfo) pool.borrowObject(key);
> }
> catch (SQLException ex) { // Remove bad UserPassKey
> if (userKeys != null) { // <== cannot be null here, else synch. would have failed with NPE
> ...
> {code}
> The null check should be removed, as userKeys cannot be null (it is a final variable, and set non-null).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (DBCP-316)
datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an
impossible null check
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb resolved DBCP-316.
-----------------------
Resolution: Fixed
URL: http://svn.apache.org/viewvc?rev=895870&view=rev
Log:
DBCP-316 Remove impossible null check.
> datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check
> -----------------------------------------------------------------------------------------------
>
> Key: DBCP-316
> URL: https://issues.apache.org/jira/browse/DBCP-316
> Project: Commons Dbcp
> Issue Type: Bug
> Reporter: Sebb
>
> datasources.SharedPoolDataSource.getPooledConnectionAndInfo() contains an impossible null check:
> {code}
> synchronized (userKeys) {
> key = getUserPassKey(username, password);
> }
>
> try {
> info = (PooledConnectionAndInfo) pool.borrowObject(key);
> }
> catch (SQLException ex) { // Remove bad UserPassKey
> if (userKeys != null) { // <== cannot be null here, else synch. would have failed with NPE
> ...
> {code}
> The null check should be removed, as userKeys cannot be null (it is a final variable, and set non-null).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.