commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r895724 - in /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp: TestDelegatingDatabaseMetaData.java TestDelegatingPreparedStatement.java TestDelegatingStatement.java TestJndi.java
Date Mon, 04 Jan 2010 17:48:37 GMT
Author: sebb
Date: Mon Jan  4 17:48:34 2010
New Revision: 895724

URL: http://svn.apache.org/viewvc?rev=895724&view=rev
Log:
Fix data hiding issues by renaming local variables

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingDatabaseMetaData.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingPreparedStatement.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingStatement.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestJndi.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingDatabaseMetaData.java?rev=895724&r1=895723&r2=895724&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingDatabaseMetaData.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingDatabaseMetaData.java
Mon Jan  4 17:48:34 2010
@@ -60,11 +60,11 @@
         } catch (SQLException e) {
             fail("No exception expected retrieving meta data");
         }
-        DelegatingDatabaseMetaData meta =
+        DelegatingDatabaseMetaData meta1 =
             new DelegatingDatabaseMetaData(conn,delegateMeta);
         DelegatingDatabaseMetaData meta2 =
             new DelegatingDatabaseMetaData(conn,delegateMeta);
-        assertEquals(meta.hashCode(), meta2.hashCode());
+        assertEquals(meta1.hashCode(), meta2.hashCode());
     }
     
     public void testEquals() {
@@ -73,16 +73,16 @@
         } catch (SQLException e) {
             fail("No exception expected retrieving meta data");
         }
-        DelegatingDatabaseMetaData meta =
+        DelegatingDatabaseMetaData meta1 =
             new DelegatingDatabaseMetaData(conn,delegateMeta);
         DelegatingDatabaseMetaData meta2 =
             new DelegatingDatabaseMetaData(conn,delegateMeta);
         DelegatingDatabaseMetaData meta3 =
             new DelegatingDatabaseMetaData(conn,null);
         
-        assertTrue(!meta.equals(null));
-        assertTrue(meta.equals(meta2));
-        assertTrue(!meta.equals(meta3));
+        assertTrue(!meta1.equals(null));
+        assertTrue(meta1.equals(meta2));
+        assertTrue(!meta1.equals(meta3));
     }
     
     /* JDBC_4_ANT_KEY_BEGIN */

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingPreparedStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingPreparedStatement.java?rev=895724&r1=895723&r2=895724&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingPreparedStatement.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingPreparedStatement.java
Mon Jan  4 17:48:34 2010
@@ -73,20 +73,20 @@
     
     public void testHashCode() {
         delegateStmt = new TesterPreparedStatement(delegateConn,"select * from foo");
-        DelegatingPreparedStatement stmt = new DelegatingPreparedStatement(conn,delegateStmt);
+        DelegatingPreparedStatement stmt1 = new DelegatingPreparedStatement(conn,delegateStmt);
         DelegatingPreparedStatement stmt2 = new DelegatingPreparedStatement(conn,delegateStmt);
-        assertEquals(stmt.hashCode(), stmt2.hashCode());
+        assertEquals(stmt1.hashCode(), stmt2.hashCode());
     }
     
     public void testEquals() {
         delegateStmt = new TesterPreparedStatement(delegateConn,"select * from foo");
-        DelegatingPreparedStatement stmt = new DelegatingPreparedStatement(conn, delegateStmt);
+        DelegatingPreparedStatement stmt1 = new DelegatingPreparedStatement(conn, delegateStmt);
         DelegatingPreparedStatement stmt2 = new DelegatingPreparedStatement(conn, delegateStmt);
         DelegatingPreparedStatement stmt3 = new DelegatingPreparedStatement(conn, null);
         
-        assertTrue(!stmt.equals(null));
-        assertTrue(stmt.equals(stmt2));
-        assertTrue(!stmt.equals(stmt3));
+        assertTrue(!stmt1.equals(null));
+        assertTrue(stmt1.equals(stmt2));
+        assertTrue(!stmt1.equals(stmt3));
     }
 
 }

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingStatement.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingStatement.java?rev=895724&r1=895723&r2=895724&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingStatement.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestDelegatingStatement.java
Mon Jan  4 17:48:34 2010
@@ -61,20 +61,20 @@
 
     public void testHashCode() {
         delegateStmt = new TesterPreparedStatement(delegateConn,"select * from foo");
-        DelegatingStatement stmt = new DelegatingStatement(conn,delegateStmt);
+        DelegatingStatement stmt1 = new DelegatingStatement(conn,delegateStmt);
         DelegatingStatement stmt2 = new DelegatingStatement(conn,delegateStmt);
-        assertEquals(stmt.hashCode(), stmt2.hashCode());
+        assertEquals(stmt1.hashCode(), stmt2.hashCode());
     }
     
     public void testEquals() {
         delegateStmt = new TesterPreparedStatement(delegateConn,"select * from foo");
-        DelegatingStatement stmt = new DelegatingStatement(conn, delegateStmt);
+        DelegatingStatement stmt1 = new DelegatingStatement(conn, delegateStmt);
         DelegatingStatement stmt2 = new DelegatingStatement(conn, delegateStmt);
         DelegatingStatement stmt3 = new DelegatingStatement(conn, null);
         
-        assertTrue(!stmt.equals(null));
-        assertTrue(stmt.equals(stmt2));
-        assertTrue(!stmt.equals(stmt3));
+        assertTrue(!stmt1.equals(null));
+        assertTrue(stmt1.equals(stmt2));
+        assertTrue(!stmt1.equals(stmt3));
     }
     
     public void testCheckOpen() throws Exception {

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestJndi.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestJndi.java?rev=895724&r1=895723&r2=895724&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestJndi.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestJndi.java Mon Jan  4 17:48:34
2010
@@ -129,8 +129,8 @@
      * @throws Exception if the jndi lookup fails or no DataSource is bound.
      */
     protected DataSource retrieveDataSource() throws Exception {
-        Context context = getInitialContext();
-        DataSource dataSource = (DataSource) context.lookup(JNDI_PATH);
+        Context ctx = getInitialContext();
+        DataSource dataSource = (DataSource) ctx.lookup(JNDI_PATH);
 
         if (dataSource == null) {
             fail("DataSource should not be null");
@@ -149,7 +149,7 @@
         Hashtable environment = new Hashtable();
         environment.put(Context.INITIAL_CONTEXT_FACTORY,
                 org.apache.naming.java.javaURLContextFactory.class.getName());
-        InitialContext context = new InitialContext(environment);
-        return context;
+        InitialContext ctx = new InitialContext(environment);
+        return ctx;
     }
 }



Mime
View raw message