You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/06/08 19:52:41 UTC
commons-dbcp git commit: Remove trailing white spaces on all lines.
Repository: commons-dbcp
Updated Branches:
refs/heads/master dd2c56855 -> 45ce66540
Remove trailing white spaces on all lines.
Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/45ce6654
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/45ce6654
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/45ce6654
Branch: refs/heads/master
Commit: 45ce66540a365d766987c7e2d7a680acadfd82df
Parents: dd2c568
Author: Gary Gregory <ga...@gmail.com>
Authored: Fri Jun 8 13:52:37 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Fri Jun 8 13:52:37 2018 -0600
----------------------------------------------------------------------
.../apache/commons/dbcp2/ObjectNameWrapper.java | 2 +-
.../commons/dbcp2/PoolableConnection.java | 2 +-
.../dbcp2/cpdsadapter/DriverAdapterCPDS.java | 8 ++--
.../datasources/PerUserPoolDataSource.java | 4 +-
.../commons/dbcp2/TestConnectionPool.java | 8 ++--
.../TestDriverManagerConnectionFactory.java | 10 ++---
.../java/org/apache/commons/dbcp2/TestJndi.java | 44 ++++++++++----------
.../org/apache/commons/dbcp2/TestUtils.java | 2 +-
.../commons/dbcp2/TesterDatabaseMetaData.java | 10 ++---
.../org/apache/commons/dbcp2/TesterDriver.java | 22 +++++-----
.../commons/dbcp2/TesterPreparedStatement.java | 2 +-
.../cpdsadapter/TestDriverAdapterCPDS.java | 12 +++---
.../ConnectionPoolDataSourceProxy.java | 24 +++++------
.../datasources/PooledConnectionProxy.java | 32 +++++++-------
.../datasources/TestCPDSConnectionFactory.java | 2 +-
.../commons/dbcp2/datasources/TestFactory.java | 10 ++---
.../datasources/TestInstanceKeyDataSource.java | 10 ++---
.../TestKeyedCPDSConnectionFactory.java | 2 +-
.../dbcp2/managed/TestTransactionContext.java | 8 ++--
19 files changed, 107 insertions(+), 107 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/main/java/org/apache/commons/dbcp2/ObjectNameWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/ObjectNameWrapper.java b/src/main/java/org/apache/commons/dbcp2/ObjectNameWrapper.java
index 01d9a18..a02d771 100644
--- a/src/main/java/org/apache/commons/dbcp2/ObjectNameWrapper.java
+++ b/src/main/java/org/apache/commons/dbcp2/ObjectNameWrapper.java
@@ -28,7 +28,7 @@ import org.apache.commons.logging.LogFactory;
/**
* Internal wrapper class that allows JMX to be a noop if absent or disabled.
- *
+ *
* @since 2.2.1
*/
class ObjectNameWrapper {
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java b/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java
index e96337c..f598232 100644
--- a/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java
+++ b/src/main/java/org/apache/commons/dbcp2/PoolableConnection.java
@@ -253,7 +253,7 @@ public class PoolableConnection extends DelegatingConnection<Connection> impleme
* <li>If {@code sql} is not null, it is executed as a query and if the resulting {@code ResultSet} contains at
* least one row, this method returns successfully. If not, {@code SQLException} is thrown.</li>
* </ol>
- *
+ *
* @param sql
* validation query
* @param timeout
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/main/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java b/src/main/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java
index b3611b2..db811b7 100644
--- a/src/main/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java
+++ b/src/main/java/org/apache/commons/dbcp2/cpdsadapter/DriverAdapterCPDS.java
@@ -599,7 +599,7 @@ public class DriverAdapterCPDS
/**
* Sets the number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no
* idle object evictor thread will be run.
- *
+ *
* @param timeBetweenEvictionRunsMillis
* The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive,
* no idle object evictor thread will be run.
@@ -650,7 +650,7 @@ public class DriverAdapterCPDS
*
* *see #setMinEvictableIdleTimeMillis
* *see #setTimeBetweenEvictionRunsMillis
- * @return the minimum amount of time a statement may sit idle in the pool.
+ * @return the minimum amount of time a statement may sit idle in the pool.
*/
public int getMinEvictableIdleTimeMillis() {
return _minEvictableIdleTimeMillis;
@@ -711,7 +711,7 @@ public class DriverAdapterCPDS
{
_maxPreparedStatements = maxPreparedStatements;
}
-
+
private void update(final Properties properties, final String key, final String value) {
if (properties != null) {
if (value == null) {
@@ -719,6 +719,6 @@ public class DriverAdapterCPDS
} else {
properties.setProperty(key, value);
}
- }
+ }
}
}
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java b/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
index 0ce64b4..1c6cb0c 100644
--- a/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
+++ b/src/main/java/org/apache/commons/dbcp2/datasources/PerUserPoolDataSource.java
@@ -99,7 +99,7 @@ public class PerUserPoolDataSource extends InstanceKeyDataSource {
/**
* Clears pool(s) maintained by this data source.
- *
+ *
* @see org.apache.commons.pool2.ObjectPool#clear()
* @since 2.3.0
*/
@@ -116,7 +116,7 @@ public class PerUserPoolDataSource extends InstanceKeyDataSource {
/**
* Closes pool(s) maintained by this data source.
- *
+ *
* @see org.apache.commons.pool2.ObjectPool#close()
*/
@Override
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/TestConnectionPool.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/TestConnectionPool.java b/src/test/java/org/apache/commons/dbcp2/TestConnectionPool.java
index 5e766c8..cd03c01 100644
--- a/src/test/java/org/apache/commons/dbcp2/TestConnectionPool.java
+++ b/src/test/java/org/apache/commons/dbcp2/TestConnectionPool.java
@@ -737,7 +737,7 @@ public abstract class TestConnectionPool {
final long maxWaitMillis) throws Exception {
multipleThreads(holdTime, expectError, loopOnce, maxWaitMillis, 1, 2 * getMaxTotal(), 300);
}
-
+
/**
* Launches a group of {@code numThreads} threads, each of which will attempt to obtain a connection
* from the pool, hold it for {@code holdTime} ms, and then return it to the pool. If {@code loopOnce} is false,
@@ -865,7 +865,7 @@ public abstract class TestConnectionPool {
* The number of milliseconds to hold onto a database connection
*/
private final int connHoldTime;
-
+
private final int numStatements;
private volatile boolean isRun;
@@ -875,7 +875,7 @@ public abstract class TestConnectionPool {
private final Thread thread;
private Throwable thrown;
-
+
private final Random random = new Random();
// Debug for DBCP-318
@@ -895,7 +895,7 @@ public abstract class TestConnectionPool {
public PoolTest(final ThreadGroup threadGroup, final int connHoldTime, final boolean isStopOnException) {
this(threadGroup, connHoldTime, isStopOnException, false, 1);
}
-
+
public PoolTest(final ThreadGroup threadGroup, final int connHoldTime, final boolean isStopOnException, final int numStatements) {
this(threadGroup, connHoldTime, isStopOnException, false, numStatements);
}
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/TestDriverManagerConnectionFactory.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/TestDriverManagerConnectionFactory.java b/src/test/java/org/apache/commons/dbcp2/TestDriverManagerConnectionFactory.java
index 0bb35dd..eee696b 100644
--- a/src/test/java/org/apache/commons/dbcp2/TestDriverManagerConnectionFactory.java
+++ b/src/test/java/org/apache/commons/dbcp2/TestDriverManagerConnectionFactory.java
@@ -40,16 +40,16 @@ public class TestDriverManagerConnectionFactory {
private static final String KEY_JDBC_DRIVERS = "jdbc.drivers";
- @BeforeClass
+ @BeforeClass
public static void beforeClass() {
System.setProperty(KEY_JDBC_DRIVERS, "org.apache.commons.dbcp2.TesterDriver");
}
-
+
@AfterClass
public static void afterClass() {
System.clearProperty(KEY_JDBC_DRIVERS);
}
-
+
@Test
public void testDriverManagerInitWithEmptyProperties() throws Exception {
final ConnectionFactory connectionFactory = new DriverManagerConnectionFactory(
@@ -75,8 +75,8 @@ public class TestDriverManagerConnectionFactory {
// The names "user" and "password" are specified in java.sql.DriverManager.getConnection(String, String, String)
properties.put("user", "foo");
properties.put("password", "bar");
- final ConnectionFactory connectionFactory = withProperties ?
- new DriverManagerConnectionFactory("jdbc:apache:commons:testdriver", properties) :
+ final ConnectionFactory connectionFactory = withProperties ?
+ new DriverManagerConnectionFactory("jdbc:apache:commons:testdriver", properties) :
new DriverManagerConnectionFactory("jdbc:apache:commons:testdriver", "foo", "bar");
final PoolableConnectionFactory poolableConnectionFactory =
new PoolableConnectionFactory(connectionFactory, null);
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/TestJndi.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/TestJndi.java b/src/test/java/org/apache/commons/dbcp2/TestJndi.java
index 9554797..6d5eb94 100644
--- a/src/test/java/org/apache/commons/dbcp2/TestJndi.java
+++ b/src/test/java/org/apache/commons/dbcp2/TestJndi.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -47,59 +47,59 @@ public class TestJndi {
*/
protected static final String JNDI_PATH = JNDI_SUBCONTEXT + "/"
+ "jndiTestDataSource";
-
+
/** jndi context to use in tests **/
protected Context context = null;
/**
* Test BasicDatasource bind and lookup
- *
+ *
* @throws Exception
*/
@Test
public void testBasicDataSourceBind() throws Exception {
final BasicDataSource dataSource = new BasicDataSource();
- checkBind(dataSource);
+ checkBind(dataSource);
}
-
+
/**
* Test SharedPoolDataSource bind and lookup
- *
+ *
* @throws Exception
*/
@Test
public void testSharedPoolDataSourceBind() throws Exception {
final SharedPoolDataSource dataSource = new SharedPoolDataSource();
- checkBind(dataSource);
+ checkBind(dataSource);
}
-
+
/**
* Test PerUserPoolDataSource bind and lookup
- *
+ *
* @throws Exception
*/
@Test
public void testPerUserPoolDataSourceBind() throws Exception {
final PerUserPoolDataSource dataSource = new PerUserPoolDataSource();
- checkBind(dataSource);
+ checkBind(dataSource);
}
-
+
@Before
public void setUp() throws Exception {
context = getInitialContext();
- context.createSubcontext(JNDI_SUBCONTEXT);
+ context.createSubcontext(JNDI_SUBCONTEXT);
}
-
+
@After
public void tearDown() throws Exception {
context.unbind(JNDI_PATH);
- context.destroySubcontext(JNDI_SUBCONTEXT);
+ context.destroySubcontext(JNDI_SUBCONTEXT);
}
-
+
/**
- * Binds a DataSource to the jndi and checks that we have successfully
+ * Binds a DataSource to the jndi and checks that we have successfully
* bound it by looking it up again.
- *
+ *
* @throws Exception if the bind, lookup or connect fails
*/
protected void checkBind(final DataSource dataSource) throws Exception {
@@ -109,7 +109,7 @@ public class TestJndi {
/**
* Binds a DataSource into jndi.
- *
+ *
* @throws Exception if creation or binding fails.
*/
protected void bindDataSource(final DataSource dataSource) throws Exception {
@@ -118,7 +118,7 @@ public class TestJndi {
/**
* Retrieves a DataSource from jndi.
- *
+ *
* @throws Exception if the jndi lookup fails or no DataSource is bound.
*/
protected DataSource retrieveDataSource() throws Exception {
@@ -133,9 +133,9 @@ public class TestJndi {
/**
* Retrieves (or creates if it does not exist) an InitialContext.
- *
+ *
* @return the InitialContext.
- * @throws NamingException if the InitialContext cannot be retrieved
+ * @throws NamingException if the InitialContext cannot be retrieved
* or created.
*/
protected InitialContext getInitialContext() throws NamingException {
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/TestUtils.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/TestUtils.java b/src/test/java/org/apache/commons/dbcp2/TestUtils.java
index 4954b49..2b6026a 100644
--- a/src/test/java/org/apache/commons/dbcp2/TestUtils.java
+++ b/src/test/java/org/apache/commons/dbcp2/TestUtils.java
@@ -25,6 +25,6 @@ public class TestUtils {
@Test
public void testClassLoads() {
- Utils.closeQuietly((Connection) null);
+ Utils.closeQuietly((Connection) null);
}
}
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/TesterDatabaseMetaData.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/TesterDatabaseMetaData.java b/src/test/java/org/apache/commons/dbcp2/TesterDatabaseMetaData.java
index be242e4..124829b 100644
--- a/src/test/java/org/apache/commons/dbcp2/TesterDatabaseMetaData.java
+++ b/src/test/java/org/apache/commons/dbcp2/TesterDatabaseMetaData.java
@@ -76,17 +76,17 @@ public class TesterDatabaseMetaData implements DatabaseMetaData {
public String getCatalogSeparator() throws SQLException {
return null;
}
-
+
@Override
public String getCatalogTerm() throws SQLException {
return null;
}
-
+
@Override
public ResultSet getCatalogs() throws SQLException {
return null;
}
-
+
@Override
public ResultSet getColumnPrivileges(final String catalog, final String schema,
final String table, final String columnNamePattern) throws SQLException {
@@ -918,7 +918,7 @@ public class TesterDatabaseMetaData implements DatabaseMetaData {
public ResultSet getClientInfoProperties() throws SQLException {
return null;
}
-
+
@Override
public ResultSet getFunctionColumns(final String catalog, final String schemaPattern,
final String functionNamePattern, final String columnNamePattern)
@@ -933,7 +933,7 @@ public class TesterDatabaseMetaData implements DatabaseMetaData {
}
/* JDBC_4_ANT_KEY_END */
-
+
@Override
public ResultSet getPseudoColumns(final String catalog, final String schemaPattern,
final String tableNamePattern, final String columnNamePattern)
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/TesterDriver.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/TesterDriver.java b/src/test/java/org/apache/commons/dbcp2/TesterDriver.java
index bfc1105..eb6352a 100644
--- a/src/test/java/org/apache/commons/dbcp2/TesterDriver.java
+++ b/src/test/java/org/apache/commons/dbcp2/TesterDriver.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,7 +28,7 @@ import java.util.logging.Logger;
/**
* Mock object implementing the <code>java.sql.Driver</code> interface.
- * Returns <code>TestConnection</code>'s from getConnection methods.
+ * Returns <code>TestConnection</code>'s from getConnection methods.
* Valid username, password combinations are:
*
* <table summary="valid credentials">
@@ -38,7 +38,7 @@ import java.util.logging.Logger;
* <tr><td>u2</td><td>p2</td></tr>
* <tr><td>username</td><td>password</td></tr>
* </table>
- *
+ *
* @author Rodney Waldhoff
* @author Dirk Verbeeck
* @version $Revision$ $Date: 2014-02-05 18:13:01 +0100 (Wed, 05 Feb 2014) $
@@ -56,8 +56,8 @@ public class TesterDriver implements Driver {
validUserPasswords.put("username", "password");
}
- /**
- * TesterDriver specific method to add users to the list of valid users
+ /**
+ * TesterDriver specific method to add users to the list of valid users
*/
public static void addUser(final String username, final String password) {
synchronized (validUserPasswords) {
@@ -70,10 +70,10 @@ public class TesterDriver implements Driver {
return url != null && url.startsWith(CONNECT_STRING);
}
- private void assertValidUserPassword(final String user, final String password)
+ private void assertValidUserPassword(final String user, final String password)
throws SQLException {
if (user == null){
- throw new SQLException("username cannot be null.");
+ throw new SQLException("username cannot be null.");
}
synchronized (validUserPasswords) {
final String realPassword = validUserPasswords.getProperty(user);
@@ -91,11 +91,11 @@ public class TesterDriver implements Driver {
public Connection connect(final String url, final Properties info) throws SQLException {
//return (acceptsURL(url) ? new TesterConnection() : null);
Connection conn = null;
- if (acceptsURL(url))
+ if (acceptsURL(url))
{
String username = "test";
String password = "test";
- if (info != null)
+ if (info != null)
{
username = info.getProperty("user");
password = info.getProperty("password");
@@ -110,7 +110,7 @@ public class TesterDriver implements Driver {
}
conn = new TesterConnection(username, password);
}
-
+
return conn;
}
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java b/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java
index a44c465..ee0058a 100644
--- a/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java
+++ b/src/test/java/org/apache/commons/dbcp2/TesterPreparedStatement.java
@@ -46,7 +46,7 @@ public class TesterPreparedStatement extends TesterStatement implements Prepared
private String _catalog = null;
private int _autoGeneratedKeys = 1;
private int[] _columnIndexes = null;
- private String[] _columnNames = null;
+ private String[] _columnNames = null;
public TesterPreparedStatement(final Connection conn) {
super(conn);
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/cpdsadapter/TestDriverAdapterCPDS.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/cpdsadapter/TestDriverAdapterCPDS.java b/src/test/java/org/apache/commons/dbcp2/cpdsadapter/TestDriverAdapterCPDS.java
index 7820796..a641214 100644
--- a/src/test/java/org/apache/commons/dbcp2/cpdsadapter/TestDriverAdapterCPDS.java
+++ b/src/test/java/org/apache/commons/dbcp2/cpdsadapter/TestDriverAdapterCPDS.java
@@ -161,12 +161,12 @@ public class TestDriverAdapterCPDS {
pcds.getPooledConnection("foo", "bar").close();
assertEquals("bar", pcds.getConnectionProperties().getProperty("password"));
}
-
+
@Test
public void testSetConnectionPropertiesNull() throws Exception {
pcds.setConnectionProperties(null);
}
-
+
@Test
public void testSetUserNull() throws Exception {
pcds.setUser("Alice");
@@ -174,7 +174,7 @@ public class TestDriverAdapterCPDS {
pcds.setUser(null);
assertEquals(null, pcds.getUser());
}
-
+
@Test
public void testSetUserNullWithConnectionProperties() throws Exception {
pcds.setConnectionProperties(new Properties());
@@ -183,7 +183,7 @@ public class TestDriverAdapterCPDS {
pcds.setUser(null);
assertEquals(null, pcds.getUser());
}
-
+
@Test
public void testSetPasswordNull() throws Exception {
pcds.setPassword("Secret");
@@ -191,7 +191,7 @@ public class TestDriverAdapterCPDS {
pcds.setPassword(null);
assertEquals(null, pcds.getPassword());
}
-
+
@Test
public void testSetPasswordNullWithConnectionProperties() throws Exception {
pcds.setConnectionProperties(new Properties());
@@ -200,7 +200,7 @@ public class TestDriverAdapterCPDS {
pcds.setPassword(null);
assertEquals(null, pcds.getPassword());
}
-
+
/**
* JIRA: DBCP-442
*/
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/datasources/ConnectionPoolDataSourceProxy.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/datasources/ConnectionPoolDataSourceProxy.java b/src/test/java/org/apache/commons/dbcp2/datasources/ConnectionPoolDataSourceProxy.java
index 0c30cab..b4e8111 100644
--- a/src/test/java/org/apache/commons/dbcp2/datasources/ConnectionPoolDataSourceProxy.java
+++ b/src/test/java/org/apache/commons/dbcp2/datasources/ConnectionPoolDataSourceProxy.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,27 +26,27 @@ import javax.sql.ConnectionPoolDataSource;
import javax.sql.PooledConnection;
/**
- * ConnectionPoolDataSource implementation that proxies another
+ * ConnectionPoolDataSource implementation that proxies another
* ConnectionPoolDataSource.
- *
+ *
*/
public class ConnectionPoolDataSourceProxy implements ConnectionPoolDataSource {
protected ConnectionPoolDataSource delegate = null;
-
+
public ConnectionPoolDataSourceProxy(final ConnectionPoolDataSource cpds) {
this.delegate = cpds;
}
-
+
public ConnectionPoolDataSource getDelegate() {
return delegate;
}
-
+
@Override
public int getLoginTimeout() throws SQLException {
return delegate.getLoginTimeout();
}
-
+
@Override
public PrintWriter getLogWriter() throws SQLException {
return delegate.getLogWriter();
@@ -71,14 +71,14 @@ public class ConnectionPoolDataSourceProxy implements ConnectionPoolDataSource {
@Override
public void setLoginTimeout(final int seconds) throws SQLException {
- delegate.setLoginTimeout(seconds);
+ delegate.setLoginTimeout(seconds);
}
@Override
public void setLogWriter(final PrintWriter out) throws SQLException {
- delegate.setLogWriter(out);
+ delegate.setLogWriter(out);
}
-
+
@Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
return delegate.getParentLogger();
@@ -90,6 +90,6 @@ public class ConnectionPoolDataSourceProxy implements ConnectionPoolDataSource {
protected PooledConnection wrapPooledConnection(final PooledConnection pc) {
final PooledConnectionProxy tpc = new PooledConnectionProxy(pc);
tpc.setNotifyOnClose(true);
- return tpc;
+ return tpc;
}
}
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/datasources/PooledConnectionProxy.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/datasources/PooledConnectionProxy.java b/src/test/java/org/apache/commons/dbcp2/datasources/PooledConnectionProxy.java
index 1039d4d..e9f463b 100644
--- a/src/test/java/org/apache/commons/dbcp2/datasources/PooledConnectionProxy.java
+++ b/src/test/java/org/apache/commons/dbcp2/datasources/PooledConnectionProxy.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,31 +32,31 @@ import javax.sql.StatementEventListener;
* PooledConnection implementation that wraps a driver-supplied
* PooledConnection and proxies events, allowing behavior to be
* modified to simulate behavior of different implementations.
- *
+ *
*/
public class PooledConnectionProxy implements PooledConnection,
ConnectionEventListener {
protected PooledConnection delegate = null;
-
+
/**
* ConnectionEventListeners
*/
private final Vector<EventListener> eventListeners = new Vector<>();
-
- /**
+
+ /**
* True means we will (dubiously) notify listeners with a
* ConnectionClosed event when this (i.e. the PooledConnection itself)
* is closed
*/
private boolean notifyOnClose = false;
-
+
public PooledConnectionProxy(final PooledConnection pooledConnection) {
this.delegate = pooledConnection;
pooledConnection.addConnectionEventListener(this);
}
- /**
+ /**
* If notifyOnClose is on, notify listeners
*/
@Override
@@ -94,7 +94,7 @@ public class PooledConnectionProxy implements PooledConnection,
public void setNotifyOnClose(final boolean notifyOnClose) {
this.notifyOnClose = notifyOnClose;
}
-
+
/**
* sends a connectionClosed event to listeners.
*/
@@ -105,7 +105,7 @@ public class PooledConnectionProxy implements PooledConnection,
((ConnectionEventListener) listener).connectionClosed(event);
}
}
-
+
/**
* Add event listeners.
*/
@@ -124,26 +124,26 @@ public class PooledConnectionProxy implements PooledConnection,
}
}
/* JDBC_4_ANT_KEY_END */
-
+
/**
* Pass closed events on to listeners
*/
@Override
public void connectionClosed(final ConnectionEvent event) {
- notifyListeners();
+ notifyListeners();
}
/**
* Pass error events on to listeners
- */
+ */
@Override
public void connectionErrorOccurred(final ConnectionEvent event) {
final Object[] listeners = eventListeners.toArray();
for (final Object listener : listeners) {
((ConnectionEventListener) listener).connectionErrorOccurred(event);
- }
+ }
}
-
+
/**
* Generate a connection error event
*/
@@ -151,7 +151,7 @@ public class PooledConnectionProxy implements PooledConnection,
final ConnectionEvent event = new ConnectionEvent(this);
connectionErrorOccurred(event);
}
-
+
/**
* Expose listeners
*/
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java b/src/test/java/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
index 8067487..e9ed5bc 100644
--- a/src/test/java/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
+++ b/src/test/java/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
@@ -142,7 +142,7 @@ public class TestCPDSConnectionFactory {
factory.getPool().clear();
assertEquals(0, pool.getNumIdle());
}
-
+
/**
* JIRA: DBCP-442
*/
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/datasources/TestFactory.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/datasources/TestFactory.java b/src/test/java/org/apache/commons/dbcp2/datasources/TestFactory.java
index 02fdfca..3563ef4 100644
--- a/src/test/java/org/apache/commons/dbcp2/datasources/TestFactory.java
+++ b/src/test/java/org/apache/commons/dbcp2/datasources/TestFactory.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -46,13 +46,13 @@ public class TestFactory {
refObj.add(new StringRefAddr("dataSourceName","java:comp/env/jdbc/bookstoreCPDS"));
final Context context = new InitialContext();
final Hashtable<?, ?> env = new Hashtable<>();
-
+
final ObjectFactory factory = new SharedPoolDataSourceFactory();
-
+
final Name name = new CompositeName("myDB");
final Object obj = factory.getObjectInstance(refObj, name, context, env);
assertNotNull(obj);
-
+
final Name name2 = new CompositeName("myDB2");
final Object obj2 = factory.getObjectInstance(refObj, name2, context, env);
assertNotNull(obj2);
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/datasources/TestInstanceKeyDataSource.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/datasources/TestInstanceKeyDataSource.java b/src/test/java/org/apache/commons/dbcp2/datasources/TestInstanceKeyDataSource.java
index 388835a..1cb00d0 100644
--- a/src/test/java/org/apache/commons/dbcp2/datasources/TestInstanceKeyDataSource.java
+++ b/src/test/java/org/apache/commons/dbcp2/datasources/TestInstanceKeyDataSource.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,7 +32,7 @@ public class TestInstanceKeyDataSource {
/**
* Verify that exception on setupDefaults does not leak PooledConnection
- *
+ *
* JIRA: DBCP-237
*/
@Test
@@ -53,10 +53,10 @@ public class TestInstanceKeyDataSource {
} catch (final SQLException ex) {
//Expected
}
- assertEquals(numConnections,tds.getNumActive());
+ assertEquals(numConnections,tds.getNumActive());
tds.close();
}
-
+
private static class ThrowOnSetupDefaultsDataSource
extends SharedPoolDataSource {
private static final long serialVersionUID = -448025812063133259L;
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java b/src/test/java/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
index 69c2654..efb7145 100644
--- a/src/test/java/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
+++ b/src/test/java/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
@@ -150,7 +150,7 @@ public class TestKeyedCPDSConnectionFactory {
factory.getPool().clear();
assertEquals(0, pool.getNumIdle(key));
}
-
+
/**
* JIRA: DBCP-442
*/
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/45ce6654/src/test/java/org/apache/commons/dbcp2/managed/TestTransactionContext.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/dbcp2/managed/TestTransactionContext.java b/src/test/java/org/apache/commons/dbcp2/managed/TestTransactionContext.java
index e346756..76c62ca 100644
--- a/src/test/java/org/apache/commons/dbcp2/managed/TestTransactionContext.java
+++ b/src/test/java/org/apache/commons/dbcp2/managed/TestTransactionContext.java
@@ -25,10 +25,10 @@ import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
import org.apache.geronimo.transaction.manager.TransactionImpl;
/**
- * TestSuite for TransactionContext
+ * TestSuite for TransactionContext
*/
public class TestTransactionContext {
-
+
/**
* JIRA: DBCP-428
*/
@@ -42,13 +42,13 @@ public class TestTransactionContext {
basicManagedDataSource.setPassword("password");
basicManagedDataSource.setMaxIdle(1);
final ManagedConnection<?> conn = (ManagedConnection<?>) basicManagedDataSource.getConnection();
- final UncooperativeTransaction transaction = new UncooperativeTransaction();
+ final UncooperativeTransaction transaction = new UncooperativeTransaction();
final TransactionContext transactionContext =
new TransactionContext(basicManagedDataSource.getTransactionRegistry(), transaction);
transactionContext.setSharedConnection(conn);
basicManagedDataSource.close();
}
-
+
/**
* Transaction that always fails enlistResource.
*/