RESOLVED - BATCH-1856: ExtendedConnectionDataSourceProxy compilation

error in JDK 7

fix Java 5 compilation regression
This commit is contained in:
Robert Kasanicky
2012-05-06 23:21:48 +02:00
parent fd00ae62c1
commit a07a8dae14
2 changed files with 24 additions and 8 deletions

View File

@@ -23,7 +23,6 @@ import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
import javax.sql.DataSource;
@@ -323,8 +322,13 @@ public class ExtendedConnectionDataSourceProxy implements SmartDataSource, Initi
Assert.notNull(dataSource);
}
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
throw new SQLFeatureNotSupportedException();
/**
* Added due to JDK 7 compatibility, sadly a proper implementation
* that would throw SqlFeatureNotSupportedException is not possible
* in Java 5 (the class was added in Java 6).
*/
public Logger getParentLogger() {
throw new UnsupportedOperationException();
}
}

View File

@@ -1,13 +1,20 @@
package org.springframework.batch.item.database;
import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Statement;
import java.util.logging.Logger;
@@ -333,8 +340,13 @@ public class ExtendedConnectionDataSourceProxyTests {
throw new SQLException(UNWRAP_ERROR_MESSAGE);
}
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
throw new SQLFeatureNotSupportedException();
/**
* Added due to JDK 7 compatibility, sadly a proper implementation
* that would throw SqlFeatureNotSupportedException is not possible
* in Java 5 (the class was added in Java 6).
*/
public Logger getParentLogger() {
throw new UnsupportedOperationException();
}
}