diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java index ad4c9c07a57..4be2e0ea096 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java @@ -150,7 +150,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp /** String resolvers to apply e.g. to annotation attribute values. */ private final List embeddedValueResolvers = new CopyOnWriteArrayList<>(); - /** BeanPostProcessors to apply in createBean. */ + /** BeanPostProcessors to apply. */ private final List beanPostProcessors = new CopyOnWriteArrayList<>(); /** Indicates whether any InstantiationAwareBeanPostProcessors have been registered. */ @@ -948,7 +948,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp /** * Return whether this factory holds a InstantiationAwareBeanPostProcessor - * that will get applied to singleton beans on shutdown. + * that will get applied to singleton beans on creation. * @see #addBeanPostProcessor * @see org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor */ diff --git a/spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java b/spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java index eb28c85d850..1581e66b984 100644 --- a/spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java +++ b/spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 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,7 +50,7 @@ import org.springframework.validation.annotation.Validated; * at the type level of the containing target class, applying to all public service methods * of that class. By default, JSR-303 will validate against its default group only. * - *

As of Spring 5.0, this functionality requires a Bean Validation 1.1 provider. + *

As of Spring 5.0, this functionality requires a Bean Validation 1.1+ provider. * * @author Juergen Hoeller * @since 3.1 @@ -87,7 +87,6 @@ public class MethodValidationInterceptor implements MethodInterceptor { @Override - @SuppressWarnings("unchecked") public Object invoke(MethodInvocation invocation) throws Throwable { // Avoid Validator invocation on FactoryBean.getObjectType/isSingleton if (isFactoryBeanMetadataMethod(invocation.getMethod())) { diff --git a/spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationPostProcessor.java b/spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationPostProcessor.java index b5907bf6fed..45e5d13a5fb 100644 --- a/spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2020 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,7 +50,7 @@ import org.springframework.validation.annotation.Validated; * inline constraint annotations. Validation groups can be specified through {@code @Validated} * as well. By default, JSR-303 will validate against its default group only. * - *

As of Spring 5.0, this functionality requires a Bean Validation 1.1 provider. + *

As of Spring 5.0, this functionality requires a Bean Validation 1.1+ provider. * * @author Juergen Hoeller * @since 3.1 diff --git a/spring-core/src/main/java/org/springframework/util/xml/StaxEventXMLReader.java b/spring-core/src/main/java/org/springframework/util/xml/StaxEventXMLReader.java index 839e3f05f0f..3ec0b1b6300 100644 --- a/spring-core/src/main/java/org/springframework/util/xml/StaxEventXMLReader.java +++ b/spring-core/src/main/java/org/springframework/util/xml/StaxEventXMLReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 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. @@ -38,6 +38,7 @@ import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.xml.sax.ext.Locator2; import org.xml.sax.helpers.AttributesImpl; @@ -163,9 +164,11 @@ class StaxEventXMLReader extends AbstractStaxXMLReader { this.encoding = startDocument.getCharacterEncodingScheme(); } } - if (getContentHandler() != null) { + + ContentHandler contentHandler = getContentHandler(); + if (contentHandler != null) { final Location location = event.getLocation(); - getContentHandler().setDocumentLocator(new Locator2() { + contentHandler.setDocumentLocator(new Locator2() { @Override public int getColumnNumber() { return (location != null ? location.getColumnNumber() : -1); @@ -194,7 +197,7 @@ class StaxEventXMLReader extends AbstractStaxXMLReader { return encoding; } }); - getContentHandler().startDocument(); + contentHandler.startDocument(); } } diff --git a/spring-core/src/main/java/org/springframework/util/xml/StaxStreamXMLReader.java b/spring-core/src/main/java/org/springframework/util/xml/StaxStreamXMLReader.java index fefe1ab623a..5812c4335e3 100644 --- a/spring-core/src/main/java/org/springframework/util/xml/StaxStreamXMLReader.java +++ b/spring-core/src/main/java/org/springframework/util/xml/StaxStreamXMLReader.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2020 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. @@ -23,6 +23,7 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.xml.sax.ext.Locator2; import org.xml.sax.helpers.AttributesImpl; @@ -139,9 +140,11 @@ class StaxStreamXMLReader extends AbstractStaxXMLReader { } this.encoding = this.reader.getCharacterEncodingScheme(); } - if (getContentHandler() != null) { + + ContentHandler contentHandler = getContentHandler(); + if (contentHandler != null) { final Location location = this.reader.getLocation(); - getContentHandler().setDocumentLocator(new Locator2() { + contentHandler.setDocumentLocator(new Locator2() { @Override public int getColumnNumber() { return (location != null ? location.getColumnNumber() : -1); @@ -170,7 +173,7 @@ class StaxStreamXMLReader extends AbstractStaxXMLReader { return encoding; } }); - getContentHandler().startDocument(); + contentHandler.startDocument(); if (this.reader.standaloneSet()) { setStandalone(this.reader.isStandalone()); } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java index 5c691b5c854..b69f9bed0a3 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 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. @@ -415,8 +415,8 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { TableParameterMetaData meta = new TableParameterMetaData(columnName, dataType, nullable); this.tableParameterMetaData.add(meta); if (logger.isDebugEnabled()) { - logger.debug("Retrieved meta-data: " + meta.getParameterName() + " " + - meta.getSqlType() + " " + meta.isNullable()); + logger.debug("Retrieved meta-data: '" + meta.getParameterName() + "', sqlType=" + + meta.getSqlType() + ", nullable=" + meta.isNullable()); } } } diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java index 0b401b2a87c..0856fd69eff 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 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. @@ -284,8 +284,7 @@ public class DataSourceTransactionManagerTests { boolean condition1 = !TransactionSynchronizationManager.isSynchronizationActive(); assertThat(condition1).as("Synchronization not active").isTrue(); - ConnectionHolder conHolder = new ConnectionHolder(con); - conHolder.setTransactionActive(true); + ConnectionHolder conHolder = new ConnectionHolder(con, true); TransactionSynchronizationManager.bindResource(ds, conHolder); final RuntimeException ex = new RuntimeException("Application exception"); try { diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslatorTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslatorTests.java index cef07433d31..17105ccf274 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslatorTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 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,14 +45,14 @@ public class SQLErrorCodeSQLExceptionTranslatorTests { private static SQLErrorCodes ERROR_CODES = new SQLErrorCodes(); static { - ERROR_CODES.setBadSqlGrammarCodes(new String[] { "1", "2" }); - ERROR_CODES.setInvalidResultSetAccessCodes(new String[] { "3", "4" }); - ERROR_CODES.setDuplicateKeyCodes(new String[] {"10"}); - ERROR_CODES.setDataAccessResourceFailureCodes(new String[] { "5" }); - ERROR_CODES.setDataIntegrityViolationCodes(new String[] { "6" }); - ERROR_CODES.setCannotAcquireLockCodes(new String[] { "7" }); - ERROR_CODES.setDeadlockLoserCodes(new String[] { "8" }); - ERROR_CODES.setCannotSerializeTransactionCodes(new String[] { "9" }); + ERROR_CODES.setBadSqlGrammarCodes("1", "2"); + ERROR_CODES.setInvalidResultSetAccessCodes("3", "4"); + ERROR_CODES.setDuplicateKeyCodes("10"); + ERROR_CODES.setDataAccessResourceFailureCodes("5"); + ERROR_CODES.setDataIntegrityViolationCodes("6"); + ERROR_CODES.setCannotAcquireLockCodes("7"); + ERROR_CODES.setDeadlockLoserCodes("8"); + ERROR_CODES.setCannotSerializeTransactionCodes("9"); }