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/07 01:26:54 UTC
[jira] Created: (DBCP-319) Make private fields final where possible
Make private fields final where possible
----------------------------------------
Key: DBCP-319
URL: https://issues.apache.org/jira/browse/DBCP-319
Project: Commons Dbcp
Issue Type: Improvement
Reporter: Sebb
Several private fields could be made final:
AbandonedTrace.config
AbandonedTrace.AbandonedObjectException._createdTime
cpdsadapter.PooledConnectionImpl:
* connection
* delegatingConnection
* eventListeners
* statementEventListeners
* pstmtPool is protected, but could probably be made final if it were not for the API change that would imply
cpdsadapter.PooledConnectionImpl.PStmtKey (nested class, variables are protected, but might as well be private)
* all of its fields could be made final
datasources.[Keyed]CPDSConnectionFactory.validatingMap
datasources.[Keyed]CPDSConnectionFactory.pcMap
managed.PoolableManagedConnection.transactionRegistry
managed.PoolableManagedConnectionFactory.transactionRegistry
managed.TransactionRegistry.transactionManager|caches|xaResources
.AbandonedObjectPool.config|trace
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DBCP-319) Make private fields final where
possible
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801237#action_12801237 ]
Phil Steitz commented on DBCP-319:
----------------------------------
The class cannot throw itself away, obviously. It can release its reference to the physical connection that it wraps, though, making it available for GC. Especially if the close fails, seems to me this is a reasonable thing to do.
> Make private fields final where possible
> ----------------------------------------
>
> Key: DBCP-319
> URL: https://issues.apache.org/jira/browse/DBCP-319
> Project: Commons Dbcp
> Issue Type: Improvement
> Reporter: Sebb
> Fix For: 1.4
>
> Attachments: DBCP-319-private-final.patch
>
>
> Several private fields could be made final:
> AbandonedTrace.config
> AbandonedTrace.AbandonedObjectException._createdTime
> cpdsadapter.PooledConnectionImpl:
> * connection
> * delegatingConnection
> * eventListeners
> * statementEventListeners
> * pstmtPool is protected, but could probably be made final if it were not for the API change that would imply
> cpdsadapter.PooledConnectionImpl.PStmtKey (nested class, variables are protected, but might as well be private)
> * all of its fields could be made final
> datasources.[Keyed]CPDSConnectionFactory.validatingMap
> datasources.[Keyed]CPDSConnectionFactory.pcMap
> managed.PoolableManagedConnection.transactionRegistry
> managed.PoolableManagedConnectionFactory.transactionRegistry
> managed.TransactionRegistry.transactionManager|caches|xaResources
> .AbandonedObjectPool.config|trace
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DBCP-319) Make private fields final where possible
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb updated DBCP-319:
----------------------
Fix Version/s: 1.4
> Make private fields final where possible
> ----------------------------------------
>
> Key: DBCP-319
> URL: https://issues.apache.org/jira/browse/DBCP-319
> Project: Commons Dbcp
> Issue Type: Improvement
> Reporter: Sebb
> Fix For: 1.4
>
> Attachments: DBCP-319-private-final.patch
>
>
> Several private fields could be made final:
> AbandonedTrace.config
> AbandonedTrace.AbandonedObjectException._createdTime
> cpdsadapter.PooledConnectionImpl:
> * connection
> * delegatingConnection
> * eventListeners
> * statementEventListeners
> * pstmtPool is protected, but could probably be made final if it were not for the API change that would imply
> cpdsadapter.PooledConnectionImpl.PStmtKey (nested class, variables are protected, but might as well be private)
> * all of its fields could be made final
> datasources.[Keyed]CPDSConnectionFactory.validatingMap
> datasources.[Keyed]CPDSConnectionFactory.pcMap
> managed.PoolableManagedConnection.transactionRegistry
> managed.PoolableManagedConnectionFactory.transactionRegistry
> managed.TransactionRegistry.transactionManager|caches|xaResources
> .AbandonedObjectPool.config|trace
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Reopened: (DBCP-319) Make private fields final where
possible
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb reopened DBCP-319:
-----------------------
I don't see how it helps to set connection to null.
The PooledConnectionImpl class cannot be used again, as nothing can set up a new connection.
The only sensible thing to do is to throw it away, which will surely have the same effect on the connection as setting it to null?
> Make private fields final where possible
> ----------------------------------------
>
> Key: DBCP-319
> URL: https://issues.apache.org/jira/browse/DBCP-319
> Project: Commons Dbcp
> Issue Type: Improvement
> Reporter: Sebb
> Fix For: 1.4
>
> Attachments: DBCP-319-private-final.patch
>
>
> Several private fields could be made final:
> AbandonedTrace.config
> AbandonedTrace.AbandonedObjectException._createdTime
> cpdsadapter.PooledConnectionImpl:
> * connection
> * delegatingConnection
> * eventListeners
> * statementEventListeners
> * pstmtPool is protected, but could probably be made final if it were not for the API change that would imply
> cpdsadapter.PooledConnectionImpl.PStmtKey (nested class, variables are protected, but might as well be private)
> * all of its fields could be made final
> datasources.[Keyed]CPDSConnectionFactory.validatingMap
> datasources.[Keyed]CPDSConnectionFactory.pcMap
> managed.PoolableManagedConnection.transactionRegistry
> managed.PoolableManagedConnectionFactory.transactionRegistry
> managed.TransactionRegistry.transactionManager|caches|xaResources
> .AbandonedObjectPool.config|trace
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DBCP-319) Make private fields final where possible
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb updated DBCP-319:
----------------------
Attachment: DBCP-319-private-final.patch
> Make private fields final where possible
> ----------------------------------------
>
> Key: DBCP-319
> URL: https://issues.apache.org/jira/browse/DBCP-319
> Project: Commons Dbcp
> Issue Type: Improvement
> Reporter: Sebb
> Attachments: DBCP-319-private-final.patch
>
>
> Several private fields could be made final:
> AbandonedTrace.config
> AbandonedTrace.AbandonedObjectException._createdTime
> cpdsadapter.PooledConnectionImpl:
> * connection
> * delegatingConnection
> * eventListeners
> * statementEventListeners
> * pstmtPool is protected, but could probably be made final if it were not for the API change that would imply
> cpdsadapter.PooledConnectionImpl.PStmtKey (nested class, variables are protected, but might as well be private)
> * all of its fields could be made final
> datasources.[Keyed]CPDSConnectionFactory.validatingMap
> datasources.[Keyed]CPDSConnectionFactory.pcMap
> managed.PoolableManagedConnection.transactionRegistry
> managed.PoolableManagedConnectionFactory.transactionRegistry
> managed.TransactionRegistry.transactionManager|caches|xaResources
> .AbandonedObjectPool.config|trace
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DBCP-319) Make private fields final where possible
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phil Steitz updated DBCP-319:
-----------------------------
Fix Version/s: (was: 1.4)
1.4.1
1.3.1
> Make private fields final where possible
> ----------------------------------------
>
> Key: DBCP-319
> URL: https://issues.apache.org/jira/browse/DBCP-319
> Project: Commons Dbcp
> Issue Type: Improvement
> Reporter: Sebb
> Fix For: 1.3.1, 1.4.1
>
> Attachments: DBCP-319-private-final.patch
>
>
> Several private fields could be made final:
> AbandonedTrace.config
> AbandonedTrace.AbandonedObjectException._createdTime
> cpdsadapter.PooledConnectionImpl:
> * connection
> * delegatingConnection
> * eventListeners
> * statementEventListeners
> * pstmtPool is protected, but could probably be made final if it were not for the API change that would imply
> cpdsadapter.PooledConnectionImpl.PStmtKey (nested class, variables are protected, but might as well be private)
> * all of its fields could be made final
> datasources.[Keyed]CPDSConnectionFactory.validatingMap
> datasources.[Keyed]CPDSConnectionFactory.pcMap
> managed.PoolableManagedConnection.transactionRegistry
> managed.PoolableManagedConnectionFactory.transactionRegistry
> managed.TransactionRegistry.transactionManager|caches|xaResources
> .AbandonedObjectPool.config|trace
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (DBCP-319) Make private fields final where
possible
Posted by "Phil Steitz (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DBCP-319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phil Steitz resolved DBCP-319.
------------------------------
Resolution: Fixed
Patch applied in r899987, with one modification:
* Did not make connection final in PooledConnectionImpl, as I was not comfortable removing the nulling of the reference to the underlying physical connection on close.
> Make private fields final where possible
> ----------------------------------------
>
> Key: DBCP-319
> URL: https://issues.apache.org/jira/browse/DBCP-319
> Project: Commons Dbcp
> Issue Type: Improvement
> Reporter: Sebb
> Fix For: 1.4
>
> Attachments: DBCP-319-private-final.patch
>
>
> Several private fields could be made final:
> AbandonedTrace.config
> AbandonedTrace.AbandonedObjectException._createdTime
> cpdsadapter.PooledConnectionImpl:
> * connection
> * delegatingConnection
> * eventListeners
> * statementEventListeners
> * pstmtPool is protected, but could probably be made final if it were not for the API change that would imply
> cpdsadapter.PooledConnectionImpl.PStmtKey (nested class, variables are protected, but might as well be private)
> * all of its fields could be made final
> datasources.[Keyed]CPDSConnectionFactory.validatingMap
> datasources.[Keyed]CPDSConnectionFactory.pcMap
> managed.PoolableManagedConnection.transactionRegistry
> managed.PoolableManagedConnectionFactory.transactionRegistry
> managed.TransactionRegistry.transactionManager|caches|xaResources
> .AbandonedObjectPool.config|trace
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.