Integrate animal sniffer

Animal sniffer provides tools to assist verifying that classes
compiled with a newer JDK are compatible with an older JDK.

This integratesthe latest version of the tool (1.11) that
permits the use of custom annotations. Added @UsesJava7,
@UsesJava8 and @UsesSunHttpServer and annotated the few places
where we rely on a specific environment.

The verification process can be invoked by running the 'sniff'
task.

Issue: SPR-11604

polishing
This commit is contained in:
Stephane Nicoll
2014-01-16 16:11:13 +01:00
parent e84f61bb9d
commit bd85c916eb
30 changed files with 247 additions and 40 deletions

View File

@@ -22,6 +22,7 @@ import javax.sql.rowset.CachedRowSet;
import javax.sql.rowset.RowSetFactory;
import javax.sql.rowset.RowSetProvider;
import org.springframework.core.UsesJava7;
import org.springframework.core.JdkVersion;
import org.springframework.jdbc.support.rowset.ResultSetWrappingSqlRowSet;
import org.springframework.jdbc.support.rowset.SqlRowSet;
@@ -109,6 +110,7 @@ public class SqlRowSetResultSetExtractor implements ResultSetExtractor<SqlRowSet
/**
* Inner class to avoid a hard dependency on JDBC 4.1 RowSetProvider class.
*/
@UsesJava7
private static class StandardCachedRowSetFactory implements CachedRowSetFactory {
private final RowSetFactory rowSetFactory;

View File

@@ -34,6 +34,7 @@ import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.core.UsesJava7;
import org.springframework.jdbc.CannotGetJdbcConnectionException;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.util.ClassUtils;
@@ -134,6 +135,7 @@ public abstract class JdbcUtils {
* @return the value object
* @throws SQLException if thrown by the JDBC API
*/
@UsesJava7 // guard use of JDBC 4.1 (safe with 1.6)
public static Object getResultSetValue(ResultSet rs, int index, Class<?> requiredType) throws SQLException {
if (requiredType == null) {
return getResultSetValue(rs, index);