commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r899987 - in /commons/proper/dbcp/trunk: src/java/org/apache/commons/dbcp/ src/java/org/apache/commons/dbcp/cpdsadapter/ src/java/org/apache/commons/dbcp/datasources/ src/java/org/apache/commons/dbcp/managed/ xdocs/
Date Sat, 16 Jan 2010 16:51:17 GMT
Author: psteitz
Date: Sat Jan 16 16:51:16 2010
New Revision: 899987

URL: http://svn.apache.org/viewvc?rev=899987&view=rev
Log:
Made private fields final where possible.  JIRA: DBCP-319.

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedObjectPool.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedTrace.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnection.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnectionFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/TransactionRegistry.java
    commons/proper/dbcp/trunk/xdocs/changes.xml

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedObjectPool.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedObjectPool.java?rev=899987&r1=899986&r2=899987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedObjectPool.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedObjectPool.java Sat
Jan 16 16:51:16 2010
@@ -38,12 +38,12 @@
     /** 
      * DBCP AbandonedConfig 
      */
-    private AbandonedConfig config = null;
+    private final AbandonedConfig config;
     
     /**
      * A list of connections in use
      */
-    private List trace = new ArrayList();
+    private final List trace = new ArrayList();
 
     /**
      * Create an ObjectPool which tracks db connections.

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedTrace.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedTrace.java?rev=899987&r1=899986&r2=899987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedTrace.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/AbandonedTrace.java Sat Jan
16 16:51:16 2010
@@ -36,7 +36,7 @@
 public class AbandonedTrace {
 
     /** DBCP AbandonedConfig */
-    private AbandonedConfig config = null;
+    private final AbandonedConfig config;
     /** A stack trace of the code that created me (if in debug mode) */
     private volatile Exception createdBy;
     /** A list of objects created by children of this object */
@@ -49,6 +49,7 @@
      * without doing abandoned tracing.
      */
     public AbandonedTrace() {
+        this.config = null;
         init(null);
     }
 
@@ -206,11 +207,12 @@
         private static final long serialVersionUID = 7398692158058772916L;
 
         /** Date format */
+        //@GuardedBy("this")
         private static final SimpleDateFormat format = new SimpleDateFormat
             ("'DBCP object created' yyyy-MM-dd HH:mm:ss " +
              "'by the following code was never closed:'");
 
-        private long _createdTime;
+        private final long _createdTime;
 
         public AbandonedObjectException() {
             _createdTime = System.currentTimeMillis();

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java?rev=899987&r1=899986&r2=899987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java
Sat Jan 16 16:51:16 2010
@@ -56,7 +56,7 @@
     /**
      * A DelegatingConnection used to create a PoolablePreparedStatementStub
      */
-    private DelegatingConnection delegatingConnection = null;
+    private final DelegatingConnection delegatingConnection;
 
     /**
      * The JDBC database logical connection.
@@ -66,19 +66,20 @@
     /**
      * ConnectionEventListeners
      */
-    private Vector eventListeners;
+    private final Vector eventListeners;
 
     /**
      * StatementEventListeners
      */
-    private Vector statementEventListeners = new Vector();
+    private final Vector statementEventListeners = new Vector();
 
     /**
      * flag set to true, once close() is called.
      */
-    boolean isClosed;
+    boolean isClosed; // TODO - make private?
 
     /** My pool of {*link PreparedStatement}s. */
+    // TODO - make final?
     protected KeyedObjectPool pstmtPool = null;
 
     /** 

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java?rev=899987&r1=899986&r2=899987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java
Sat Jan 16 16:51:16 2010
@@ -54,8 +54,8 @@
     protected volatile ObjectPool _pool = null;
     protected String _username = null;
     protected String _password = null;
-    private Map validatingMap = new HashMap();
-    private WeakHashMap pcMap = new WeakHashMap();
+    private final Map validatingMap = new HashMap();
+    private final WeakHashMap pcMap = new WeakHashMap();
 
     /**
      * Create a new <tt>PoolableConnectionFactory</tt>.

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java?rev=899987&r1=899986&r2=899987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java
Sat Jan 16 16:51:16 2010
@@ -57,12 +57,12 @@
      * Map of PooledConnections for which close events are ignored.
      * Connections are muted when they are being validated.
      */
-    private Map validatingMap = new HashMap();
+    private final Map validatingMap = new HashMap();
     
     /**
      * Map of PooledConnectionAndInfo instances
      */
-    private WeakHashMap pcMap = new WeakHashMap();
+    private final WeakHashMap pcMap = new WeakHashMap();
 
     /**
      * Create a new <tt>KeyedPoolableConnectionFactory</tt>.

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnection.java?rev=899987&r1=899986&r2=899987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnection.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnection.java
Sat Jan 16 16:51:16 2010
@@ -31,7 +31,7 @@
  * @version $Revision$ $Date$
  */
 public class PoolableManagedConnection extends PoolableConnection {
-    private TransactionRegistry transactionRegistry;
+    private final TransactionRegistry transactionRegistry;
 
     /**
      * Create a PoolableManagedConnection.

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnectionFactory.java?rev=899987&r1=899986&r2=899987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/PoolableManagedConnectionFactory.java
Sat Jan 16 16:51:16 2010
@@ -34,7 +34,7 @@
 public class PoolableManagedConnectionFactory extends PoolableConnectionFactory {
 
     /** Transaction registry associated with connections created by this factory */
-    private TransactionRegistry transactionRegistry;
+    private final TransactionRegistry transactionRegistry;
     
     /**
      * Create a PoolableManagedConnectionFactory and attach it to a connection pool.

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/TransactionRegistry.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/TransactionRegistry.java?rev=899987&r1=899986&r2=899987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/TransactionRegistry.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/TransactionRegistry.java
Sat Jan 16 16:51:16 2010
@@ -39,9 +39,9 @@
  * @version $Revision$
  */
 public class TransactionRegistry {
-    private TransactionManager transactionManager;
-    private Map caches = new WeakHashMap();
-    private Map xaResources = new WeakHashMap();
+    private final TransactionManager transactionManager;
+    private final Map caches = new WeakHashMap();
+    private final Map xaResources = new WeakHashMap();
 
     /**
      * Creates a TransactionRegistry for the specified transaction manager.

Modified: commons/proper/dbcp/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/xdocs/changes.xml?rev=899987&r1=899986&r2=899987&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/xdocs/changes.xml (original)
+++ commons/proper/dbcp/trunk/xdocs/changes.xml Sat Jan 16 16:51:16 2010
@@ -49,6 +49,9 @@
      changes below since 1.2.2 applies to both the 1.3 and 1.4 release.  Other than
      the one issue related to adding JDBC 4 support (DBCP-191), all bug fixes
      or new features are included in both DBCP 1.3 and 1.4 ">
+      <action dev="psteitz" type="fix" issue="DBCP-319" due-to="Sebastian Bazley">
+        Made private fields final where possible.
+      </action>
       <action dev="sebb" type="fix" issue="DBCP-318" due-to="Sebastian Bazley">
         PerUserPoolDataSource.getPooledConnectionAndInfo multi-threading bug.
       </action>



Mime
View raw message