On Thu, Feb 7, 2013 at 2:32 PM, Fred Ollinger <[email protected]> wrote: > To whom it may concern, > > Below is a patch to fix some java7 compilation bugs. Also, this is attached. >
Thanks for the patch, Fred! I've created a Bugzilla issue for this, so we don't lose track of it. I also added you to the cc list for the report, so you will be notified when its status changes. https://issues.apache.org/ooo/show_bug.cgi?id=121754 Regards, -Rob > Index: hsqldb/jdbcDriver.java > =================================================================== > --- hsqldb.orig/jdbcDriver.java 2013-02-07 09:17:01.000000000 -0800 > +++ hsqldb/jdbcDriver.java 2013-02-07 09:17:32.000000000 -0800 > @@ -31,6 +31,11 @@ > > package org.hsqldb; > > +//#ifdef JAVA7 > +import java.sql.SQLFeatureNotSupportedException; > +import java.util.logging.Logger; > +//#enddif JAVA7 > + > import java.sql.Connection; > import java.sql.Driver; > import java.sql.DriverManager; > @@ -121,6 +126,12 @@ > */ > public class jdbcDriver implements Driver { > > + //#ifdef JAVA7 > + public Logger getParentLogger() throws SQLFeatureNotSupportedException { > + throw new SQLFeatureNotSupportedException(); > + } > + //#endif JAVA7 > + > /** > * Attempts to make a database connection to the given URL. The driver > * returns "null" if it realizes it is the wrong kind of driver to > @@ -321,4 +332,8 @@ > DriverManager.registerDriver(new jdbcDriver()); > } catch (Exception e) {} > } > + > + public boolean isCloseOnCompletion() { return false; } > + > } > + > Index: hsqldb/jdbc/jdbcCallableStatement.java > =================================================================== > --- hsqldb.orig/jdbc/jdbcCallableStatement.java 2013-02-07 > 09:55:57.000000000 -0800 > +++ hsqldb/jdbc/jdbcCallableStatement.java 2013-02-07 09:57:17.000000000 > -0800 > @@ -302,6 +302,14 @@ > public class jdbcCallableStatement extends jdbcPreparedStatement > implements CallableStatement { > > + //#if JAVA7 > + public <T> T getObject(String s, Class<T> T) throws SQLException > { throw new SQLException(); } > + public <T> T getObject(int i, Class<T> T) throws SQLException { > throw new SQLException(); } > + public boolean isCloseOnCompletion() { > + throw new UnsupportedOperationException("Not supported yet."); > + } > + //#endif JAVA7 > + > /** parameter name => parameter index */ > private IntValueHashMap parameterNameMap; > > @@ -3373,11 +3381,6 @@ > { > throw new UnsupportedOperationException("Not supported yet."); > } > -//#endif JAVA6 > - > -//#if JAVA7 > - [javac] > /mnt/lfs/sources/ubuntu/old/local_dev300/hsqldb/unxlngi6.pro/misc/build/hsqldb/src/org/hsqldb/jdbc/jdbcCallableStatement.java > :302: error: jdbcCallableStatement is not abstract and does not > override abstract method <T>getObject(String,Class<T>) in > CallableStatement > - > -//#endif JAVA7 > > +//#endif JAVA6 > } > Index: hsqldb/jdbc/jdbcConnection.java > =================================================================== > --- hsqldb.orig/jdbc/jdbcConnection.java 2013-02-07 11:22:20.000000000 > -0800 > +++ hsqldb/jdbc/jdbcConnection.java 2013-02-07 11:22:43.000000000 -0800 > @@ -31,6 +31,10 @@ > > package org.hsqldb.jdbc; > > +//#ifdef JAVA7 > +import java.util.concurrent.Executor; > +//#endif JAVA7 > + > //#ifdef JAVA2 > import java.sql.Array; > import java.sql.Blob; > @@ -416,6 +420,21 @@ > * @see jdbcDatabaseMetaData > */ > public class jdbcConnection implements Connection { > + //#ifdef JAVA7 > + public void abort(Executor e){} > + public int getNetworkTimeout(){ > + throw new UnsupportedOperationException("Not supported yet."); > + } > + public void setNetworkTimeout(Executor e, int i ){ > + throw new UnsupportedOperationException("Not supported yet."); > + } > + public String getSchema() { > + throw new UnsupportedOperationException("Not supported yet."); > + } > + public void setSchema(String s) { > + throw new UnsupportedOperationException("Not supported yet."); > + } > + //#endif JAVA7 > > // ---------------------------- Common Attributes -------------------------- > > Index: hsqldb/jdbc/jdbcDatabaseMetaData.java > =================================================================== > --- hsqldb.orig/jdbc/jdbcDatabaseMetaData.java 2013-02-07 > 11:27:01.000000000 -0800 > +++ hsqldb/jdbc/jdbcDatabaseMetaData.java 2013-02-07 11:27:03.000000000 > -0800 > @@ -99,7 +99,7 @@ > * <P> > * A method that gets information about a feature that the driver does not > * support will throw an <code>SQLException</code>. > - * In the case of methods that return a <code>ResultSet</code> > + * In the case of methods that eeturn a <code>ResultSet</code> > * object, either a <code>ResultSet</code> object (which may be empty) is > * returned or an <code>SQLException</code> is thrown.<p> > * > @@ -282,6 +282,13 @@ > */ > public class jdbcDatabaseMetaData implements DatabaseMetaData { > > + //#ifdef JAVA7 > + public ResultSet getPseudoColumns(String catalog, String > schemaPattern, String tableNamePattern, String columnNamePattern) > throws SQLException {throw new SQLException(); } > + > + public boolean generatedKeyAlwaysReturned(){ return false; } > + //#endif JAVA7 > + > + > /** Used by getBestRowIdentifier to avoid extra object construction */ > static final Integer INT_COLUMNS_NO_NULLS = new Integer(columnNoNulls); > > @@ -5694,3 +5701,5 @@ > > //#endif JAVA6 > } > + > + > Index: hsqldb/jdbc/jdbcDataSource.java > =================================================================== > --- hsqldb.orig/jdbc/jdbcDataSource.java 2013-02-07 11:27:59.000000000 > -0800 > +++ hsqldb/jdbc/jdbcDataSource.java 2013-02-07 11:28:00.000000000 -0800 > @@ -31,6 +31,10 @@ > > package org.hsqldb.jdbc; > > +//#ifdef JAVA7 > +import java.util.logging.Logger; > +//#endif JAVA7 > + > import java.io.PrintWriter; > import java.io.Serializable; > import java.sql.Connection; > @@ -97,6 +101,12 @@ > public class jdbcDataSource > implements Serializable, Referenceable, DataSource { > > + //#ifdef JAVA7 > + public Logger getParentLogger() { > + throw new UnsupportedOperationException("Not supported yet."); > + } > + //#endif JAVA7 > + > //#else > /* > public class jdbcDataSource implements Serializable { > Index: hsqldb/jdbc/jdbcPreparedStatement.java > =================================================================== > --- hsqldb.orig/jdbc/jdbcPreparedStatement.java 2013-02-07 > 11:28:11.000000000 -0800 > +++ hsqldb/jdbc/jdbcPreparedStatement.java 2013-02-07 11:28:13.000000000 > -0800 > @@ -212,6 +212,12 @@ > public class jdbcPreparedStatement extends jdbcStatement > implements PreparedStatement { > > + //#ifdef JAVA7 > + public void closeOnCompletion() { > + throw new UnsupportedOperationException("Not supported yet."); > + } > + //#endif JAVA7 > + > /** The parameter values for the next non-batch execution. */ > protected Object[] parameterValues; > > Index: hsqldb/jdbc/jdbcResultSet.java > =================================================================== > --- hsqldb.orig/jdbc/jdbcResultSet.java 2013-02-07 11:28:24.000000000 -0800 > +++ hsqldb/jdbc/jdbcResultSet.java 2013-02-07 11:28:26.000000000 -0800 > @@ -332,6 +332,12 @@ > * @since Hypersonic SQL > */ > public class jdbcResultSet implements ResultSet { > + public <T> T getObject(String s, Class<T> type){ > + throw new UnsupportedOperationException("Not supported yet."); > + } > + public <T> T getObject(int columnIndex, Class<T> type){ > + throw new UnsupportedOperationException("Not supported yet."); > + } > > // fredt@users 20020320 - patch 497714 by lakuhns@users - scrollable > ResultSet > // variable values in different states > Index: hsqldb/jdbc/jdbcStatement.java > =================================================================== > --- hsqldb.orig/jdbc/jdbcStatement.java 2013-02-07 11:28:33.000000000 -0800 > +++ hsqldb/jdbc/jdbcStatement.java 2013-02-07 11:28:34.000000000 -0800 > @@ -33,8 +33,8 @@ > > //#ifdef JAVA2 > import java.sql.BatchUpdateException; > - > //#endif JAVA2 > + > import java.sql.Connection; > import java.sql.ResultSet; > import java.sql.SQLException; > @@ -126,6 +126,12 @@ > */ > public class jdbcStatement implements Statement { > > + //#ifdef JAVA7 > + public void closeOnCompletion() { > + throw new UnsupportedOperationException("Not supported yet."); > + } > + //#endif JAVA7 > + > /** > * Whether this Statement has been explicitly closed. A jdbcConnection > * object now explicitly closes all of its open jdbcXXXStatement objects > @@ -1610,18 +1616,7 @@ > //#endif JAVA6 > > //#ifdef JAVA7 > - //isCloseOnCompletion() for Statement > - public boolean isCloseOnCompletion() throws SQLException > - { > - throw new UnsupportedOperationException("Not supported yet."); > - } > - > - public void closeOnCompletion() throws SQLException > - { > - throw new UnsupportedOperationException("Not supported yet."); > - } > - > - > + public boolean isCloseOnCompletion(){ return false; } > //#endif JAVA7 > > }
