summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/commons-dbcp/files/jdk1.7.patch')
-rw-r--r--dev-java/commons-dbcp/files/jdk1.7.patch519
1 files changed, 519 insertions, 0 deletions
diff --git a/dev-java/commons-dbcp/files/jdk1.7.patch b/dev-java/commons-dbcp/files/jdk1.7.patch
new file mode 100644
index 0000000..9bfb2c3
--- /dev/null
+++ b/dev-java/commons-dbcp/files/jdk1.7.patch
@@ -0,0 +1,519 @@
+diff -ur src.old/java/org/apache/commons/dbcp/BasicDataSource.java src/java/org/apache/commons/dbcp/BasicDataSource.java
+--- src.old/java/org/apache/commons/dbcp/BasicDataSource.java 2010-02-07 16:59:20.000000000 +0000
++++ src/java/org/apache/commons/dbcp/BasicDataSource.java 2014-03-25 13:55:40.752579143 +0000
+@@ -24,10 +24,12 @@
+ import java.util.ArrayList;
+ import java.util.Iterator;
+ import java.util.Collections;
++import java.util.logging.Logger;
+ import java.sql.Connection;
+ import java.sql.Driver;
+ import java.sql.DriverManager;
+ import java.sql.SQLException;
++import java.sql.SQLFeatureNotSupportedException;
+ import javax.sql.DataSource;
+
+ import org.apache.commons.pool.KeyedObjectPoolFactory;
+@@ -1579,4 +1581,8 @@
+ logWriter.println(message);
+ }
+ }
++
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++ throw new SQLFeatureNotSupportedException();
++ }
+ }
+diff -ur src.old/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java src/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java
+--- src.old/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java 2010-02-07 16:59:19.000000000 +0000
++++ src/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java 2014-03-25 15:25:25.795205555 +0000
+@@ -17,22 +17,25 @@
+
+ package org.apache.commons.dbcp.cpdsadapter;
+
+-import java.util.Hashtable;
+-import java.util.Properties;
+ import java.io.PrintWriter;
+ import java.io.Serializable;
+ import java.sql.DriverManager;
+ import java.sql.SQLException;
+-import javax.sql.PooledConnection;
+-import javax.sql.ConnectionPoolDataSource;
+-import javax.naming.Name;
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.Hashtable;
++import java.util.Properties;
++import java.util.logging.Logger;
++
+ import javax.naming.Context;
+-import javax.naming.Referenceable;
+-import javax.naming.spi.ObjectFactory;
+-import javax.naming.Reference;
++import javax.naming.Name;
++import javax.naming.NamingException;
+ import javax.naming.RefAddr;
++import javax.naming.Reference;
++import javax.naming.Referenceable;
+ import javax.naming.StringRefAddr;
+-import javax.naming.NamingException;
++import javax.naming.spi.ObjectFactory;
++import javax.sql.ConnectionPoolDataSource;
++import javax.sql.PooledConnection;
+
+ import org.apache.commons.pool.KeyedObjectPool;
+ import org.apache.commons.pool.impl.GenericKeyedObjectPool;
+@@ -514,6 +517,10 @@
+ public PrintWriter getLogWriter() {
+ return logWriter;
+ }
++
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++ throw new SQLFeatureNotSupportedException();
++ }
+
+ /**
+ * Sets the maximum time in seconds that this data source will wait
+diff -ur src.old/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java
+--- src.old/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java 2010-02-07 16:59:20.000000000 +0000
++++ src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java 2014-03-25 15:03:27.672985191 +0000
+@@ -21,8 +21,10 @@
+ import java.io.PrintWriter;
+ import java.sql.Connection;
+ import java.sql.SQLException;
++import java.sql.SQLFeatureNotSupportedException;
+ import java.util.NoSuchElementException;
+ import java.util.Properties;
++import java.util.logging.Logger;
+
+ import javax.naming.Context;
+ import javax.naming.InitialContext;
+@@ -417,6 +419,10 @@
+ public void setLogWriter(PrintWriter v) {
+ this.logWriter = v;
+ }
++
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++ throw new SQLFeatureNotSupportedException();
++ }
+
+ /**
+ * @see #getTestOnBorrow
+Only in src/java/org/apache/commons/dbcp/datasources: .InstanceKeyDataSource.java.swp
+diff -ur src.old/java/org/apache/commons/dbcp/DelegatingCallableStatement.java src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java
+--- src.old/java/org/apache/commons/dbcp/DelegatingCallableStatement.java 2010-02-07 16:59:20.000000000 +0000
++++ src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java 2014-03-25 14:32:12.216370435 +0000
+@@ -143,6 +143,12 @@
+ public Object getObject(int parameterIndex) throws SQLException
+ { checkOpen(); try { return ((CallableStatement)_stmt).getObject( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
+
++ public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
++ { checkOpen(); try { return ((CallableStatement)_stmt).getObject( parameterIndex, type); } catch (SQLException e) { handleException(e); return null; } }
++
++ public <T> T getObject(String name, Class<T> type) throws SQLException
++ { checkOpen(); try { return ((CallableStatement)_stmt).getObject( name, type); } catch (SQLException e) { handleException(e); return null; } }
++
+ public BigDecimal getBigDecimal(int parameterIndex) throws SQLException
+ { checkOpen(); try { return ((CallableStatement)_stmt).getBigDecimal( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
+
+@@ -329,6 +335,7 @@
+ public URL getURL(String parameterName) throws SQLException
+ { checkOpen(); try { return ((CallableStatement)_stmt).getURL(parameterName); } catch (SQLException e) { handleException(e); return null; } }
+
++
+ /* JDBC_4_ANT_KEY_BEGIN */
+
+ public RowId getRowId(int parameterIndex) throws SQLException {
+diff -ur src.old/java/org/apache/commons/dbcp/DelegatingConnection.java src/java/org/apache/commons/dbcp/DelegatingConnection.java
+--- src.old/java/org/apache/commons/dbcp/DelegatingConnection.java 2010-02-07 16:59:20.000000000 +0000
++++ src/java/org/apache/commons/dbcp/DelegatingConnection.java 2014-03-25 15:25:06.381594054 +0000
+@@ -27,6 +27,7 @@
+ import java.util.Iterator;
+ import java.util.List;
+ import java.util.Map;
++import java.util.concurrent.Executor;
+ import java.sql.ResultSet;
+ /* JDBC_4_ANT_KEY_BEGIN */
+ import java.sql.Array;
+@@ -538,6 +539,60 @@
+ }
+ }
+
++ public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
++ checkOpen();
++ try {
++ _conn.setNetworkTimeout(executor, milliseconds);
++ } catch (SQLException e) {
++ handleException(e);
++ }
++ }
++
++
++ public int getNetworkTimeout() throws SQLException {
++ checkOpen();
++ try {
++ return _conn.getNetworkTimeout();
++ }
++ catch (SQLException e) {
++ handleException(e);
++ throw new AssertionError();
++ }
++ }
++
++ public void abort(Executor executor) throws SQLException {
++ if (_conn!=null) {
++ try {
++ _conn.abort(executor);
++ } catch (SQLException e) {
++ handleException(e);
++ throw new AssertionError();
++ }
++ }
++ }
++
++ @Override
++ public void setSchema(String schema) throws SQLException {
++ checkOpen();
++ try {
++ _conn.setSchema(schema);
++ } catch (SQLException e) {
++ handleException(e);
++ throw new AssertionError();
++ }
++ }
++
++ @Override
++ public String getSchema() throws SQLException {
++ checkOpen();
++ try {
++ return _conn.getSchema();
++ } catch (SQLException e) {
++ handleException(e);
++ throw new AssertionError();
++ }
++ }
++
+ /* JDBC_4_ANT_KEY_BEGIN */
+
+ public boolean isWrapperFor(Class<?> iface) throws SQLException {
+diff -ur src.old/java/org/apache/commons/dbcp/DelegatingDatabaseMetaData.java src/java/org/apache/commons/dbcp/DelegatingDatabaseMetaData.java
+--- src.old/java/org/apache/commons/dbcp/DelegatingDatabaseMetaData.java 2010-02-07 16:59:20.000000000 +0000
++++ src/java/org/apache/commons/dbcp/DelegatingDatabaseMetaData.java 2014-03-25 14:36:20.719641630 +0000
+@@ -270,6 +270,23 @@
+ catch (SQLException e) { handleException(e); return 0; } }
+ }
+
++ public boolean generatedKeyAlwaysReturned() throws SQLException {
++ { try { return _meta.generatedKeyAlwaysReturned(); }
++ catch (SQLException e) { handleException(e); return false; } }
++ }
++
++ public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
++ _conn.checkOpen();
++ try {
++ return DelegatingResultSet.wrapResultSet(_conn,
++ _meta.getPseudoColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern));
++ }
++ catch (SQLException e) {
++ handleException(e);
++ throw new AssertionError();
++ }
++ }
++
+ public int getDriverMajorVersion() {return _meta.getDriverMajorVersion();}
+
+ public int getDriverMinorVersion() {return _meta.getDriverMinorVersion();}
+diff -ur src.old/java/org/apache/commons/dbcp/DelegatingResultSet.java src/java/org/apache/commons/dbcp/DelegatingResultSet.java
+--- src.old/java/org/apache/commons/dbcp/DelegatingResultSet.java 2010-02-07 16:59:20.000000000 +0000
++++ src/java/org/apache/commons/dbcp/DelegatingResultSet.java 2014-03-25 14:37:14.777029363 +0000
+@@ -324,9 +324,15 @@
+ public Object getObject(int columnIndex) throws SQLException
+ { try { return _res.getObject(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
+
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException
++ { try { return _res.getObject(columnIndex, type); } catch (SQLException e) { handleException(e); return null; } }
++
+ public Object getObject(String columnName) throws SQLException
+ { try { return _res.getObject(columnName); } catch (SQLException e) { handleException(e); return null; } }
+
++ public <T> T getObject(String columnName, Class<T> type) throws SQLException
++ { try { return _res.getObject(columnName, type); } catch (SQLException e) { handleException(e); return null; } }
++
+ public int findColumn(String columnName) throws SQLException
+ { try { return _res.findColumn(columnName); } catch (SQLException e) { handleException(e); return 0; } }
+
+diff -ur src.old/java/org/apache/commons/dbcp/DelegatingStatement.java src/java/org/apache/commons/dbcp/DelegatingStatement.java
+--- src.old/java/org/apache/commons/dbcp/DelegatingStatement.java 2010-02-07 16:59:20.000000000 +0000
++++ src/java/org/apache/commons/dbcp/DelegatingStatement.java 2014-03-25 14:32:21.113152723 +0000
+@@ -23,6 +23,7 @@
+ import java.sql.SQLWarning;
+ import java.sql.Statement;
+ import java.util.List;
++import java.util.concurrent.Executor;
+
+ /**
+ * A base delegating implementation of {@link Statement}.
+@@ -191,6 +192,26 @@
+ }
+ }
+
++ public void closeOnCompletion() throws SQLException {
++ checkOpen();
++ try {
++ _stmt.closeOnCompletion();
++ } catch (SQLException e) {
++ handleException(e);
++ throw new AssertionError();
++ }
++ }
++
++ public boolean isCloseOnCompletion() throws SQLException {
++ checkOpen();
++ try {
++ return _stmt.isCloseOnCompletion();
++ } catch (SQLException e) {
++ handleException(e);
++ throw new AssertionError();
++ }
++ }
++
+ protected void passivate() throws SQLException {
+ if(_stmt instanceof DelegatingStatement) {
+ ((DelegatingStatement)_stmt).passivate();
+diff -ur src.old/java/org/apache/commons/dbcp/PoolingDataSource.java src/java/org/apache/commons/dbcp/PoolingDataSource.java
+--- src.old/java/org/apache/commons/dbcp/PoolingDataSource.java 2010-02-07 16:59:20.000000000 +0000
++++ src/java/org/apache/commons/dbcp/PoolingDataSource.java 2014-03-25 15:03:08.289371317 +0000
+@@ -25,8 +25,10 @@
+ import java.sql.SQLException;
+ import java.sql.SQLWarning;
+ import java.sql.Statement;
++import java.sql.SQLFeatureNotSupportedException;
+ import java.util.Map;
+ import java.util.NoSuchElementException;
++import java.util.logging.Logger;
+
+ import javax.sql.DataSource;
+
+@@ -167,6 +169,10 @@
+
+ protected ObjectPool _pool = null;
+
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++ throw new SQLFeatureNotSupportedException();
++ }
++
+ /**
+ * PoolGuardConnectionWrapper is a Connection wrapper that makes sure a
+ * closed connection cannot be used anymore.
+diff -ur src.old/java/org/apache/commons/dbcp/PoolingDriver.java src/java/org/apache/commons/dbcp/PoolingDriver.java
+--- src.old/java/org/apache/commons/dbcp/PoolingDriver.java 2010-02-07 16:59:20.000000000 +0000
++++ src/java/org/apache/commons/dbcp/PoolingDriver.java 2014-03-25 15:30:36.676312656 +0000
+@@ -19,21 +19,13 @@
+
+ import java.io.IOException;
+ import java.io.InputStream;
+-import java.sql.CallableStatement;
+-import java.sql.Connection;
+-import java.sql.DatabaseMetaData;
+-import java.sql.Driver;
+-import java.sql.DriverManager;
+-import java.sql.DriverPropertyInfo;
+-import java.sql.PreparedStatement;
+-import java.sql.SQLException;
+-import java.sql.SQLWarning;
+-import java.sql.Statement;
++import java.sql.*;
+ import java.util.HashMap;
+ import java.util.Map;
+ import java.util.NoSuchElementException;
+ import java.util.Properties;
+ import java.util.Set;
++import java.util.logging.Logger;
+
+ import org.apache.commons.jocl.JOCLContentHandler;
+ import org.apache.commons.pool.ObjectPool;
+@@ -239,6 +231,10 @@
+ return new DriverPropertyInfo[0];
+ }
+
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++ throw new SQLFeatureNotSupportedException();
++ }
++
+ /** My URL prefix */
+ protected static final String URL_PREFIX = "jdbc:apache:commons:dbcp:";
+ protected static final int URL_PREFIX_LEN = URL_PREFIX.length();
+diff -ur src.old/test/org/apache/commons/dbcp/datasources/ConnectionPoolDataSourceProxy.java src/test/org/apache/commons/dbcp/datasources/ConnectionPoolDataSourceProxy.java
+--- src.old/test/org/apache/commons/dbcp/datasources/ConnectionPoolDataSourceProxy.java 2010-02-07 16:59:19.000000000 +0000
++++ src/test/org/apache/commons/dbcp/datasources/ConnectionPoolDataSourceProxy.java 2014-03-25 16:02:00.459832403 +0000
+@@ -19,6 +19,9 @@
+
+ import java.io.PrintWriter;
+ import java.sql.SQLException;
++import java.sql.SQLFeatureNotSupportedException;
++import java.util.logging.Logger;
++
+ import javax.sql.ConnectionPoolDataSource;
+ import javax.sql.PooledConnection;
+
+@@ -80,4 +83,9 @@
+ return tpc;
+ }
+
++ @Override
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++ throw new SQLFeatureNotSupportedException();
++ }
++
+ }
+diff -ur src.old/test/org/apache/commons/dbcp/TesterCallableStatement.java src/test/org/apache/commons/dbcp/TesterCallableStatement.java
+--- src.old/test/org/apache/commons/dbcp/TesterCallableStatement.java 2010-02-07 16:59:19.000000000 +0000
++++ src/test/org/apache/commons/dbcp/TesterCallableStatement.java 2014-03-25 15:31:58.090805042 +0000
+@@ -128,6 +128,16 @@
+ return null;
+ }
+
++ @Override
++ public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException {
++ return null;
++ }
++
++ @Override
++ public <T> T getObject(String parameterName, Class<T> type) throws SQLException {
++ return null;
++ }
++
+ public BigDecimal getBigDecimal(int parameterIndex) throws SQLException {
+ return null;
+ }
+@@ -456,4 +466,14 @@
+ public void setNClob(String parameterName, Reader reader) throws SQLException {
+ }
+ /* JDBC_4_ANT_KEY_END */
++
++ @Override
++ public void closeOnCompletion() throws SQLException {
++
++ }
++
++ @Override
++ public boolean isCloseOnCompletion() throws SQLException {
++ return false;
++ }
+ }
+diff -ur src.old/test/org/apache/commons/dbcp/TesterConnection.java src/test/org/apache/commons/dbcp/TesterConnection.java
+--- src.old/test/org/apache/commons/dbcp/TesterConnection.java 2010-02-07 16:59:19.000000000 +0000
++++ src/test/org/apache/commons/dbcp/TesterConnection.java 2014-03-25 15:32:46.261490175 +0000
+@@ -35,6 +35,7 @@
+ import java.sql.Struct;
+ import java.util.Properties;
+ /* JDBC_4_ANT_KEY_END */
++import java.util.concurrent.Executor;
+
+ /**
+ * A dummy {@link Connection}, for testing purposes.
+@@ -334,4 +335,25 @@
+ throw new SQLException("Not implemented.");
+ }
+ /* JDBC_4_ANT_KEY_END */
++
++ public void setSchema(String schema) throws SQLException {
++ throw new SQLException("Not implemented.");
++ }
++
++ public String getSchema() throws SQLException {
++ throw new SQLException("Not implemented.");
++ }
++
++ public void abort(Executor executor) throws SQLException {
++ throw new SQLException("Not implemented.");
++ }
++
++ public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
++ throw new SQLException("Not implemented.");
++ }
++
++ public int getNetworkTimeout() throws SQLException {
++ throw new SQLException("Not implemented.");
++ }
++
+ }
+diff -ur src.old/test/org/apache/commons/dbcp/TesterDatabaseMetaData.java src/test/org/apache/commons/dbcp/TesterDatabaseMetaData.java
+--- src.old/test/org/apache/commons/dbcp/TesterDatabaseMetaData.java 2010-02-07 16:59:19.000000000 +0000
++++ src/test/org/apache/commons/dbcp/TesterDatabaseMetaData.java 2014-03-25 15:33:50.245748196 +0000
+@@ -761,4 +761,14 @@
+ }
+
+ /* JDBC_4_ANT_KEY_END */
++
++ public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
++ throws SQLException {
++ return null;
++ }
++
++ @Override
++ public boolean generatedKeyAlwaysReturned() throws SQLException {
++ return false;
++ }
+ }
+diff -ur src.old/test/org/apache/commons/dbcp/TesterDriver.java src/test/org/apache/commons/dbcp/TesterDriver.java
+--- src.old/test/org/apache/commons/dbcp/TesterDriver.java 2010-02-07 16:59:19.000000000 +0000
++++ src/test/org/apache/commons/dbcp/TesterDriver.java 2014-03-25 15:34:14.306096159 +0000
+@@ -22,7 +22,9 @@
+ import java.sql.DriverManager;
+ import java.sql.DriverPropertyInfo;
+ import java.sql.SQLException;
++import java.sql.SQLFeatureNotSupportedException;
+ import java.util.Properties;
++import java.util.logging.Logger;
+
+ /**
+ * Mock object implementing the <code>java.sql.Driver</code> interface.
+@@ -116,6 +118,10 @@
+ return new DriverPropertyInfo[0];
+ }
+
++ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
++ return null;
++ }
++
+ protected static final String CONNECT_STRING = "jdbc:apache:commons:testdriver";
+
+ // version numbers
+diff -ur src.old/test/org/apache/commons/dbcp/TesterResultSet.java src/test/org/apache/commons/dbcp/TesterResultSet.java
+--- src.old/test/org/apache/commons/dbcp/TesterResultSet.java 2010-02-07 16:59:19.000000000 +0000
++++ src/test/org/apache/commons/dbcp/TesterResultSet.java 2014-03-25 15:45:08.482149168 +0000
+@@ -305,6 +305,16 @@
+ return columnName;
+ }
+
++ @Override
++ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
++ return type.cast(getObject(columnIndex));
++ }
++
++ @Override
++ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
++ return type.cast(getObject(columnLabel));
++ }
++
+ public int findColumn(String columnName) throws SQLException {
+ checkOpen();
+ return 1;
+diff -ur src.old/test/org/apache/commons/dbcp/TesterStatement.java src/test/org/apache/commons/dbcp/TesterStatement.java
+--- src.old/test/org/apache/commons/dbcp/TesterStatement.java 2010-02-07 16:59:19.000000000 +0000
++++ src/test/org/apache/commons/dbcp/TesterStatement.java 2014-03-25 16:00:41.102044772 +0000
+@@ -296,4 +296,15 @@
+ throw new SQLException("Not implemented.");
+ }
+ /* JDBC_4_ANT_KEY_END */
++
++ @Override
++ public void closeOnCompletion() throws SQLException {
++ throw new SQLException("Not implemented.");
++ }
++
++ @Override
++ public boolean isCloseOnCompletion() throws SQLException {
++ throw new SQLException("Not implemented.");
++ }
++
+ }