Java 5 code style
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2008 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.
|
||||
@@ -26,10 +26,10 @@ import java.util.List;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.jdbc.core.SqlInOutParameter;
|
||||
import org.springframework.jdbc.core.SqlOutParameter;
|
||||
import org.springframework.jdbc.core.SqlParameter;
|
||||
import org.springframework.jdbc.core.SqlInOutParameter;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
@@ -279,15 +279,11 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider {
|
||||
metaDataSchemaName + "/" + metaDataProcedureName);
|
||||
}
|
||||
try {
|
||||
procs = databaseMetaData.getProcedures(
|
||||
metaDataCatalogName,
|
||||
metaDataSchemaName,
|
||||
metaDataProcedureName);
|
||||
List found = new ArrayList();
|
||||
procs = databaseMetaData.getProcedures(metaDataCatalogName, metaDataSchemaName, metaDataProcedureName);
|
||||
List<String> found = new ArrayList<String>();
|
||||
while (procs.next()) {
|
||||
found.add(procs.getString("PROCEDURE_CAT") +
|
||||
"."+procs.getString("PROCEDURE_SCHEM") +
|
||||
"."+procs.getString("PROCEDURE_NAME"));
|
||||
found.add(procs.getString("PROCEDURE_CAT") + "." + procs.getString("PROCEDURE_SCHEM") +
|
||||
"." + procs.getString("PROCEDURE_NAME"));
|
||||
}
|
||||
procs.close();
|
||||
if (found.size() > 1) {
|
||||
@@ -304,10 +300,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider {
|
||||
}
|
||||
|
||||
procs = databaseMetaData.getProcedureColumns(
|
||||
metaDataCatalogName,
|
||||
metaDataSchemaName,
|
||||
metaDataProcedureName,
|
||||
null);
|
||||
metaDataCatalogName, metaDataSchemaName, metaDataProcedureName, null);
|
||||
while (procs.next()) {
|
||||
String columnName = procs.getString("COLUMN_NAME");
|
||||
int columnType = procs.getInt("COLUMN_TYPE");
|
||||
@@ -327,36 +320,30 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider {
|
||||
}
|
||||
}
|
||||
else {
|
||||
CallParameterMetaData meta = new CallParameterMetaData(
|
||||
columnName,
|
||||
columnType,
|
||||
procs.getInt("DATA_TYPE"),
|
||||
procs.getString("TYPE_NAME"),
|
||||
procs.getBoolean("NULLABLE")
|
||||
CallParameterMetaData meta = new CallParameterMetaData(columnName, columnType,
|
||||
procs.getInt("DATA_TYPE"), procs.getString("TYPE_NAME"), procs.getBoolean("NULLABLE")
|
||||
);
|
||||
callParameterMetaData.add(meta);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Retrieved metadata: "
|
||||
+ meta.getParameterName() +
|
||||
" " + meta.getParameterType() +
|
||||
" " + meta.getSqlType() +
|
||||
" " + meta.getTypeName() +
|
||||
" " + meta.isNullable()
|
||||
logger.debug("Retrieved metadata: " + meta.getParameterName() + " " +
|
||||
meta.getParameterType() + " " + meta.getSqlType() +
|
||||
" " + meta.getTypeName() + " " + meta.isNullable()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (SQLException se) {
|
||||
logger.warn("Error while retreiving metadata for procedure columns: " + se.getMessage());
|
||||
catch (SQLException ex) {
|
||||
logger.warn("Error while retrieving metadata for procedure columns: " + ex);
|
||||
}
|
||||
finally {
|
||||
try {
|
||||
if (procs != null)
|
||||
if (procs != null) {
|
||||
procs.close();
|
||||
}
|
||||
}
|
||||
catch (SQLException se) {
|
||||
logger.warn("Problem closing resultset for procedure column metadata " + se.getMessage());
|
||||
catch (SQLException ex) {
|
||||
logger.warn("Problem closing ResultSet for procedure column metadata: " + ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2008 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.
|
||||
@@ -192,7 +192,7 @@ public class TableMetaDataContext {
|
||||
if (declaredColumns.size() > 0) {
|
||||
return new ArrayList<String>(declaredColumns);
|
||||
}
|
||||
Set keys = new HashSet(generatedKeyNames.length);
|
||||
Set<String> keys = new HashSet<String>(generatedKeyNames.length);
|
||||
for (String key : generatedKeyNames) {
|
||||
keys.add(key.toUpperCase());
|
||||
}
|
||||
|
||||
@@ -75,14 +75,14 @@ public class BeanPropertySqlParameterSource extends AbstractSqlParameterSource {
|
||||
*/
|
||||
public String[] getReadablePropertyNames() {
|
||||
if (this.propertyNames == null) {
|
||||
List names = new ArrayList();
|
||||
List<String> names = new ArrayList<String>();
|
||||
PropertyDescriptor[] props = this.beanWrapper.getPropertyDescriptors();
|
||||
for (int i = 0; i < props.length; i++) {
|
||||
if (this.beanWrapper.isReadableProperty(props[i].getName())) {
|
||||
names.add(props[i].getName());
|
||||
for (PropertyDescriptor pd : props) {
|
||||
if (this.beanWrapper.isReadableProperty(pd.getName())) {
|
||||
names.add(pd.getName());
|
||||
}
|
||||
}
|
||||
this.propertyNames = (String[]) names.toArray(new String[names.size()]);
|
||||
this.propertyNames = names.toArray(new String[names.size()]);
|
||||
}
|
||||
return this.propertyNames;
|
||||
}
|
||||
|
||||
@@ -44,15 +44,15 @@ import org.springframework.jdbc.BadSqlGrammarException;
|
||||
*/
|
||||
public class SQLStateSQLExceptionTranslator extends AbstractFallbackSQLExceptionTranslator {
|
||||
|
||||
private static final Set BAD_SQL_GRAMMAR_CODES = new HashSet(8);
|
||||
private static final Set<String> BAD_SQL_GRAMMAR_CODES = new HashSet<String>(8);
|
||||
|
||||
private static final Set DATA_INTEGRITY_VIOLATION_CODES = new HashSet(8);
|
||||
private static final Set<String> DATA_INTEGRITY_VIOLATION_CODES = new HashSet<String>(8);
|
||||
|
||||
private static final Set DATA_ACCESS_RESOURCE_FAILURE_CODES = new HashSet(8);
|
||||
private static final Set<String> DATA_ACCESS_RESOURCE_FAILURE_CODES = new HashSet<String>(8);
|
||||
|
||||
private static final Set TRANSIENT_DATA_ACCESS_RESOURCE_CODES = new HashSet(8);
|
||||
private static final Set<String> TRANSIENT_DATA_ACCESS_RESOURCE_CODES = new HashSet<String>(8);
|
||||
|
||||
private static final Set CONCURRENCY_FAILURE_CODES = new HashSet(4);
|
||||
private static final Set<String> CONCURRENCY_FAILURE_CODES = new HashSet<String>(4);
|
||||
|
||||
|
||||
static {
|
||||
|
||||
Reference in New Issue
Block a user