diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java
index c4f72c55b04..6ba84b72b82 100644
--- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java
+++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ public class PreparedStatementCreatorFactory {
/** The SQL, which won't change when the parameters change */
private final String sql;
- /** List of SqlParameter objects. May not be null. */
+ /** List of SqlParameter objects. May not be {@code null}. */
private final List declaredParameters;
private int resultSetType = ResultSet.TYPE_FORWARD_ONLY;
@@ -144,15 +144,15 @@ public class PreparedStatementCreatorFactory {
/**
* Return a new PreparedStatementSetter for the given parameters.
- * @param params list of parameters (may be null)
+ * @param params list of parameters (may be {@code null})
*/
- public PreparedStatementSetter newPreparedStatementSetter(List params) {
+ public PreparedStatementSetter newPreparedStatementSetter(List> params) {
return new PreparedStatementCreatorImpl(params != null ? params : Collections.emptyList());
}
/**
* Return a new PreparedStatementSetter for the given parameters.
- * @param params the parameter array (may be null)
+ * @param params the parameter array (may be {@code null})
*/
public PreparedStatementSetter newPreparedStatementSetter(Object[] params) {
return new PreparedStatementCreatorImpl(params != null ? Arrays.asList(params) : Collections.emptyList());
@@ -160,7 +160,7 @@ public class PreparedStatementCreatorFactory {
/**
* Return a new PreparedStatementCreator for the given parameters.
- * @param params list of parameters (may be null)
+ * @param params list of parameters (may be {@code null})
*/
public PreparedStatementCreator newPreparedStatementCreator(List> params) {
return new PreparedStatementCreatorImpl(params != null ? params : Collections.emptyList());
@@ -168,7 +168,7 @@ public class PreparedStatementCreatorFactory {
/**
* Return a new PreparedStatementCreator for the given parameters.
- * @param params the parameter array (may be null)
+ * @param params the parameter array (may be {@code null})
*/
public PreparedStatementCreator newPreparedStatementCreator(Object[] params) {
return new PreparedStatementCreatorImpl(params != null ? Arrays.asList(params) : Collections.emptyList());
@@ -178,7 +178,7 @@ public class PreparedStatementCreatorFactory {
* Return a new PreparedStatementCreator for the given parameters.
* @param sqlToUse the actual SQL statement to use (if different from
* the factory's, for example because of named parameter expanding)
- * @param params the parameter array (may be null)
+ * @param params the parameter array (may be {@code null})
*/
public PreparedStatementCreator newPreparedStatementCreator(String sqlToUse, Object[] params) {
return new PreparedStatementCreatorImpl(
@@ -225,7 +225,7 @@ public class PreparedStatementCreatorFactory {
}
public PreparedStatement createPreparedStatement(Connection con) throws SQLException {
- PreparedStatement ps = null;
+ PreparedStatement ps;
if (generatedKeysColumnNames != null || returnGeneratedKeys) {
try {
if (generatedKeysColumnNames != null) {
@@ -263,7 +263,7 @@ public class PreparedStatementCreatorFactory {
int sqlColIndx = 1;
for (int i = 0; i < this.parameters.size(); i++) {
Object in = this.parameters.get(i);
- SqlParameter declaredParameter = null;
+ SqlParameter declaredParameter;
// SqlParameterValue overrides declared parameter metadata, in particular for
// independence from the declared parameter position in case of named parameters.
if (in instanceof SqlParameterValue) {
diff --git a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
index 2bb0ade6d1b..ea8e74501e9 100644
--- a/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
+++ b/org.springframework.jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2012 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -93,7 +93,7 @@ public abstract class StatementCreatorUtils {
/**
* Derive a default SQL type from the given Java type.
* @param javaType the Java type to translate
- * @return the corresponding SQL type, or null if none found
+ * @return the corresponding SQL type, or {@code null} if none found
*/
public static int javaTypeToSqlParameterType(Class javaType) {
Integer sqlType = javaTypeToSqlTypeMap.get(javaType);
@@ -233,7 +233,7 @@ public abstract class StatementCreatorUtils {
try {
pmd = ps.getParameterMetaData();
}
- catch (AbstractMethodError err) {
+ catch (Throwable ex) {
// JDBC driver not compliant with JDBC 3.0
// -> proceed with database-specific checks
}
@@ -381,7 +381,7 @@ public abstract class StatementCreatorUtils {
}
/**
- * Check whether the given value is a java.util.Date
+ * Check whether the given value is a {@code java.util.Date}
* (but not one of the JDBC-specific subclasses).
*/
private static boolean isDateValue(Class inValueType) {
@@ -394,7 +394,7 @@ public abstract class StatementCreatorUtils {
/**
* Clean up all resources held by parameter values which were passed to an
* execute method. This is for example important for closing LOB values.
- * @param paramValues parameter values supplied. May be null.
+ * @param paramValues parameter values supplied. May be {@code null}.
* @see DisposableSqlTypeValue#cleanup()
* @see org.springframework.jdbc.core.support.SqlLobValue#cleanup()
*/
@@ -407,7 +407,7 @@ public abstract class StatementCreatorUtils {
/**
* Clean up all resources held by parameter values which were passed to an
* execute method. This is for example important for closing LOB values.
- * @param paramValues parameter values supplied. May be null.
+ * @param paramValues parameter values supplied. May be {@code null}.
* @see DisposableSqlTypeValue#cleanup()
* @see org.springframework.jdbc.core.support.SqlLobValue#cleanup()
*/