diff --git a/spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java b/spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java index 1f7f50b2b1..f0df9f03f7 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java +++ b/spring-context/src/main/java/org/springframework/context/support/ReloadableResourceBundleMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -102,16 +102,13 @@ public class ReloadableResourceBundleMessageSource extends AbstractResourceBased private ResourceLoader resourceLoader = new DefaultResourceLoader(); /** Cache to hold filename lists per Locale */ - private final ConcurrentMap>> cachedFilenames = - new ConcurrentHashMap<>(); + private final ConcurrentMap>> cachedFilenames = new ConcurrentHashMap<>(); /** Cache to hold already loaded properties per filename */ - private final ConcurrentMap cachedProperties = - new ConcurrentHashMap<>(); + private final ConcurrentMap cachedProperties = new ConcurrentHashMap<>(); /** Cache to hold merged loaded properties per locale */ - private final ConcurrentMap cachedMergedProperties = - new ConcurrentHashMap<>(); + private final ConcurrentMap cachedMergedProperties = new ConcurrentHashMap<>(); /** diff --git a/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java b/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java index 5b71fa1994..6fab967f4d 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java +++ b/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -400,7 +400,9 @@ public class ResourceBundleMessageSource extends AbstractResourceBasedMessageSou } @Override - public boolean needsReload(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime) { + public boolean needsReload( + String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime) { + if (super.needsReload(baseName, locale, format, loader, bundle, loadTime)) { cachedBundleMessageFormats.remove(bundle); return true; diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java index 630a83384c..ba556502e2 100755 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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,15 +56,15 @@ public class CallMetaDataContext { /** Logger available to subclasses */ protected final Log logger = LogFactory.getLog(getClass()); - /** name of procedure to call **/ + /** Name of procedure to call **/ @Nullable private String procedureName; - /** name of catalog for call **/ + /** Name of catalog for call **/ @Nullable private String catalogName; - /** name of schema for call **/ + /** Name of schema for call **/ @Nullable private String schemaName; @@ -274,7 +274,8 @@ public class CallMetaDataContext { return new SqlOutParameter(parameterName, provider.getRefCursorSqlType(), rowMapper); } else { - throw new InvalidDataAccessApiUsageException("Return of a ResultSet from a stored procedure is not supported."); + throw new InvalidDataAccessApiUsageException( + "Return of a ResultSet from a stored procedure is not supported."); } } } @@ -493,31 +494,37 @@ public class CallMetaDataContext { } if (parameterName != null) { if (parameterSource.hasValue(parameterName)) { - matchedParameters.put(parameterName, SqlParameterSourceUtils.getTypedValue(parameterSource, parameterName)); + matchedParameters.put(parameterName, + SqlParameterSourceUtils.getTypedValue(parameterSource, parameterName)); } else { String lowerCaseName = parameterName.toLowerCase(); if (parameterSource.hasValue(lowerCaseName)) { - matchedParameters.put(parameterName, SqlParameterSourceUtils.getTypedValue(parameterSource, lowerCaseName)); + matchedParameters.put(parameterName, + SqlParameterSourceUtils.getTypedValue(parameterSource, lowerCaseName)); } else { String englishLowerCaseName = parameterName.toLowerCase(Locale.ENGLISH); if (parameterSource.hasValue(englishLowerCaseName)) { - matchedParameters.put(parameterName, SqlParameterSourceUtils.getTypedValue(parameterSource, englishLowerCaseName)); + matchedParameters.put(parameterName, + SqlParameterSourceUtils.getTypedValue(parameterSource, englishLowerCaseName)); } else { String propertyName = JdbcUtils.convertUnderscoreNameToPropertyName(parameterName); if (parameterSource.hasValue(propertyName)) { - matchedParameters.put(parameterName, SqlParameterSourceUtils.getTypedValue(parameterSource, propertyName)); + matchedParameters.put(parameterName, + SqlParameterSourceUtils.getTypedValue(parameterSource, propertyName)); } else { if (caseInsensitiveParameterNames.containsKey(lowerCaseName)) { String sourceName = caseInsensitiveParameterNames.get(lowerCaseName); - matchedParameters.put(parameterName, SqlParameterSourceUtils.getTypedValue(parameterSource, sourceName)); + matchedParameters.put(parameterName, + SqlParameterSourceUtils.getTypedValue(parameterSource, sourceName)); } else { - logger.warn("Unable to locate the corresponding parameter value for '" + parameterName + - "' within the parameter values provided: " + caseInsensitiveParameterNames.values()); + logger.warn("Unable to locate the corresponding parameter value for '" + + parameterName + "' within the parameter values provided: " + + caseInsensitiveParameterNames.values()); } } } @@ -567,8 +574,8 @@ public class CallMetaDataContext { value = ((SqlParameterValue)value).getValue(); } if (value != null) { - logger.debug("Unable to locate the corresponding IN or IN-OUT parameter for \"" + parameterName + - "\" in the parameters used: " + callParameterNames.keySet()); + logger.debug("Unable to locate the corresponding IN or IN-OUT parameter for \"" + + parameterName + "\" in the parameters used: " + callParameterNames.keySet()); } } } @@ -669,12 +676,7 @@ public class CallMetaDataContext { * @since 4.2 */ protected String createParameterBinding(SqlParameter parameter) { - if (isNamedBinding()) { - return parameter.getName() + " => ?"; - } - else { - return "?"; - } + return (isNamedBinding() ? parameter.getName() + " => ?" : "?"); } private static String lowerCase(@Nullable String paramName) { diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataContext.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataContext.java index 2962b791c7..c3310745dd 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataContext.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -206,8 +206,8 @@ public class TableMetaDataContext { */ public List matchInParameterValuesWithInsertColumns(SqlParameterSource parameterSource) { List 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 + // For parameter source lookups we need to provide case-insensitive lookup support since the + // database metadata is not necessarily providing case-sensitive column names Map caseInsensitiveParameterNames = SqlParameterSourceUtils.extractCaseInsensitiveParameterNames(parameterSource); for (String column : this.tableColumns) { @@ -226,9 +226,8 @@ public class TableMetaDataContext { } else { if (caseInsensitiveParameterNames.containsKey(lowerCaseName)) { - values.add( - SqlParameterSourceUtils.getTypedValue(parameterSource, - caseInsensitiveParameterNames.get(lowerCaseName))); + values.add(SqlParameterSourceUtils.getTypedValue( + parameterSource, caseInsensitiveParameterNames.get(lowerCaseName))); } else { values.add(null);