Explicit type can be replaced by <>
Issue: SPR-13188
This commit is contained in:
@@ -51,7 +51,7 @@ class DatabasePopulatorConfigUtils {
|
||||
boolean ignoreFailedDrops = element.getAttribute("ignore-failures").equals("DROPS");
|
||||
boolean continueOnError = element.getAttribute("ignore-failures").equals("ALL");
|
||||
|
||||
ManagedList<BeanMetadataElement> delegates = new ManagedList<BeanMetadataElement>();
|
||||
ManagedList<BeanMetadataElement> delegates = new ManagedList<>();
|
||||
for (Element scriptElement : scripts) {
|
||||
String executionAttr = scriptElement.getAttribute("execution");
|
||||
if (!StringUtils.hasText(executionAttr)) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -72,9 +72,9 @@ public class SortedResourcesFactoryBean extends AbstractFactoryBean<Resource[]>
|
||||
|
||||
@Override
|
||||
protected Resource[] createInstance() throws Exception {
|
||||
List<Resource> scripts = new ArrayList<Resource>();
|
||||
List<Resource> scripts = new ArrayList<>();
|
||||
for (String location : this.locations) {
|
||||
List<Resource> resources = new ArrayList<Resource>(
|
||||
List<Resource> resources = new ArrayList<>(
|
||||
Arrays.asList(this.resourcePatternResolver.getResources(location)));
|
||||
Collections.sort(resources, new Comparator<Resource>() {
|
||||
@Override
|
||||
|
||||
@@ -212,8 +212,8 @@ public class BeanPropertyRowMapper<T> implements RowMapper<T> {
|
||||
*/
|
||||
protected void initialize(Class<T> mappedClass) {
|
||||
this.mappedClass = mappedClass;
|
||||
this.mappedFields = new HashMap<String, PropertyDescriptor>();
|
||||
this.mappedProperties = new HashSet<String>();
|
||||
this.mappedFields = new HashMap<>();
|
||||
this.mappedProperties = new HashSet<>();
|
||||
PropertyDescriptor[] pds = BeanUtils.getPropertyDescriptors(mappedClass);
|
||||
for (PropertyDescriptor pd : pds) {
|
||||
if (pd.getWriteMethod() != null) {
|
||||
@@ -280,7 +280,7 @@ public class BeanPropertyRowMapper<T> implements RowMapper<T> {
|
||||
|
||||
ResultSetMetaData rsmd = rs.getMetaData();
|
||||
int columnCount = rsmd.getColumnCount();
|
||||
Set<String> populatedProperties = (isCheckFullyPopulated() ? new HashSet<String>() : null);
|
||||
Set<String> populatedProperties = (isCheckFullyPopulated() ? new HashSet<>() : null);
|
||||
|
||||
for (int index = 1; index <= columnCount; index++) {
|
||||
String column = JdbcUtils.lookupColumnName(rsmd, index);
|
||||
@@ -377,7 +377,7 @@ public class BeanPropertyRowMapper<T> implements RowMapper<T> {
|
||||
* @param mappedClass the class that each row should be mapped to
|
||||
*/
|
||||
public static <T> BeanPropertyRowMapper<T> newInstance(Class<T> mappedClass) {
|
||||
return new BeanPropertyRowMapper<T>(mappedClass);
|
||||
return new BeanPropertyRowMapper<>(mappedClass);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -58,7 +58,7 @@ public class CallableStatementCreatorFactory {
|
||||
*/
|
||||
public CallableStatementCreatorFactory(String callString) {
|
||||
this.callString = callString;
|
||||
this.declaredParameters = new LinkedList<SqlParameter>();
|
||||
this.declaredParameters = new LinkedList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,7 +113,7 @@ public class CallableStatementCreatorFactory {
|
||||
* @param params list of parameters (may be {@code null})
|
||||
*/
|
||||
public CallableStatementCreator newCallableStatementCreator(Map<String, ?> params) {
|
||||
return new CallableStatementCreatorImpl(params != null ? params : new HashMap<String, Object>());
|
||||
return new CallableStatementCreatorImpl(params != null ? params : new HashMap<>());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -69,7 +69,7 @@ public class ColumnMapRowMapper implements RowMapper<Map<String, Object>> {
|
||||
* @see org.springframework.util.LinkedCaseInsensitiveMap
|
||||
*/
|
||||
protected Map<String, Object> createColumnMap(int columnCount) {
|
||||
return new LinkedCaseInsensitiveMap<Object>(columnCount);
|
||||
return new LinkedCaseInsensitiveMap<>(columnCount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -481,7 +481,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
|
||||
@Override
|
||||
public <T> List<T> query(String sql, RowMapper<T> rowMapper) throws DataAccessException {
|
||||
return query(sql, new RowMapperResultSetExtractor<T>(rowMapper));
|
||||
return query(sql, new RowMapperResultSetExtractor<>(rowMapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -758,46 +758,46 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
|
||||
@Override
|
||||
public <T> List<T> query(PreparedStatementCreator psc, RowMapper<T> rowMapper) throws DataAccessException {
|
||||
return query(psc, new RowMapperResultSetExtractor<T>(rowMapper));
|
||||
return query(psc, new RowMapperResultSetExtractor<>(rowMapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<T> query(String sql, PreparedStatementSetter pss, RowMapper<T> rowMapper) throws DataAccessException {
|
||||
return query(sql, pss, new RowMapperResultSetExtractor<T>(rowMapper));
|
||||
return query(sql, pss, new RowMapperResultSetExtractor<>(rowMapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<T> query(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper) throws DataAccessException {
|
||||
return query(sql, args, argTypes, new RowMapperResultSetExtractor<T>(rowMapper));
|
||||
return query(sql, args, argTypes, new RowMapperResultSetExtractor<>(rowMapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<T> query(String sql, Object[] args, RowMapper<T> rowMapper) throws DataAccessException {
|
||||
return query(sql, args, new RowMapperResultSetExtractor<T>(rowMapper));
|
||||
return query(sql, args, new RowMapperResultSetExtractor<>(rowMapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> List<T> query(String sql, RowMapper<T> rowMapper, Object... args) throws DataAccessException {
|
||||
return query(sql, args, new RowMapperResultSetExtractor<T>(rowMapper));
|
||||
return query(sql, args, new RowMapperResultSetExtractor<>(rowMapper));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T queryForObject(String sql, Object[] args, int[] argTypes, RowMapper<T> rowMapper)
|
||||
throws DataAccessException {
|
||||
|
||||
List<T> results = query(sql, args, argTypes, new RowMapperResultSetExtractor<T>(rowMapper, 1));
|
||||
List<T> results = query(sql, args, argTypes, new RowMapperResultSetExtractor<>(rowMapper, 1));
|
||||
return DataAccessUtils.requiredSingleResult(results);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T queryForObject(String sql, Object[] args, RowMapper<T> rowMapper) throws DataAccessException {
|
||||
List<T> results = query(sql, args, new RowMapperResultSetExtractor<T>(rowMapper, 1));
|
||||
List<T> results = query(sql, args, new RowMapperResultSetExtractor<>(rowMapper, 1));
|
||||
return DataAccessUtils.requiredSingleResult(results);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T queryForObject(String sql, RowMapper<T> rowMapper, Object... args) throws DataAccessException {
|
||||
List<T> results = query(sql, args, new RowMapperResultSetExtractor<T>(rowMapper, 1));
|
||||
List<T> results = query(sql, args, new RowMapperResultSetExtractor<>(rowMapper, 1));
|
||||
return DataAccessUtils.requiredSingleResult(results);
|
||||
}
|
||||
|
||||
@@ -911,7 +911,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
if (keys != null) {
|
||||
try {
|
||||
RowMapperResultSetExtractor<Map<String, Object>> rse =
|
||||
new RowMapperResultSetExtractor<Map<String, Object>>(getColumnMapRowMapper(), 1);
|
||||
new RowMapperResultSetExtractor<>(getColumnMapRowMapper(), 1);
|
||||
generatedKeys.addAll(rse.extractData(keys));
|
||||
}
|
||||
finally {
|
||||
@@ -966,7 +966,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
return ps.executeBatch();
|
||||
}
|
||||
else {
|
||||
List<Integer> rowsAffected = new ArrayList<Integer>();
|
||||
List<Integer> rowsAffected = new ArrayList<>();
|
||||
for (int i = 0; i < batchSize; i++) {
|
||||
pss.setValues(ps, i);
|
||||
if (ipss != null && ipss.isBatchExhausted(i)) {
|
||||
@@ -1010,7 +1010,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
return execute(sql, new PreparedStatementCallback<int[][]>() {
|
||||
@Override
|
||||
public int[][] doInPreparedStatement(PreparedStatement ps) throws SQLException {
|
||||
List<int[]> rowsAffected = new ArrayList<int[]>();
|
||||
List<int[]> rowsAffected = new ArrayList<>();
|
||||
try {
|
||||
boolean batchSupported = true;
|
||||
if (!JdbcUtils.supportsBatchUpdates(ps.getConnection())) {
|
||||
@@ -1116,9 +1116,9 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
public Map<String, Object> call(CallableStatementCreator csc, List<SqlParameter> declaredParameters)
|
||||
throws DataAccessException {
|
||||
|
||||
final List<SqlParameter> updateCountParameters = new ArrayList<SqlParameter>();
|
||||
final List<SqlParameter> resultSetParameters = new ArrayList<SqlParameter>();
|
||||
final List<SqlParameter> callParameters = new ArrayList<SqlParameter>();
|
||||
final List<SqlParameter> updateCountParameters = new ArrayList<>();
|
||||
final List<SqlParameter> resultSetParameters = new ArrayList<>();
|
||||
final List<SqlParameter> callParameters = new ArrayList<>();
|
||||
for (SqlParameter parameter : declaredParameters) {
|
||||
if (parameter.isResultsParameter()) {
|
||||
if (parameter instanceof SqlReturnResultSet) {
|
||||
@@ -1162,7 +1162,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
List<SqlParameter> updateCountParameters, List<SqlParameter> resultSetParameters, int updateCount)
|
||||
throws SQLException {
|
||||
|
||||
Map<String, Object> returnedResults = new HashMap<String, Object>();
|
||||
Map<String, Object> returnedResults = new HashMap<>();
|
||||
int rsIndex = 0;
|
||||
int updateIndex = 0;
|
||||
boolean moreResults;
|
||||
@@ -1224,7 +1224,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
protected Map<String, Object> extractOutputParameters(CallableStatement cs, List<SqlParameter> parameters)
|
||||
throws SQLException {
|
||||
|
||||
Map<String, Object> returnedResults = new HashMap<String, Object>();
|
||||
Map<String, Object> returnedResults = new HashMap<>();
|
||||
int sqlColIndex = 1;
|
||||
for (SqlParameter param : parameters) {
|
||||
if (param instanceof SqlOutParameter) {
|
||||
@@ -1272,7 +1272,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
if (rs == null) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, Object> returnedResults = new HashMap<String, Object>();
|
||||
Map<String, Object> returnedResults = new HashMap<>();
|
||||
try {
|
||||
ResultSet rsToUse = rs;
|
||||
if (this.nativeJdbcExtractor != null) {
|
||||
@@ -1320,7 +1320,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
* @see SingleColumnRowMapper
|
||||
*/
|
||||
protected <T> RowMapper<T> getSingleColumnRowMapper(Class<T> requiredType) {
|
||||
return new SingleColumnRowMapper<T>(requiredType);
|
||||
return new SingleColumnRowMapper<>(requiredType);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1334,10 +1334,10 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
*/
|
||||
protected Map<String, Object> createResultsMap() {
|
||||
if (isResultsMapCaseInsensitive()) {
|
||||
return new LinkedCaseInsensitiveMap<Object>();
|
||||
return new LinkedCaseInsensitiveMap<>();
|
||||
}
|
||||
else {
|
||||
return new LinkedHashMap<String, Object>();
|
||||
return new LinkedHashMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -67,7 +67,7 @@ public class PreparedStatementCreatorFactory {
|
||||
*/
|
||||
public PreparedStatementCreatorFactory(String sql) {
|
||||
this.sql = sql;
|
||||
this.declaredParameters = new LinkedList<SqlParameter>();
|
||||
this.declaredParameters = new LinkedList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,7 +205,7 @@ public class PreparedStatementCreatorFactory {
|
||||
this.parameters = parameters;
|
||||
if (this.parameters.size() != declaredParameters.size()) {
|
||||
// account for named parameters being used multiple times
|
||||
Set<String> names = new HashSet<String>();
|
||||
Set<String> names = new HashSet<>();
|
||||
for (int i = 0; i < parameters.size(); i++) {
|
||||
Object param = parameters.get(i);
|
||||
if (param instanceof SqlParameterValue) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -87,7 +87,7 @@ public class RowMapperResultSetExtractor<T> implements ResultSetExtractor<List<T
|
||||
|
||||
@Override
|
||||
public List<T> extractData(ResultSet rs) throws SQLException {
|
||||
List<T> results = (this.rowsExpected > 0 ? new ArrayList<T>(this.rowsExpected) : new ArrayList<T>());
|
||||
List<T> results = (this.rowsExpected > 0 ? new ArrayList<>(this.rowsExpected) : new ArrayList<T>());
|
||||
int rowNum = 0;
|
||||
while (rs.next()) {
|
||||
results.add(this.rowMapper.mapRow(rs, rowNum++));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -197,7 +197,7 @@ public class SingleColumnRowMapper<T> implements RowMapper<T> {
|
||||
* @since 4.1
|
||||
*/
|
||||
public static <T> SingleColumnRowMapper<T> newInstance(Class<T> requiredType) {
|
||||
return new SingleColumnRowMapper<T>(requiredType);
|
||||
return new SingleColumnRowMapper<>(requiredType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -177,7 +177,7 @@ public class SqlParameter {
|
||||
* to a List of SqlParameter objects as used in this package.
|
||||
*/
|
||||
public static List<SqlParameter> sqlTypesToAnonymousParameterList(int... types) {
|
||||
List<SqlParameter> result = new LinkedList<SqlParameter>();
|
||||
List<SqlParameter> result = new LinkedList<>();
|
||||
if (types != null) {
|
||||
for (int type : types) {
|
||||
result.add(new SqlParameter(type));
|
||||
|
||||
@@ -86,7 +86,7 @@ public abstract class StatementCreatorUtils {
|
||||
|
||||
private static final Log logger = LogFactory.getLog(StatementCreatorUtils.class);
|
||||
|
||||
private static final Map<Class<?>, Integer> javaTypeToSqlTypeMap = new HashMap<Class<?>, Integer>(32);
|
||||
private static final Map<Class<?>, Integer> javaTypeToSqlTypeMap = new HashMap<>(32);
|
||||
|
||||
static {
|
||||
javaTypeToSqlTypeMap.put(boolean.class, Types.BOOLEAN);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -64,16 +64,16 @@ public class CallMetaDataContext {
|
||||
private String schemaName;
|
||||
|
||||
/** List of SqlParameter objects to be used in call execution */
|
||||
private List<SqlParameter> callParameters = new ArrayList<SqlParameter>();
|
||||
private List<SqlParameter> callParameters = new ArrayList<>();
|
||||
|
||||
/** Actual name to use for the return value in the output map */
|
||||
private String actualFunctionReturnName;
|
||||
|
||||
/** Set of in parameter names to exclude use for any not listed */
|
||||
private Set<String> limitedInParameterNames = new HashSet<String>();
|
||||
private Set<String> limitedInParameterNames = new HashSet<>();
|
||||
|
||||
/** List of SqlParameter names for out parameters */
|
||||
private List<String> outParameterNames = new ArrayList<String>();
|
||||
private List<String> outParameterNames = new ArrayList<>();
|
||||
|
||||
/** Indicates whether this is a procedure or a function **/
|
||||
private boolean function = false;
|
||||
@@ -300,11 +300,11 @@ public class CallMetaDataContext {
|
||||
* Reconcile the provided parameters with available metadata and add new ones where appropriate.
|
||||
*/
|
||||
protected List<SqlParameter> reconcileParameters(List<SqlParameter> parameters) {
|
||||
final List<SqlParameter> declaredReturnParams = new ArrayList<SqlParameter>();
|
||||
final Map<String, SqlParameter> declaredParams = new LinkedHashMap<String, SqlParameter>();
|
||||
final List<SqlParameter> declaredReturnParams = new ArrayList<>();
|
||||
final Map<String, SqlParameter> declaredParams = new LinkedHashMap<>();
|
||||
boolean returnDeclared = false;
|
||||
List<String> outParamNames = new ArrayList<String>();
|
||||
List<String> metaDataParamNames = new ArrayList<String>();
|
||||
List<String> outParamNames = new ArrayList<>();
|
||||
List<String> metaDataParamNames = new ArrayList<>();
|
||||
|
||||
// Get the names of the meta data parameters
|
||||
for (CallParameterMetaData meta : this.metaDataProvider.getCallParameterMetaData()) {
|
||||
@@ -343,7 +343,7 @@ public class CallMetaDataContext {
|
||||
}
|
||||
setOutParameterNames(outParamNames);
|
||||
|
||||
List<SqlParameter> workParams = new ArrayList<SqlParameter>();
|
||||
List<SqlParameter> workParams = new ArrayList<>();
|
||||
workParams.addAll(declaredReturnParams);
|
||||
|
||||
if (!this.metaDataProvider.isProcedureColumnMetaDataUsed()) {
|
||||
@@ -351,7 +351,7 @@ public class CallMetaDataContext {
|
||||
return workParams;
|
||||
}
|
||||
|
||||
Map<String, String> limitedInParamNamesMap = new HashMap<String, String>(this.limitedInParameterNames.size());
|
||||
Map<String, String> limitedInParamNamesMap = new HashMap<>(this.limitedInParameterNames.size());
|
||||
for (String limitedParamName : this.limitedInParameterNames) {
|
||||
limitedInParamNamesMap.put(
|
||||
this.metaDataProvider.parameterNameToUse(limitedParamName).toLowerCase(), limitedParamName);
|
||||
@@ -460,8 +460,8 @@ public class CallMetaDataContext {
|
||||
Map<String, String> caseInsensitiveParameterNames =
|
||||
SqlParameterSourceUtils.extractCaseInsensitiveParameterNames(parameterSource);
|
||||
|
||||
Map<String, String> callParameterNames = new HashMap<String, String>(this.callParameters.size());
|
||||
Map<String, Object> matchedParameters = new HashMap<String, Object>(this.callParameters.size());
|
||||
Map<String, String> callParameterNames = new HashMap<>(this.callParameters.size());
|
||||
Map<String, Object> matchedParameters = new HashMap<>(this.callParameters.size());
|
||||
for (SqlParameter parameter : this.callParameters) {
|
||||
if (parameter.isInputValueProvided()) {
|
||||
String parameterName = parameter.getName();
|
||||
@@ -521,7 +521,7 @@ public class CallMetaDataContext {
|
||||
if (!this.metaDataProvider.isProcedureColumnMetaDataUsed()) {
|
||||
return inParameters;
|
||||
}
|
||||
Map<String, String> callParameterNames = new HashMap<String, String>(this.callParameters.size());
|
||||
Map<String, String> callParameterNames = new HashMap<>(this.callParameters.size());
|
||||
for (SqlParameter parameter : this.callParameters) {
|
||||
if (parameter.isInputValueProvided()) {
|
||||
String parameterName = parameter.getName();
|
||||
@@ -531,7 +531,7 @@ public class CallMetaDataContext {
|
||||
}
|
||||
}
|
||||
}
|
||||
Map<String, Object> matchedParameters = new HashMap<String, Object>(inParameters.size());
|
||||
Map<String, Object> matchedParameters = new HashMap<>(inParameters.size());
|
||||
for (String parameterName : inParameters.keySet()) {
|
||||
String parameterNameToMatch = this.metaDataProvider.parameterNameToUse(parameterName);
|
||||
String callParameterName = callParameterNames.get(parameterNameToMatch.toLowerCase());
|
||||
@@ -569,7 +569,7 @@ public class CallMetaDataContext {
|
||||
}
|
||||
|
||||
public Map<String, ?> matchInParameterValuesWithCallParameters(Object[] parameterValues) {
|
||||
Map<String, Object> matchedParameters = new HashMap<String, Object>(parameterValues.length);
|
||||
Map<String, Object> matchedParameters = new HashMap<>(parameterValues.length);
|
||||
int i = 0;
|
||||
for (SqlParameter parameter : this.callParameters) {
|
||||
if (parameter.isInputValueProvided()) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -56,7 +56,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider {
|
||||
|
||||
private boolean storesLowerCaseIdentifiers = false;
|
||||
|
||||
private List<CallParameterMetaData> callParameterMetaData = new ArrayList<CallParameterMetaData>();
|
||||
private List<CallParameterMetaData> callParameterMetaData = new ArrayList<>();
|
||||
|
||||
|
||||
/**
|
||||
@@ -323,7 +323,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider {
|
||||
ResultSet procs = null;
|
||||
try {
|
||||
procs = databaseMetaData.getProcedures(metaDataCatalogName, metaDataSchemaName, metaDataProcedureName);
|
||||
List<String> found = new ArrayList<String>();
|
||||
List<String> found = new ArrayList<>();
|
||||
while (procs.next()) {
|
||||
found.add(procs.getString("PROCEDURE_CAT") + "." + procs.getString("PROCEDURE_SCHEM") +
|
||||
"." + procs.getString("PROCEDURE_NAME"));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -70,7 +70,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider {
|
||||
Arrays.asList("Apache Derby", "HSQL Database Engine");
|
||||
|
||||
/** Collection of TableParameterMetaData objects */
|
||||
private List<TableParameterMetaData> tableParameterMetaData = new ArrayList<TableParameterMetaData>();
|
||||
private List<TableParameterMetaData> tableParameterMetaData = new ArrayList<>();
|
||||
|
||||
/** NativeJdbcExtractor that can be used to retrieve the native connection */
|
||||
private NativeJdbcExtractor nativeJdbcExtractor;
|
||||
@@ -294,7 +294,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider {
|
||||
private void locateTableAndProcessMetaData(DatabaseMetaData databaseMetaData, String catalogName,
|
||||
String schemaName, String tableName) {
|
||||
|
||||
Map<String, TableMetaData> tableMeta = new HashMap<String, TableMetaData>();
|
||||
Map<String, TableMetaData> tableMeta = new HashMap<>();
|
||||
ResultSet tables = null;
|
||||
try {
|
||||
tables = databaseMetaData.getTables(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -57,7 +57,7 @@ public class TableMetaDataContext {
|
||||
private String schemaName;
|
||||
|
||||
/** List of columns objects to be used in this context */
|
||||
private List<String> tableColumns = new ArrayList<String>();
|
||||
private List<String> tableColumns = new ArrayList<>();
|
||||
|
||||
/** should we access insert parameter meta data info or not */
|
||||
private boolean accessTableColumnMetaData = true;
|
||||
@@ -217,13 +217,13 @@ public class TableMetaDataContext {
|
||||
this.generatedKeyColumnsUsed = true;
|
||||
}
|
||||
if (declaredColumns.size() > 0) {
|
||||
return new ArrayList<String>(declaredColumns);
|
||||
return new ArrayList<>(declaredColumns);
|
||||
}
|
||||
Set<String> keys = new LinkedHashSet<String>(generatedKeyNames.length);
|
||||
Set<String> keys = new LinkedHashSet<>(generatedKeyNames.length);
|
||||
for (String key : generatedKeyNames) {
|
||||
keys.add(key.toUpperCase());
|
||||
}
|
||||
List<String> columns = new ArrayList<String>();
|
||||
List<String> columns = new ArrayList<>();
|
||||
for (TableParameterMetaData meta : metaDataProvider.getTableParameterMetaData()) {
|
||||
if (!keys.contains(meta.getParameterName().toUpperCase())) {
|
||||
columns.add(meta.getParameterName());
|
||||
@@ -237,7 +237,7 @@ public class TableMetaDataContext {
|
||||
* @param parameterSource the parameter names and values
|
||||
*/
|
||||
public List<Object> matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource) {
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
List<Object> values = new ArrayList<>();
|
||||
// for parameter source lookups we need to provide caseinsensitive lookup support since the
|
||||
// database metadata is not necessarily providing case sensitive column names
|
||||
Map<String, String> caseInsensitiveParameterNames =
|
||||
@@ -277,8 +277,8 @@ public class TableMetaDataContext {
|
||||
* @param inParameters the parameter names and values
|
||||
*/
|
||||
public List<Object> matchInParameterValuesWithInsertColumns(Map<String, ?> inParameters) {
|
||||
List<Object> values = new ArrayList<Object>();
|
||||
Map<String, Object> source = new LinkedHashMap<String, Object>(inParameters.size());
|
||||
List<Object> values = new ArrayList<>();
|
||||
Map<String, Object> source = new LinkedHashMap<>(inParameters.size());
|
||||
for (String key : inParameters.keySet()) {
|
||||
source.put(key.toLowerCase(), inParameters.get(key));
|
||||
}
|
||||
@@ -294,7 +294,7 @@ public class TableMetaDataContext {
|
||||
* @return the insert string to be used
|
||||
*/
|
||||
public String createInsertString(String... generatedKeyNames) {
|
||||
Set<String> keys = new LinkedHashSet<String>(generatedKeyNames.length);
|
||||
Set<String> keys = new LinkedHashSet<>(generatedKeyNames.length);
|
||||
for (String key : generatedKeyNames) {
|
||||
keys.add(key.toUpperCase());
|
||||
}
|
||||
@@ -345,7 +345,7 @@ public class TableMetaDataContext {
|
||||
int[] types = new int[getTableColumns().size()];
|
||||
List<TableParameterMetaData> parameters = this.metaDataProvider.getTableParameterMetaData();
|
||||
Map<String, TableParameterMetaData> parameterMap =
|
||||
new LinkedHashMap<String, TableParameterMetaData>(parameters.size());
|
||||
new LinkedHashMap<>(parameters.size());
|
||||
for (TableParameterMetaData tpmd : parameters) {
|
||||
parameterMap.put(tpmd.getParameterName().toUpperCase(), tpmd);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -30,9 +30,9 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public abstract class AbstractSqlParameterSource implements SqlParameterSource {
|
||||
|
||||
private final Map<String, Integer> sqlTypes = new HashMap<String, Integer>();
|
||||
private final Map<String, Integer> sqlTypes = new HashMap<>();
|
||||
|
||||
private final Map<String, String> typeNames = new HashMap<String, String>();
|
||||
private final Map<String, String> typeNames = new HashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -77,7 +77,7 @@ public class BeanPropertySqlParameterSource extends AbstractSqlParameterSource {
|
||||
*/
|
||||
public String[] getReadablePropertyNames() {
|
||||
if (this.propertyNames == null) {
|
||||
List<String> names = new ArrayList<String>();
|
||||
List<String> names = new ArrayList<>();
|
||||
PropertyDescriptor[] props = this.beanWrapper.getPropertyDescriptors();
|
||||
for (PropertyDescriptor pd : props) {
|
||||
if (this.beanWrapper.isReadableProperty(pd.getName())) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -43,7 +43,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class MapSqlParameterSource extends AbstractSqlParameterSource {
|
||||
|
||||
private final Map<String, Object> values = new LinkedHashMap<String, Object>();
|
||||
private final Map<String, Object> values = new LinkedHashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -223,14 +223,14 @@ public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations
|
||||
public <T> T queryForObject(String sql, SqlParameterSource paramSource, Class<T> requiredType)
|
||||
throws DataAccessException {
|
||||
|
||||
return queryForObject(sql, paramSource, new SingleColumnRowMapper<T>(requiredType));
|
||||
return queryForObject(sql, paramSource, new SingleColumnRowMapper<>(requiredType));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T queryForObject(String sql, Map<String, ?> paramMap, Class<T> requiredType)
|
||||
throws DataAccessException {
|
||||
|
||||
return queryForObject(sql, paramMap, new SingleColumnRowMapper<T>(requiredType));
|
||||
return queryForObject(sql, paramMap, new SingleColumnRowMapper<>(requiredType));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -247,7 +247,7 @@ public class NamedParameterJdbcTemplate implements NamedParameterJdbcOperations
|
||||
public <T> List<T> queryForList(String sql, SqlParameterSource paramSource, Class<T> elementType)
|
||||
throws DataAccessException {
|
||||
|
||||
return query(sql, paramSource, new SingleColumnRowMapper<T>(elementType));
|
||||
return query(sql, paramSource, new SingleColumnRowMapper<>(elementType));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -74,9 +74,9 @@ public abstract class NamedParameterUtils {
|
||||
public static ParsedSql parseSqlStatement(final String sql) {
|
||||
Assert.notNull(sql, "SQL must not be null");
|
||||
|
||||
Set<String> namedParameters = new HashSet<String>();
|
||||
Set<String> namedParameters = new HashSet<>();
|
||||
String sqlToUse = sql;
|
||||
List<ParameterHolder> parameterList = new ArrayList<ParameterHolder>();
|
||||
List<ParameterHolder> parameterList = new ArrayList<>();
|
||||
|
||||
char[] statement = sql.toCharArray();
|
||||
int namedParameterCount = 0;
|
||||
@@ -416,7 +416,7 @@ public abstract class NamedParameterUtils {
|
||||
*/
|
||||
public static List<SqlParameter> buildSqlParameterList(ParsedSql parsedSql, SqlParameterSource paramSource) {
|
||||
List<String> paramNames = parsedSql.getParameterNames();
|
||||
List<SqlParameter> params = new LinkedList<SqlParameter>();
|
||||
List<SqlParameter> params = new LinkedList<>();
|
||||
for (String paramName : paramNames) {
|
||||
params.add(new SqlParameter(paramName, paramSource.getSqlType(paramName), paramSource.getTypeName(paramName)));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -30,9 +30,9 @@ public class ParsedSql {
|
||||
|
||||
private String originalSql;
|
||||
|
||||
private List<String> parameterNames = new ArrayList<String>();
|
||||
private List<String> parameterNames = new ArrayList<>();
|
||||
|
||||
private List<int[]> parameterIndexes = new ArrayList<int[]>();
|
||||
private List<int[]> parameterIndexes = new ArrayList<>();
|
||||
|
||||
private int namedParameterCount;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -87,7 +87,7 @@ public class SqlParameterSourceUtils {
|
||||
* @return the Map that can be used for case insensitive matching of parameter names
|
||||
*/
|
||||
public static Map<String, String> extractCaseInsensitiveParameterNames(SqlParameterSource parameterSource) {
|
||||
Map<String, String> caseInsensitiveParameterNames = new HashMap<String, String>();
|
||||
Map<String, String> caseInsensitiveParameterNames = new HashMap<>();
|
||||
if (parameterSource instanceof BeanPropertySqlParameterSource) {
|
||||
String[] propertyNames = ((BeanPropertySqlParameterSource)parameterSource).getReadablePropertyNames();
|
||||
for (int i = 0; i < propertyNames.length; i++) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -58,10 +58,10 @@ public abstract class AbstractJdbcCall {
|
||||
private final CallMetaDataContext callMetaDataContext = new CallMetaDataContext();
|
||||
|
||||
/** List of SqlParameter objects */
|
||||
private final List<SqlParameter> declaredParameters = new ArrayList<SqlParameter>();
|
||||
private final List<SqlParameter> declaredParameters = new ArrayList<>();
|
||||
|
||||
/** List of RefCursor/ResultSet RowMapper objects */
|
||||
private final Map<String, RowMapper<?>> declaredRowMappers = new LinkedHashMap<String, RowMapper<?>>();
|
||||
private final Map<String, RowMapper<?>> declaredRowMappers = new LinkedHashMap<>();
|
||||
|
||||
/**
|
||||
* Has this operation been compiled? Compilation means at least checking
|
||||
|
||||
@@ -71,7 +71,7 @@ public abstract class AbstractJdbcInsert {
|
||||
private final TableMetaDataContext tableMetaDataContext = new TableMetaDataContext();
|
||||
|
||||
/** List of columns objects to be used in insert statement */
|
||||
private final List<String> declaredColumns = new ArrayList<String>();
|
||||
private final List<String> declaredColumns = new ArrayList<>();
|
||||
|
||||
/** The names of the columns holding the generated key */
|
||||
private String[] generatedKeyNames = new String[0];
|
||||
@@ -467,7 +467,7 @@ public abstract class AbstractJdbcInsert {
|
||||
if (keyQuery.toUpperCase().startsWith("RETURNING")) {
|
||||
Long key = getJdbcTemplate().queryForObject(getInsertString() + " " + keyQuery,
|
||||
values.toArray(new Object[values.size()]), Long.class);
|
||||
Map<String, Object> keys = new HashMap<String, Object>(1);
|
||||
Map<String, Object> keys = new HashMap<>(1);
|
||||
keys.put(getGeneratedKeyNames()[0], key);
|
||||
keyHolder.getKeyList().add(keys);
|
||||
}
|
||||
@@ -488,7 +488,7 @@ public abstract class AbstractJdbcInsert {
|
||||
//Get the key
|
||||
Statement keyStmt = null;
|
||||
ResultSet rs = null;
|
||||
Map<String, Object> keys = new HashMap<String, Object>(1);
|
||||
Map<String, Object> keys = new HashMap<>(1);
|
||||
try {
|
||||
keyStmt = con.createStatement();
|
||||
rs = keyStmt.executeQuery(keyQuery);
|
||||
@@ -545,7 +545,7 @@ public abstract class AbstractJdbcInsert {
|
||||
@SuppressWarnings("unchecked")
|
||||
protected int[] doExecuteBatch(Map<String, ?>... batch) {
|
||||
checkCompiled();
|
||||
List<List<Object>> batchValues = new ArrayList<List<Object>>(batch.length);
|
||||
List<List<Object>> batchValues = new ArrayList<>(batch.length);
|
||||
for (Map<String, ?> args : batch) {
|
||||
batchValues.add(matchInParameterValuesWithInsertColumns(args));
|
||||
}
|
||||
@@ -559,7 +559,7 @@ public abstract class AbstractJdbcInsert {
|
||||
*/
|
||||
protected int[] doExecuteBatch(SqlParameterSource... batch) {
|
||||
checkCompiled();
|
||||
List<List<Object>> batchValues = new ArrayList<List<Object>>(batch.length);
|
||||
List<List<Object>> batchValues = new ArrayList<>(batch.length);
|
||||
for (SqlParameterSource parameterSource : batch) {
|
||||
batchValues.add(matchInParameterValuesWithInsertColumns(parameterSource));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -125,7 +125,7 @@ public class SimpleJdbcCall extends AbstractJdbcCall implements SimpleJdbcCallOp
|
||||
|
||||
@Override
|
||||
public SimpleJdbcCall useInParameterNames(String... inParameterNames) {
|
||||
setInParameterNames(new LinkedHashSet<String>(Arrays.asList(inParameterNames)));
|
||||
setInParameterNames(new LinkedHashSet<>(Arrays.asList(inParameterNames)));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -66,7 +66,7 @@ public class UserCredentialsDataSourceAdapter extends DelegatingDataSource {
|
||||
private String password;
|
||||
|
||||
private final ThreadLocal<JdbcUserCredentials> threadBoundCredentials =
|
||||
new NamedThreadLocal<JdbcUserCredentials>("Current JDBC user credentials");
|
||||
new NamedThreadLocal<>("Current JDBC user credentials");
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,7 +35,7 @@ import java.util.List;
|
||||
*/
|
||||
public class CompositeDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
private final List<DatabasePopulator> populators = new ArrayList<DatabasePopulator>(4);
|
||||
private final List<DatabasePopulator> populators = new ArrayList<>(4);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
|
||||
private List<Resource> scripts = new ArrayList<Resource>();
|
||||
private List<Resource> scripts = new ArrayList<>();
|
||||
|
||||
private String sqlScriptEncoding;
|
||||
|
||||
@@ -137,7 +137,7 @@ public class ResourceDatabasePopulator implements DatabasePopulator {
|
||||
public void setScripts(Resource... scripts) {
|
||||
assertContentsOfScriptArray(scripts);
|
||||
// Ensure that the list is modifiable
|
||||
this.scripts = new ArrayList<Resource>(Arrays.asList(scripts));
|
||||
this.scripts = new ArrayList<>(Arrays.asList(scripts));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -460,7 +460,7 @@ public abstract class ScriptUtils {
|
||||
separator = FALLBACK_STATEMENT_SEPARATOR;
|
||||
}
|
||||
|
||||
List<String> statements = new LinkedList<String>();
|
||||
List<String> statements = new LinkedList<>();
|
||||
splitSqlScript(resource, script, separator, commentPrefix, blockCommentStartDelimiter,
|
||||
blockCommentEndDelimiter, statements);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -112,7 +112,7 @@ public abstract class AbstractRoutingDataSource extends AbstractDataSource imple
|
||||
if (this.targetDataSources == null) {
|
||||
throw new IllegalArgumentException("Property 'targetDataSources' is required");
|
||||
}
|
||||
this.resolvedDataSources = new HashMap<Object, DataSource>(this.targetDataSources.size());
|
||||
this.resolvedDataSources = new HashMap<>(this.targetDataSources.size());
|
||||
for (Map.Entry<Object, Object> entry : this.targetDataSources.entrySet()) {
|
||||
Object lookupKey = resolveSpecifiedLookupKey(entry.getKey());
|
||||
DataSource dataSource = resolveSpecifiedDataSource(entry.getValue());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -36,7 +36,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class MapDataSourceLookup implements DataSourceLookup {
|
||||
|
||||
private final Map<String, DataSource> dataSources = new HashMap<String, DataSource>(4);
|
||||
private final Map<String, DataSource> dataSources = new HashMap<>(4);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -55,9 +55,9 @@ public class BatchSqlUpdate extends SqlUpdate {
|
||||
|
||||
private boolean trackRowsAffected = true;
|
||||
|
||||
private final LinkedList<Object[]> parameterQueue = new LinkedList<Object[]>();
|
||||
private final LinkedList<Object[]> parameterQueue = new LinkedList<>();
|
||||
|
||||
private final List<Integer> rowsAffected = new ArrayList<Integer>();
|
||||
private final List<Integer> rowsAffected = new ArrayList<>();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -74,7 +74,7 @@ public abstract class RdbmsOperation implements InitializingBean {
|
||||
|
||||
private String sql;
|
||||
|
||||
private final List<SqlParameter> declaredParameters = new LinkedList<SqlParameter>();
|
||||
private final List<SqlParameter> declaredParameters = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* Has this operation been compiled? Compilation means at
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -49,7 +49,7 @@ import org.springframework.jdbc.core.SingleColumnRowMapper;
|
||||
*/
|
||||
public class SqlFunction<T> extends MappingSqlQuery<T> {
|
||||
|
||||
private final SingleColumnRowMapper<T> rowMapper = new SingleColumnRowMapper<T>();
|
||||
private final SingleColumnRowMapper<T> rowMapper = new SingleColumnRowMapper<>();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -110,7 +110,7 @@ public abstract class StoredProcedure extends SqlCall {
|
||||
* stored procedure has been called.
|
||||
*/
|
||||
public Map<String, Object> execute(Object... inParams) {
|
||||
Map<String, Object> paramsToUse = new HashMap<String, Object>();
|
||||
Map<String, Object> paramsToUse = new HashMap<>();
|
||||
validateParameters(inParams);
|
||||
int i = 0;
|
||||
for (SqlParameter sqlParameter : getDeclaredParameters()) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -35,7 +35,7 @@ public class CustomSQLExceptionTranslatorRegistrar implements InitializingBean {
|
||||
* Key is the database product name as defined in the
|
||||
* {@link org.springframework.jdbc.support.SQLErrorCodesFactory}.
|
||||
*/
|
||||
private final Map<String, SQLExceptionTranslator> translators = new HashMap<String, SQLExceptionTranslator>();
|
||||
private final Map<String, SQLExceptionTranslator> translators = new HashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -54,7 +54,7 @@ public class CustomSQLExceptionTranslatorRegistry {
|
||||
* Key is the database product name as defined in the
|
||||
* {@link org.springframework.jdbc.support.SQLErrorCodesFactory}.
|
||||
*/
|
||||
private final Map<String, SQLExceptionTranslator> translatorMap = new HashMap<String, SQLExceptionTranslator>();
|
||||
private final Map<String, SQLExceptionTranslator> translatorMap = new HashMap<>();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -45,7 +45,7 @@ public class GeneratedKeyHolder implements KeyHolder {
|
||||
* Create a new GeneratedKeyHolder with a default list.
|
||||
*/
|
||||
public GeneratedKeyHolder() {
|
||||
this.keyList = new LinkedList<Map<String, Object>>();
|
||||
this.keyList = new LinkedList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -85,7 +85,7 @@ public class SQLErrorCodesFactory {
|
||||
/**
|
||||
* Map to cache the SQLErrorCodes instance per DataSource.
|
||||
*/
|
||||
private final Map<DataSource, SQLErrorCodes> dataSourceCache = new WeakHashMap<DataSource, SQLErrorCodes>(16);
|
||||
private final Map<DataSource, SQLErrorCodes> dataSourceCache = new WeakHashMap<>(16);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -45,15 +45,15 @@ import org.springframework.jdbc.BadSqlGrammarException;
|
||||
*/
|
||||
public class SQLStateSQLExceptionTranslator extends AbstractFallbackSQLExceptionTranslator {
|
||||
|
||||
private static final Set<String> BAD_SQL_GRAMMAR_CODES = new HashSet<String>(8);
|
||||
private static final Set<String> BAD_SQL_GRAMMAR_CODES = new HashSet<>(8);
|
||||
|
||||
private static final Set<String> DATA_INTEGRITY_VIOLATION_CODES = new HashSet<String>(8);
|
||||
private static final Set<String> DATA_INTEGRITY_VIOLATION_CODES = new HashSet<>(8);
|
||||
|
||||
private static final Set<String> DATA_ACCESS_RESOURCE_FAILURE_CODES = new HashSet<String>(8);
|
||||
private static final Set<String> DATA_ACCESS_RESOURCE_FAILURE_CODES = new HashSet<>(8);
|
||||
|
||||
private static final Set<String> TRANSIENT_DATA_ACCESS_RESOURCE_CODES = new HashSet<String>(8);
|
||||
private static final Set<String> TRANSIENT_DATA_ACCESS_RESOURCE_CODES = new HashSet<>(8);
|
||||
|
||||
private static final Set<String> CONCURRENCY_FAILURE_CODES = new HashSet<String>(4);
|
||||
private static final Set<String> CONCURRENCY_FAILURE_CODES = new HashSet<>(4);
|
||||
|
||||
|
||||
static {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -50,9 +50,9 @@ public class TemporaryLobCreator implements LobCreator {
|
||||
|
||||
protected static final Log logger = LogFactory.getLog(TemporaryLobCreator.class);
|
||||
|
||||
private final Set<Blob> temporaryBlobs = new LinkedHashSet<Blob>(1);
|
||||
private final Set<Blob> temporaryBlobs = new LinkedHashSet<>(1);
|
||||
|
||||
private final Set<Clob> temporaryClobs = new LinkedHashSet<Clob>(1);
|
||||
private final Set<Clob> temporaryClobs = new LinkedHashSet<>(1);
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -96,7 +96,7 @@ public class ResultSetWrappingSqlRowSet implements SqlRowSet {
|
||||
ResultSetMetaData rsmd = resultSet.getMetaData();
|
||||
if (rsmd != null) {
|
||||
int columnCount = rsmd.getColumnCount();
|
||||
this.columnLabelMap = new HashMap<String, Integer>(columnCount);
|
||||
this.columnLabelMap = new HashMap<>(columnCount);
|
||||
for (int i = 1; i <= columnCount; i++) {
|
||||
String key = rsmd.getColumnLabel(i);
|
||||
// Make sure to preserve first matching column for any given name,
|
||||
|
||||
Reference in New Issue
Block a user